cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Content Type of a document

stallapragada
Champ in-the-making
Champ in-the-making
Hi

I have a lot of content types defined in my Alfresco deployment. I have a requrement to display the custom content type of the document in the properties tab of the selected document along with its custom properties. My requirement is to invoke a web script to get this information.

I did not find any readily available web scripts for doing this. Can any one help me with any pointers as to how I can retrieve this information?

-Thanks
Srikant
http://www.introspeqt.com
Download Document Capture for Alfresco http://www.introspeqt.com/iCapture.htm
4 REPLIES 4

krishr
Champ in-the-making
Champ in-the-making
Hi Srikant,

Were you able to get the Properties of the document using web scripts. Even i am faced with the issue
1) how to get the version of the document
2) how to retrieve the custom properties. i have added some properties(eg price) in customModel.xml as an aspect. How to retrieve the custom properties in web scripts.
3) how to attach a thumbnail to the document while upload and how to retrieve this information using web scripts.

regards,
Raghu.

stevegreenbaum
Champ in-the-making
Champ in-the-making
You may need to develop your own custom web script.  In the controller logic you will need to select the documents using a Lucene query and then for each returned result retrieve the properties you need.  For example, the document type can be accessed via the var mytype = document.properties.type statement in Javascript.  Other custom properties are retrieved using document.properties["yournamespace:yourcustomproperty"]

http://wiki.alfresco.com/wiki/3.2_JavaScript_API

zaizi
Champ in-the-making
Champ in-the-making
Guys,

Alfresco Share calls webscripts on the Alfresco Repository for everything it does. List of all webscripts in the repo is available at http://{yourhost}:{port}/alfresco/service/index. If you use Firefox and Firebug (or the developer tools in other browsers) when navigating Share, you'll see the REST calls to these webscripts.

There are webscripts available for everything you've described.

Ainga

krishr
Champ in-the-making
Champ in-the-making
Ainga,

Could u show some pointers on the exact syntax or exact URL to get the version, attach thumbnail and retrieve thumbnail, to retrieve custom properties.

i am modifying the folder.get.atom.ftl  as below

<?xml version="1.0" encoding="UTF-8"?>
<ArrayOfAppStoreItems xmlns="http://www.w3.org/2005/Atom">
  <generator version="${server.version}">Alfresco (${server.edition})</generator>
  <title>Folder: ${folder.displayPath}/${folder.name}</title>
  <updated>${xmldate(date)}</updated>
  <icon>${absurl(url.context)}/images/logo/AlfrescoLogo16.ico</icon>
<#list folder.children as child>
  <AppStoreItems>
    <Title>${child.name}</Title>
    <#if child.isContainer>
      <DownloadURL rel="alternate" href="${absurl(url.serviceContext)}/sample/Contentdescr/folder<@encodepath node=child/>"/>
    <#else>
      <DownloadURL rel="alternate" href="${absurl(url.serviceContext)}/api/node/content/${child.nodeRef.storeRef.protocol}/

${child.nodeRef.storeRef.identifier}/${child.nodeRef.id}/${child.name?url}"/>
    </#if>
    <iconPath>${absurl(url.context)}${child.icon16}</iconPath>
    <id>urn:uuid:${child.id}</id>
    <updated>${xmldate(child.properties.modified)}</updated>
    <Description>${child.properties.description!""}</Description>
    <Size>${child.properties.content.size}</Size>

    <Version></Version>
    <Thumbnail></Thumbnail>
    <custSmiley TongueroductPrice></custSmiley TongueroductPrice>
   
    <author>
      <name>${child.properties.creator}</name>
    </author>
  </AppStoreItems>
</#list>
</ArrayOfAppStoreItems>
<#macro encodepath node><#if node.parent?exists><@encodepath node=node.parent/>/${node.name?url}</#if></#macro>

thanks,
Raghu.