I am trying to create .page files dynamically using a java class. We have created components, FAL's, DCR's, and templates and have created several 'template' .page files that the class will use CSFile.copy based upon the corresponding components. The class will then modify the copied page file and update the DCR's and the skin in the various components. The problem is when I open the .page files, and there is an update to the components or templates, clicking update has the same behavior as clicking overwrite. Has anyone ever tried anything like this?
My latest approach is to use com.interwoven.livesite.model.util.ReIdHelper after updating the DCR's. However, I getting this error:
java.lang.IllegalStateException: VPathHelper is not initialized; check the log for a startup error.
My code doesn't call VPathHelper so I'm not sure how to resolve this issue.
LiveSiteContext lsc = new LiveSiteContext().getInstance(client);
String[] vpathstr ={destination_dir};
CSVPath[] array = VPathContext.convertToVPaths(vpathstr, client);
List newListObject = Arrays.asList(array);
Collection cvcoll = newListObject;
ReIdHelper reid = new ReIdHelper();
reid.reIdFiles(cvcoll,lsc);