10-26-2006 01:07 PM
personal(Store)
|
|- folder1
…
|
|- folderN
//Create a new folder (child of root node in store)
trace += "Step 4: creating a folder in the store.<BR>";
//Create reference to the store where this folder is going to be placed. This folder hangs from the root node as its child.
ParentReference parent_folder_ref = new ParentReference(almacen, almacen_root.getUuid(), null, Constants.ASSOC_CHILDREN, "{user_folder}"+folder_name);
trace += " parent reference created<BR>";
NamedValue[] folder_properties = new NamedValue[]{new NamedValue(Constants.PROP_NAME, false, folder_name, null)};
trace += " folder properties array created<BR>";
//Create the command
CMLCreate create_folder = new CMLCreate("user_folder_"+folder_name, parent_folder_ref, Constants.TYPE_FOLDER, folder_properties);
trace += " command created<BR>";
//Execute the command
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create_folder});
trace += " command executed<BR>";
10-29-2006 06:39 AM
ParentReference parent_folder_ref = new ParentReference(almacen, almacen_root.getUuid(), null, Constants.ASSOC_CONTAINS, "{user_folder}"+folder_name);
11-03-2006 11:16 AM
//Create a new folder (child of root node in store)
trace += "Step 4: creating a folder in the store.<BR>";
//Create reference to the store where this folder is going to be placed. This folder hangs from the root node as its child.
ParentReference parent_folder_ref = new ParentReference(almacen, almacen_root.getUuid(), null, Constants.ASSOC_CONTAINS, "{user_folder}"+folder_name);
trace += " parent reference created: "+almacen_root.getUuid()+" ·:· "+folder_name+"<BR>";
NamedValue[] folder_properties = new NamedValue[]{new NamedValue(Constants.PROP_NAME, false, folder_name, null)};
trace += " folder properties array created<BR>";
//Create the command (based on the previous reference)
CMLCreate create_folder = new CMLCreate("user_folder_"+folder_name, parent_folder_ref, Constants.TYPE_FOLDER, folder_properties);
trace += " command created<BR>";
//Execute the command
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create_folder});
trace += " command executed<BR>";
Starting web service…everything went fine.
Step 1: logged in as admin user.
Step 2: checking for existing previous stores…
store(0): alfrescoUserStore
store(1): system
store(2): lightWeightVersionStore
store(3): SpacesStore
store(4): SpacesStore
store(5): personal
The store does exist. So we retrieve it.
The store is: personal
Step 3: looking for the root node in the store.
Founded 1 nodes in the store "personal"
Root founded: org.alfresco.webservice.types.Reference@1a5f1cc5
Step 4: creating a folder in the store.
parent reference created: 081690f5-6505-11db-b0c1-a302df063455 ·:· jonas
folder properties array created
command created
command executed
Node Identifier Primary Path: /
Reference: workspace://personal/081690f5-6505-11db-b0c1-a302df063455
Type: {http://www.alfresco.org/model/system/1.0}store_root
Parent:
Properties Name Value Property Type Value Type Residual
{http://www.alfresco.org/model/system/1.0}store-protocol workspace
{ http://www.alfresco.org/model/dictionary/1.0}text
false
{http://www.alfresco.org/model/content/1.0}name 081690f5-6505-11db-b0c1-a302df063455
{ http://www.alfresco.org/model/dictionary/1.0}text
false
{http://www.alfresco.org/model/system/1.0}node-uuid 081690f5-6505-11db-b0c1-a302df063455
{http://www.alfresco.org/model/dictionary/1.0}text
false
{ http://www.alfresco.org/model/system/1.0}store-identifier personal
{http://www.alfresco.org/model/dictionary/1.0}text
false
{ http://www.alfresco.org/model/system/1.0}node-dbid 407
{http://www.alfresco.org/model/dictionary/1.0}long
false
Aspects {http://www.alfresco.org/model/system/1.0}aspect_root
Permissions Inherit: true
Assigned Permission To Authority Access
Children Child Name Child Node Primary Association Type Index
Associations To Node Association Type
Parents Child Name Parent Node Primary Association Type
11-08-2006 12:55 PM
//Create a new folder (child of root node in store)
//Create reference to the store where this folder is going to be placed. This folder hangs from the root node as its child.
ParentReference parent_folder_ref = new ParentReference(almacen, almacen_root.getUuid(), null, Constants.ASSOC_CONTAINS, "{user_folder}"+folder_name);
trace += " parent reference created:<BR>";
NamedValue[] folder_properties = new NamedValue[]{new NamedValue(Constants.PROP_NAME, false, folder_name, null)};
//Create the command (based on the previous reference)
CMLCreate create_folder = new CMLCreate(folder_name, parent_folder_ref, Constants.TYPE_FOLDER, folder_properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[]{create_folder});
trace += " command created<BR>";
//Execute the command
WebServiceFactory.getRepositoryService().update(cml); //This is the missing line
Node Identifier Primary Path: /
Reference: workspace://personal/a0bb0866-6e81-11db-b14b-fbaff357da54
Type: {http://www.alfresco.org/model/system/1.0}store_root
Parent:
[…]
Children Child Name Child Node Primary Association Type Index
{user_folder}jonas workspace://personal/63f80dac-6f4c-11db-8930-df44c0173c45 true {http://www.alfresco.org/model/content/1.0}contains 0
{user_folder}jonas workspace://personal/65ed58d3-6f4d-11db-9132-2fa3219893eb true {http://www.alfresco.org/model/content/1.0}contains 1
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.