Is it possible to query WCM content through web-script

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2008 05:16 AM
I have been reading about the WCM capabilities of Alfresco and the web scripts framework. One thing, that is not very clear to me so far is whether it is possible to query the content created using WCM webforms through web-scripts. I think that it should be; but I am not 100% sure.
Similar question: how do I distinguish between different kinds of WCM content. For e.g. I have one form for product data-sheet and one form for product reference. How do I fetch all the instances of product references or all the instances of product data-sheet using web script calls?
-Ken
Similar question: how do I distinguish between different kinds of WCM content. For e.g. I have one form for product data-sheet and one form for product reference. How do I fetch all the instances of product references or all the instances of product data-sheet using web script calls?
-Ken
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2008 11:22 AM
Your hunch is spot on - it is indeed possible to query WCM content (including both Web Form backed and "static" files) via Web Scripts. For Javascript-backed Web Scripts, you can use the AVM JS API (http://wiki.alfresco.com/wiki/JavaScript_API#AVM_API), while for Java-backed Web Scripts you'd use the AVMService Java API (http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/avm/AVMService.html).
As for querying for specific types, I can think of two ways to do that (this is off the top of my head - there may be more approaches as well):
Cheers,
Peter
As for querying for specific types, I can think of two ways to do that (this is off the top of my head - there may be more approaches as well):
- The first is to query for the "parentformname" attribute (a property which is automatically populated by the WCM system). For example the Lucene query
would search for all product data-sheets containing the word "Alfresco" somewhere in the full text.TEXT:"Alfresco" AND @\{http\://www.alfresco.org/model/wcmappmodel/1.0\}parentformname:'Product Data-Sheet"
- Use XML Metadata Extraction (http://wiki.alfresco.com/wiki/Metadata_Extraction#XML_Meta-data_Extractor_Configuration_for_WCM) to index a custom property with the name of the type.
Cheers,
Peter

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2008 01:13 PM
Thanks Peter, this is real good start for me.
-Ken
-Ken
