Best way to append content
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2007 04:50 AM
Hello!
I want to append something to content in the most efficient way. For example, if I had a text file that contains "This is a sample content", I would like to append "…and this is appended sample content" to it.
I know: I can read content, do appending in my program and then overwrite content with the new one. However, it would improve performance (at least network traffic) if there was a special functionality in Alfresco WS API for this. Is there an alternative to read-append-overwrite scenario?
Thanks in advance!
Kind regards,
Igor
I want to append something to content in the most efficient way. For example, if I had a text file that contains "This is a sample content", I would like to append "…and this is appended sample content" to it.
I know: I can read content, do appending in my program and then overwrite content with the new one. However, it would improve performance (at least network traffic) if there was a special functionality in Alfresco WS API for this. Is there an alternative to read-append-overwrite scenario?
Thanks in advance!
Kind regards,
Igor
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2007 06:06 AM
The Web Service API doesn't provide this out-of-the-box.
However, you could write a very simple Web Script http://wiki.alfresco.com/wiki/Web_Scripts that provides the required behaviour. The Web Script just provides a public custom URL to invoke. Within the Web Script you can Javascript to append the text…
// find the doc - from noderef or path passed on url
doc = …;
// append text
doc.content = doc.content + " some new text";
However, you could write a very simple Web Script http://wiki.alfresco.com/wiki/Web_Scripts that provides the required behaviour. The Web Script just provides a public custom URL to invoke. Within the Web Script you can Javascript to append the text…
// find the doc - from noderef or path passed on url
doc = …;
// append text
doc.content = doc.content + " some new text";
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2007 07:28 AM
Thanks, David!