Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Create a project from a template
Digitalmind_User
How to create a project from a template? Ok, it is possible to use CreateObject with appropriate type and subtype. Then there is a problem to copy all the subnodes. ListObjects for the template returns 0 children. Also I didn't find anything of value in the GetObjectInfo function results to acquire the child objects of a project which the template was created for.I would be very grateful for any clues, comments and especially .NET examples.Thanks!
Find more posts tagged with
Comments
Appu_Nair
I did not try createobject with the subtype as you said because I could not.The project template request handler is probably not exposed to LAPIThat does not prevent you from writing the API yourself if you are so inclined.Another thing I tried is that is If you have the 'Admin' login you can call lapi's XMLimport on a template folder that has been exported as xml.That will create the new project and clicking on finish will also create the sub nodes.Clue is that the dependent node info is also stored in the exported xml.If you do a base64 decode on this you can actually see all the nodes info so you may also be able to do a main xml import and then another one for the actuals.The only down side that I notice is that the xmlimport is not giving you the objectid that it created so you are really out of luck unless you were checking the container it was created in.This snippet of code was tested on a xml file that I had exported from a project template(Export Template function.[Code Snippet Starts]volID = -2000; //Parent VolumeID objID = 2000; //Parent ObjectID objName = "New Document"; //Object Name in Livelink //where the xported template is FilePath = "C:\\temp\\Appu_Project_Template.xml"; //this variable is not used but has to be defined LLValue XMLImportConfig = new LLValue().setAssocNotSet(); LLValue results = new LLValue().setAssocNotSet(); /* public int XMLImport( int parentID, LLValue XMLImportConfig, String filePath, LLValue results) */ //Add the Document if (doc.XMLImport( objID, XMLImportConfig, FilePath, results) == 0) { System.out.println("Document Added Successfully"); } else { System.out.println("Failed to Add Document"); //Error Checking System.out.println("Status Code: " + session.getStatus()); System.out.println("Api Error: " + session.getApiError()); System.out.println("Error Message: " + session.getErrMsg()); System.out.println("Status Message: " + session.getStatusMessage()); }[Code Snippet Ends]