How to set the UuID of a Reference manually

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2010 09:01 AM
Hello there,
i have the following piece of code to create a folder. Now i want to set the uuid of the new Reference manually when the new folder is created. How can i do that ? Thank you very much.
i have the following piece of code to create a folder. Now i want to set the uuid of the new Reference manually when the new folder is created. How can i do that ? Thank you very much.
public String createFolder(String folderPath, final String folderId,final String folderName) throws RemoteException, RepositoryFault { final ParentReference parentReference = new ParentReference(STORE,null,folderPath,Constants.ASSOC_CONTAINS,getChildName(folderName)); final String newId = (null == folderId) ? "-1" : folderId; CMLCreate create = new CMLCreate(newId, parentReference, null, null, null, Constants.TYPE_FOLDER, createDefaultProperties(folderName)); //create content manipulation language CML cml = new CML(); //set content to create cml.setCreate(new CMLCreate[]{create}); UpdateResult[] result; try { WebServiceFactory.getRepositoryService().update(cml); } catch (RepositoryFault e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } return folderPath; }
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2010 06:15 AM
I think that you can't set manually the UUID, this value is generated by a specific implementation of this algorithm.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 08:41 AM
try with this:
Regards..
public static final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore");…Reference ref = new Reference();ref.setUuid("2e1d57d4-036b-4a4b-8bc0-02670081f45c");ref.setStore(Properties.STORE);
Regards..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2010 08:45 AM
I'm sorry, had not understood!! I believe is not possible, the uuid is automatic.. Regards
