• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] select and use medata shema "on the fly"

#1 2009-08-31 15:22:37

kzone
Member
Company: Synotis
Registered: 2008-07-06
Posts: 911
Website

[resolved] select and use medata shema "on the fly"

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.


do Svg your graphical language !!!

Offline

#2 2009-08-31 15:56:48

kzone
Member
Company: Synotis
Registered: 2008-07-06
Posts: 911
Website

Re: [resolved] select and use medata shema "on the fly"

ok ,

solution is  quite simple (find during writing question smile

I've created a simple routines where i put all string structure (that i've created before) :

Code:

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 !)


Uploaded Images

Last edited by kzone (2009-08-31 16:34:37)


do Svg your graphical language !!!

Offline

#3 2009-08-31 17:23:47

Morbo
Member
Company: Inserm
Registered: 2009-05-14
Posts: 228

Re: [resolved] select and use medata shema "on the fly"

Good job there wink!

Offline

#4 2009-09-01 09:23:27

kzone
Member
Company: Synotis
Registered: 2008-07-06
Posts: 911
Website

Re: [resolved] select and use medata shema "on the fly"

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 smile

++

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 smile

Last edited by kzone (2009-09-01 11:45:16)


do Svg your graphical language !!!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] select and use medata shema "on the fly"

Board footer

Powered by FluxBB