It's all about the answers!

Ask a question

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

vinitha dsouza (1271364) | 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.2k27) | answered Jun 12 '17, 11:21 p.m.
edited Jun 12 '17, 11:25 p.m.

You have to do the following

1) ILoadRuleFactory.getLoadRule(...)
2) ILoadRule2.getLoadOp(...)

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.

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...");;
But When i try to run i get the below error :
Exception in thread "main" 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.

<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:

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.

vijayakumar ramesh commented Mar 30, 10:42 a.m.
Hello Shashikant,

I am also gettign same error as above mentioned user but it is not solved even after placing ,

Create a file named (if it doesn’t exist) under path to your "JDK version/jre/lib" and then add the following line in it.

javax.xml.accessExternalSchema = all. 

Any other solutions ?

Your answer

Register or to post your answer.