cancel
Showing results for 
Search instead for 
Did you mean: 

bug? error locating /app:company_home/cm:test/cm:2010?

dhc1980
Champ in-the-making
Champ in-the-making
hi all,
i am playing around with Alfresco 3.3 webservice API and created a space Company Home/Test/2010 from explorer.
however, when use the web service API to upload a document to the 2010 space by setting
ParentReference companyHomeParent = new ParentReference(storeRef, null, "/app:company_home/cm:test/cm:2010", Constants.ASSOC_CONTAINS, null);
it always fails to locate the space.

in contrast, i tried to upload to another space
ParentReference companyHomeParent = new ParentReference(storeRef, null, "/app:company_home/cm:test/cm:test1", Constants.ASSOC_CONTAINS, null);

and it succeeded.

can anyone kindly point out if it is a bug or is there anything special to be taken care of with numerical space ??

thx
4 REPLIES 4

openpj
Elite Collaborator
Elite Collaborator
You have to encode the path in ISO9075 because you are using blank spaces or number for you path.
The path of your content must be encoded in this way:


String pathEncoded =  "/app:company_home"
+"/cm:"+ISO9075.encode("test")
+"/cm:"+ISO9075.encode("2010");
ParentReference companyHomeParent = new ParentReference(storeRef, null, pathEncoded, Constants.ASSOC_CONTAINS, null);
….
Hope this helps Smiley Wink

dhc1980
Champ in-the-making
Champ in-the-making
thx for the reply
i will give it a try

dhc1980
Champ in-the-making
Champ in-the-making
just tried.
It is no problem to create the folder now
however, the problem came when i want to retrieve the folder.

shall i use the ISO encode to retrieve the folder??

btw, i encounter problem when i create a folder with 2 words , for e.g. South America

dhc1980
Champ in-the-making
Champ in-the-making
finally, igured out the cause. please ignore the previous post.