Adding or Creating and deleting Content
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2012 05:57 AM
Hi,
I am a new user in alfresco .I want to add content as well as delete the content.Please help me accomplish this,how can i do this?
I am a new user in alfresco .I want to add content as well as delete the content.Please help me accomplish this,how can i do this?
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2012 04:52 PM
Are you using Alfresco Explorer, Alfresco Share, some sort of file protocol (like FTP, IMAP, WebDAV, CIFS), or writing code to add and delete content?
Jeff
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2012 01:58 AM
Hi Jeff,
I am using Alfresco 4.0c community version i.e Alfresco Explorer.I want to add content like (text document or image ) and delete it using the webscript
I am using Alfresco 4.0c community version i.e Alfresco Explorer.I want to add content like (text document or image ) and delete it using the webscript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2012 02:00 AM
Hi Jeff,
I want to accomplish this ASAP so that i can proceed further.
I want to accomplish this ASAP so that i can proceed further.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2012 08:47 AM
It sounds like you are trying to upload content and delete content via web scripts. You might want to look at the Hello World examples from the Alfresco Developer Guide. One of the hello world examples shows how to do a form post and then how to persist that content from within the controller.
There is also a free tutorial on web scripts that I wrote a while back but is still applicable.
Packt offers several books on Alfresco including one by Ugo Cei called Alfresco 3 Web Services, which has a lot of content on web scripts.
In addition to web scripts, however, you might also consider using one of the Apache Chemistry APIs. Chemistry includes client-side APIs for Java, Python, PHP, and .NET and allows you to hit the Alfresco repository remotely to create, query, update, and delete content. The custom content types tutorial on ecmarchitect.com includes some Java-based CMIS examples that do this.
Jeff
There is also a free tutorial on web scripts that I wrote a while back but is still applicable.
Packt offers several books on Alfresco including one by Ugo Cei called Alfresco 3 Web Services, which has a lot of content on web scripts.
In addition to web scripts, however, you might also consider using one of the Apache Chemistry APIs. Chemistry includes client-side APIs for Java, Python, PHP, and .NET and allows you to hit the Alfresco repository remotely to create, query, update, and delete content. The custom content types tutorial on ecmarchitect.com includes some Java-based CMIS examples that do this.
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2012 06:24 AM
Hi Jeff,
That's really what i want.I want to delete the content by running the web script like what i did in creating the hello world web script.
Please help me going through this.as i am unable to find the way to delete the code through the web script.
Thankks and Regards
Aashish Raj
That's really what i want.I want to delete the content by running the web script like what i did in creating the hello world web script.
Please help me going through this.as i am unable to find the way to delete the code through the web script.
Thankks and Regards
Aashish Raj
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2012 10:34 AM
The hello world examples show you how to set up a web script. If you want to delete something from the repository, that code will live in your web script controller. You should look at the JavaScript API to see what you can do from within your web script controller.
For example, suppose you call a web script and pass in a node reference. You could do a search on that node reference and then delete the node, like this:
Hope that helps.
Jeff
For example, suppose you call a web script and pass in a node reference. You could do a search on that node reference and then delete the node, like this:
if (args.nodeRef == null || args.nodeRef.length == 0) { logger.log("Node ref arg not set"); status.code = 400; status.message = "Node ref has not been provided"; status.redirect = true;} else { logger.log("Getting node"); var curNode = search.findNode(args.nodeRef); if (curNode == null) { logger.log("Node not found"); status.code = 404; status.message = "No node found for node ref:" + args.nodeRef; status.redirect = true; } else { curNode.remove(); model.nodeRef = args.nodeRef; }}
Hope that helps.
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2012 12:39 AM
Hello Jeff,
Thank you very much for the information,my requirement is that suppose i have created or added an image or some text file like "HELLO WORLD" through first of all writing the hello world.get.desc.xml and then response is given through free-marker-template when we run the web script,what would be the exact number of steps and procedure i follow in order to delete the helloworld file or any image if i have added any.
Can u give me the exact procedure and steps to delete that content.
Thank you very much for the information,my requirement is that suppose i have created or added an image or some text file like "HELLO WORLD" through first of all writing the hello world.get.desc.xml and then response is given through free-marker-template when we run the web script,what would be the exact number of steps and procedure i follow in order to delete the helloworld file or any image if i have added any.
Can u give me the exact procedure and steps to delete that content.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2012 11:16 AM
I've given you examples on how to set up a web script and I've given you controller code that will delete an object given a node reference. I've also pointed you to the JavaScript API so that if this isn't exactly what you need, you can look at that documentation to determine an alternative way to code your controller.
That should be sufficient. If it isn't, then I must be misunderstanding what you are trying to do.
I'm happy to try to provide further assistance, but it would probably be more productive if you would tell me what you've tried and identify any specific questions you have.
Jeff
That should be sufficient. If it isn't, then I must be misunderstanding what you are trying to do.
I'm happy to try to provide further assistance, but it would probably be more productive if you would tell me what you've tried and identify any specific questions you have.
Jeff
