For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

cancel
Showing results for 
Search instead for 
Did you mean: 
Member II

For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

For Alfresco 5.2, when creating a node via API call, the folder name might already exist.

Is it possible to either overwrite the folder, or get the folder node id in the response?

6 Replies
Senior Member II

Re: For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

Hi,

You can create your custom webscript to create folder and write login in that webscript that  if folder already exist then return  noderef otherwise create folder and return.

Thanks & Regards,
Sanjay
Member II

Re: For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

Hello Sanjay,

Thanks for the prompt response. Sorry for sounding amateur, but could you point me to where / how I can begin writing this webscript in alfreco to be available as an API?

Get Outlook for Android<https://aka.ms/ghei36>

Established Member II

Re: For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

Hello,

Asuming you are talking about REST API you maybe could run a query before create the new folder to check its existence.

Depending on the result of the query you could delete and create or use the current folder.

Best

Member II

Re: For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

Hi Roberto,

Yes it is REST API.

Was hoping to avoid running a query as our Alfresco Search currently is not working and might not be resolved for quite a while longer, suspecting it is due to authentication issues with our SOLR4.

If this is the only feasible option, I’ll look into getting the query/search working as well.

Best Regards

Billy

Senior Member II

Re: For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

Hi,

You can create REST API 2 ways.

1)Using webscript(javascript or java based script)

http://docs.alfresco.com/5.1/references/API-JS-createFolder.html

https://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html

2) Create Public api which are used by adf. 

https://github.com/dgradecak/alfresco-mvc/wiki/REST

Thanks & Regards,
Sanjay
Established Member II

Re: For Alfresco 5.2, when creating a node, the folder name might already exist. Is it possible to either overwrite the folder, or get the folder node id in the response?

Hello Billy,

It's not the only option jus the easiest one.

You always can check manually the existence of the node listing the childs of the parent folder and comparing the names. You can do that in your own application or in a custom rest service in Alfresco that you could call from your app.

Regards