It's all about the answers!

Ask a question

How to load the repository workspace using load rule programatically??


vinitha dsouza (101949) | asked Jun 12 '17, 4:36 a.m.

Hello team

I have a load rule generated programmatically.

how can i load a repository work space using a load rule using client API's??

Thank You very much 

One answer



permanent link
Shashikant Padur (4.1k27) | answered Jun 12 '17, 11:21 p.m.
JAZZ DEVELOPER
edited Jun 12 '17, 11:25 p.m.

You have to do the following

1) ILoadRuleFactory.getLoadRule(...)
2) ILoadRule2.getLoadOp(...)
3) ILoadOperation.run()

You could also use the scm command line to load using the load rule by running "scm load <workspace> --remote-rules <loadrulefile> or --local-rules <loadrulefile>". Run "scm help load" for more information.


Comments
vinitha dsouza commented Jun 13 '17, 4:39 a.m.

Hi ,i used the below code :

 String f = "D:/SCM/test"+".loadrule";
        InputStream ins = new FileInputStream(f);
        Reader xmlReader = new InputStreamReader(ins);
     ILoadRule2 rule = ILoadRuleFactory.loadRuleFactory.getLoadRule(StreamName, xmlReader, monitor);                                   
ILoadOperation loadoperator = rule.getLoadOp(sandbox, p, monitor);
 monitor.subTask("loading files from RTC server...");
 loadoperator.run(monitor);
But When i try to run i get the below error :
Exception in thread "main" com.ibm.team.filesystem.client.FileSystemException: Error parsing load rule: schema_reference: Failed to read schema document 'LoadRule.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
How can i use the reader parameter ?


Shashikant Padur commented Jun 14 '17, 12:30 a.m. | edited Jun 14 '17, 12:46 a.m.
JAZZ DEVELOPER

<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333; min-height: 16.0px} span.s1 {font-kerning: none} </style>

A bit of googling I found this link: https://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8

Try out one of the solutions and see if it works.


By the way, you should check ILoadRuleFactory.isXMLLoadRule(xmlReader) and if it returns true then call ILoadRuleFactory.getLoadRule(wsConn, xmlReader, monitor). Also I see that you are passing a "StreamName" to the getLoadRule method but it should be a IWorkspaceConnection.

Your answer


Register or to post your answer.