You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
hi,
I have defined some metadata schema and it's the only parameter that change in my job.
Is it possible to defined that parameter like a variable.
Algo :
- read the name of the file
- switch (filename) : get metadataStructure(filename)
- Apply that structure to the file
- mapping file
...etc
I was thinking to use a string pattern like defined in component tFileInputXXX (cutomize pattern)
and put in hashmap (key_file_name,structure_pattern) to create the structure ...
but find no way to !!
Coulb be possible !?
thanks for your help
Regards
laurent.
Offline
ok ,
solution is quite simple (find during writing question ![]()
I've created a simple routines where i put all string structure (that i've created before) :
import java.util.Map;
public class Structure {
private static Map<String,String> structure = null;
private static void init(){
if(Structure.structure == null)
Structure.structure = new java.util.HashMap<String,String>();
Structure.structure.put("751", "10,1,23,23,23,8,3,13,16,3,37,28,31,5,26,3,1,2,1,1,16,1,1,1,1,36,28,30,5,22,*");
}
public static String getStructure(String key){
Structure.init();
return Structure.structure.get(key);
}
}And in my job , I retrieve the structure thanks key (in my case from msgbox or tfielchooser componenet)
++
edit : ony work where pattern is possible (excel doesn't !)
Last edited by kzone (2009-08-31 16:34:37)
Offline
hi and thanks
hope i'll find a way to do the "same" with Excel schema ...(gonna try with metaModel api when i''ll have got some time ![]()
++
Edit : and too bad .. doesn't work like expected ... factory reading files with differents structures is not so simple .. !!
it will be a good think to be able to choice a pre-defined structure due to one (or more) variable parameters !
Oh .. I know you and I've already got your structure ... i'll apply to you ![]()
Last edited by kzone (2009-09-01 11:45:16)
Offline
Pages: 1