create folder

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 10:56 AM
hi mates.. im stuck trying to create a folder..
error message: 11020024 Invalid store ref: Does not contain :// PATH:/app:company_home
asdf is the folder which im trying to create
NodeRef folder = new NodeRef("PATH:/app:company_home/app:sites"); fileFolderService.create(folder, "asdf", ContentModel.TYPE_FOLDER);
error message: 11020024 Invalid store ref: Does not contain :// PATH:/app:company_home
asdf is the folder which im trying to create
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 11:06 AM
Your NodeRef is nonsense. NodeRefs look like workspace://SpacesStore/1234 in String format where workspace is the protocol, SpeaceStore is the Store and ID is the numeric node id.
You need to obtain the node ref of the folder before calling create, either by search or some other lookup method.
You need to obtain the node ref of the folder before calling create, either by search or some other lookup method.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 11:24 AM
thnx for ur reply.. sorry i have no clue how to create a folder with alfresco api.. thats why that line of code looks like crap..
can u link to a page where it is described in detail.. guess this couldnt be such a big deal if u create a folder once.
this worked but it creates a folder where i dont want it:
can u link to a page where it is described in detail.. guess this couldnt be such a big deal if u create a folder once.
this worked but it creates a folder where i dont want it:
@Override protected void executeImpl(Action uAction, NodeRef uNodeRef) { // TODO Auto-generated method stub fileFolderService.create(uNodeRef, "asdf", ContentModel.TYPE_FOLDER); }
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 12:20 PM
Refer alfresco api for file folder service from http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/model/FileFolderServi...

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2013 12:26 PM
thnx for ur reply.. i found this: https://forums.alfresco.com/forum/developer-discussions/repository-services/get-company-home-noderef...
it worked for me to create folders at company home.. can someone tell me how the query string have to look like to get a noderef for sites in company_home???
ok i got it.. the query has to look like this:
it worked for me to create folders at company home.. can someone tell me how the query string have to look like to get a noderef for sites in company_home???
StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH, "/app:company_home");NodeRef companyHomeNodeRef = null;try{ if (rs.length() == 0) { throw new AlfrescoRuntimeException("Didn't find Company Home"); } companyHomeNodeRef = rs.getNodeRef(0);}finally{ rs.close();}
ok i got it.. the query has to look like this:
ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH, "/app:company_home/st:sites");
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2013 09:06 AM
/app:company_home/st:sites/cm:${SITE_SHORT_NAME}

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2013 10:31 AM
thnk u all for ur help..
