cancel
Showing results for 
Search instead for 
Did you mean: 

How to create sub-folder in stores repository?

kannank
Champ in-the-making
Champ in-the-making
Hi,

I am working in .NET 2003 / 2005 application - I have referred your dotNET2 sample and that is very useful to us.

Now I would like to create new folder in alfresco from our .NET 2005 application - Please give me some clue for that.

I have tried the following code,

Alfresco.RepositoryWebService.Reference reference = new Alfresco.RepositoryWebService.Reference();
reference.store = this.repoService.createStore(Alfresco.RepositoryWebService.StoreEnum.workspace, "Folder1");

It looks like the store is created and I am not able to view the store in web page - I guess that I am doing something wrong in the above code.

Please give some clue to create new folder when user select some existing folder and click on the create button.

I need this infomation very urgently,so your early reply is appreciated.

Looking for your message,

Thanks,

K.Kannan.
4 REPLIES 4

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

In Alfresco a store is a collection of nodes with a single root node.  For example the 'SpacesStore' is used by the UI as the main store to contain the folders and files of the application.

If you want to create a new folder via web services, that can be seen from within the web client UI then the createStore method is not the correct way to do this.

Instead look at the update method on the respository web service.  Here you will be able to form a CML statement which will create a node of type folder with a parent reference to the folder within which you want your new folder to appear.

Hope this helps,
Roy

tim-erwin
Champ in-the-making
Champ in-the-making
Hi!

If you want to create a new folder via web services, that can be seen from within the web client UI then the createStore method is not the correct way to do this.

What than is the createStore method for? I tried to use it with WS - of course it failed  :roll:

tim-erwin
Champ in-the-making
Champ in-the-making
Oh, I just recognized: createStore() did not fail. There is a new store with the given name. I'll try and play around with it…

The question remains: Why should we not use the createStore() with WS?

derek
Star Contributor
Star Contributor
The store used by the conventional clients is workspace://SpacesStore.  If you want to have the built in clients interact with your folder, then you should put them somewhere below "Company Home".  You're not restricted to that location, ofcourse.  createStore creates a new tree of nodes, i.e. a new root node will be created for you.  It'll have its own Lucene index for one thing.