It's all about the answers!

Ask a question

How to load a workspace component wise using java api


Neerav Salaria (3132) | asked May 10 '10, 1:53 a.m.
Till now i have been using scm load command to load a workspace component wise ...but now i need to perform the same operation using a java api ..can anyone suggest a solution for this ....to load a workspace component wise in a local folder using a java api ..

I am using this way to load a workspace thru java api ..

1) IFilesystemRestClient client = (IFilesystemRestClient ) teamRepository.getClientLibrary(IFilesystemRestClient .class);
2) ParmsLoad plo = new ParmsLoad();
3) plo.backupDilemmaHandler = new ParmsBackupDilemmaHandler();
4) plo.backupDilemmaHandler.backupEnabled = false;
5) plo.componentVersionablesToLoad = new ParmsLoadComponentVersionables[] {new ParmsLoadComponentVersionables()};
6)plo.componentVersionablesToLoad.sandboxPath = subfolder; //selected path
7)
// plo.componentVersionablesToLoad.componentItemId = component.getItemId().getUuidValue(); // component you want to load

8) try{
9) client.getLoadCFA(plo,null);
10) flag =1;
}
11) catch(Exception e){
12) System.out.println(e);
// load 1 component at a time
13) loop
14) //list of components
plo.componentVersionablesToLoad.componentItemId = component.getItemId().getUuidValue(); // component you want to load
15) client.postLoadCFA(plo, null);

//unload it
loop;
}
16) if(flag==0){
// load the entire workspace
17) client.postLoadCFA(plo, null);

//unload it
}
But here i just want to know that

1) how to intialize client (as its value is null) after the line 1.
2) does client.postLoadCFA() loads all components by default i.e if i dont write statement 7 , as in case of no collision i want the enitre workspace to load

Be the first one to answer this question!


Register or to post your answer.