cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to download Custom content types created

saina
Champ in-the-making
Champ in-the-making
Hi All,
Am currently working on Alfresco 4.0. I have few custom content types created in share.
I Created a folder ,applied versionable rule to it and created few custom content types and Out of the box content types(i.e HTML,Plain Text) inside that folder.Now I want to download  these files,am able to download out of box content types but unable to download custom content types.Am getting some Webscript error. The download functionality is out of box one,I don't have any other java/Webscript written for this.

In my share-config-custom.xml these are the content types added.I added node and model types for these.

<create-content>
<content id="plain-text" mimetype="text/plain" label="Guidance Text" itemid="sk:HelpText" icon="text"/>   <content id="plain-text" mimetype="text/plain" label="Declaration Text" itemid="sk:ContextualText" icon="text"/>
</create-content>

Am able to create custom content types properly.  But unable to download them.

Can some one please help me to solve this issue,

Thanks,
Saina
9 REPLIES 9

afaust
Legendary Innovator
Legendary Innovator
Hello,

what is the web script error that you get? Custom content types should be downloadable - I use them almost all the time and had no problem yet…

Regards
Axel

saina
Champ in-the-making
Champ in-the-making
Hi Afaust,
When I click on a content Named "Test" to download, am getting the following error:

The Web Script /alfresco/s/api/node/content/versionStore/version2Store/a8cc47ae-7bfc-46bb-8fe5-88edd8efe4bd/Test has responded with a status of 404 - Not Found.

404 Description: Requested resource is not available.
 
Message: 11050002 Unable to locate content for node ref versionStore://version2Store/a8cc47ae-7bfc-46bb-8fe5-88edd8efe4bd (property: {http://www.alfresco.org/model/content/1.0}content)
  
Exception: org.springframework.extensions.webscripts.WebScriptException - 11050002 Unable to locate content for node ref versionStore://version2Store/a8cc47ae-7bfc-46bb-8fe5-88edd8efe4bd (property: {http://www.alfresco.org/model/content/1.0}content)

afaust
Legendary Innovator
Legendary Innovator
Hello,

/alfresco/s/api/node/content/versionStore/version2Store/a8cc47ae-7bfc-46bb-8fe5-88edd8efe4bd/Test

That is a very interesting URL you have there - this means you attempt to download content from a frozen version node (e.g. an older version), not the current version.

Unable to locate content for node ref versionStore://version2Store/a8cc47ae-7 … edd8efe4bd (property: {http://www.alfresco.org/model/content/1.0}content)

This means that the node does not have any associated content. I presume that you DID enter some text into the editor / text area when creating your node. Please use the node browser to investigate both your current node (in workspace://SpacesStore) and the specific version that you try to access. Check that the cm:content property exists in the properties table and is not listed as "null".

Regards
Axel

saina
Champ in-the-making
Champ in-the-making
Hi AFaust,
Thanks for the reply AFaust,

Yes..!! I want to download the previous version of it..!! I edited a content and saved it.,Since I applied versionable rule there, I can see the previous versions of it..And When I want to download the previous version, am getting this error..
But The same case for cm:contentTypes(Out of box content types) If I edit it and save it is saving with new version and am able to download older version of it without any error., but unable to download custom content types..

saina
Champ in-the-making
Champ in-the-making
Hi Axel,

Am facing this problem while downloading previous version of the custom content type. Can you pls help me to solve this issue..?

Thanks,
Saina

afaust
Legendary Innovator
Legendary Innovator
Hello,

have you checked the state of the node via the Node Browser? Does the content property exist for that version node? It could be that a version is created "too soon", i.e. before the content is actually saved on the node.

Regards
Axel

saina
Champ in-the-making
Champ in-the-making
Hi

I checked for the present version's noderef in node browser,I found the content there and also cm:content property present.,
but for the previous version when i ran that noderef in the nodebrowser I found the content but cm:content property and cm:versionType ,both are null for this.
I am finding this only for custom content types, Out-of-the box contentTypes (cm:contentTypes) am able to download the previous version..
Am not able to find why so..? Do we need to mention anything in our config files for download of custom contents..?

afaust
Legendary Innovator
Legendary Innovator
Hello,

no, you do not need to specify anything special in your configuration. My bet is that something with your versioning rule is messing up your objects - but from here, I am unsure what that might be.

Regards
Axel

saina
Champ in-the-making
Champ in-the-making
Hi Axel,
I removed the version rule and checking, am getting the following error.
<———- error starts here———————>
The Web Script /alfresco/s/api/node/content/versionStore/version2Store/8b995bf4-e54e-419e-a0c7-de4a8897c580/Test1234 has responded with a status of 404 - Not Found.

404 Description: Requested resource is not available.
 
Message: 11060016 Unable to locate content for node ref versionStore://version2Store/8b995bf4-e54e-419e-a0c7-de4a8897c580 (property: {http://www.alfresco.org/model/content/1.0}content)
  
Exception: org.springframework.extensions.webscripts.WebScriptException - 11060016 Unable to locate content for node ref versionStore://version2Store/8b995bf4-e54e-419e-a0c7-de4a8897c580 (property: {http://www.alfresco.org/model/content/1.0}content)
  
org.alfresco.repo.web.scripts.content.StreamContent.streamContent(StreamContent.java:380)
org.alfresco.repo.web.scripts.content.StreamContent.streamContent(StreamContent.java:315)
org.alfresco.repo.web.scripts.content.ContentGet.execute(ContentGet.java:167)
org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:407)
org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:476)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:514)
org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:330)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594)
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
java.lang.Thread.run(Thread.java:662)
  
Server: Enterprise v4.0.2 (.9 38) schema 5,033
Time: Dec 6, 2012 10:49:54 AM
  
Diagnostics: Inspect Web Script (org/alfresco/cmis/content.get)

<———- error ends here—————————————————————————————————>


At the end of the error I can see a link to : " Diagnostics: Inspect Web Script (org/alfresco/cmis/content.get)"
when I click on that link I can see the below thing,

Web Script: org/alfresco/cmis/content.get
Generated from /alfresco/s/script/org/alfresco/cmis/content.get on Dec 6, 2012 10:53:30 AM


Script Properties
Id: org/alfresco/cmis/content.get
Short Name: Get Content (getContent)
Description: Gets the content stream for the specified document, or gets a rendition stream for a specified rendition of a document. 
Authentication: guest
Transaction: required
Method: GET
URL Template: /cmis/i/{id}/content{property}?a={attach?}&streamId={streamId?}
URL Template: /cmis/s/{store}/i/{id}/content{property}?a={attach?}&streamId={streamId?}
URL Template: /cmis/p{path}/content{property}?a={attach?}&streamId={streamId?}
URL Template: /cmis/s/{store}/p{path}/content{property}?a={attach?}&streamId={streamId?}
URL Template: /api/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}&streamId={streamId?}
URL Template: /api/path/content{property}/{store_type}/{store_id}/{nodepath}?a={attach?}&streamId={streamId?}
URL Template: /api/avmpath/content{property}/{store_id}/{avmpath}?a={attach?}&streamId={streamId?}
URL Template: /api/node/{store_type}/{store_id}/{id}/content{property}?a={attach?}&streamId={streamId?}
URL Template: /api/path/{store_type}/{store_id}/{nodepath}/content{property}?a={attach?}&streamId={streamId?}
Format Style: argument
Default Format: [undefined]
Negotiated Formats: [undefined]
Implementation: class org.alfresco.repo.web.scripts.content.ContentGet
Extensions: [undefined]

Store: workspace://SpacesStore/app:company_home/app:dictionary/cm:extensionwebscripts


[No implementation files]

Store: workspace://SpacesStore/app:company_home/app:dictionary/cm:webscripts


[No implementation files]

Store: classpath:alfresco/extension/templates/webscripts


[No implementation files]

Store: classpath:alfresco/templates/webscripts



File: org/alfresco/cmis/content.get.desc.xml 
<webscript>
  <shortname>Get Content (getContent)</shortname>
  <description>
  <![CDATA[
  Gets the content stream for the specified document, or gets a rendition stream for a specified rendition of a document.
  ]]>
  </description>
 
  <!– by object id –>
  <url>/cmis/i/{id}/content{property}?a={attach?}&amp;streamId={streamId?}</url>
  <url>/cmis/s/{store}/i/{id}/content{property}?a={attach?}&amp;streamId={streamId?}</url>
  <!– by path –>
  <url>/cmis/p{path}/content{property}?a={attach?}&amp;streamId={streamId?}</url>
  <url>/cmis/s/{store}/p{path}/content{property}?a={attach?}&amp;streamId={streamId?}</url>

  <!– alfresco style –>
  <url>/api/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}&amp;streamId={streamId?}</url>
  <url>/api/path/content{property}/{store_type}/{store_id}/{nodepath}?a={attach?}&amp;streamId={streamId?}</url>
  <url>/api/avmpath/content{property}/{store_id}/{avmpath}?a={attach?}&amp;streamId={streamId?}</url>
  <url>/api/node/{store_type}/{store_id}/{id}/content{property}?a={attach?}&amp;streamId={streamId?}</url>
  <url>/api/path/{store_type}/{store_id}/{nodepath}/content{property}?a={attach?}&amp;streamId={streamId?}</url>
 
  <args>
    <arg>
        <shortname>store</shortname>
        <description>the store name</description>
    </arg>
    <arg>
        <shortname>id</shortname>
        <description>the node id of the object</description>
    </arg>
    <arg>
        <shortname>path</shortname>
        <description>the path of the object (relative to CMIS root, typically "Company Home")</description>
    </arg>
    <arg>
        <shortname>nodepath</shortname>
        <description>the path of the object (relative to root of Alfresco store)</description>
    </arg>
    <arg>
        <shortname>property</shortname>
        <description>the name of the content property to retrieve content from</description>
        <default>cm:content</default>
    </arg>
    <arg>
        <shortname>attach</shortname>
        <description>if true, force download of content as attachment</description>
        <default>false</default>
    </arg>
    <arg>
        <shortname>streamId</shortname>
        <description>if provided, download the rendition of the content as identified by the stream id</description>
    </arg>
  </args>
 
  <format default="">argument</format>
 
  <authentication>guest</authentication>
  <transaction allow="readonly"/>
  <family>CMIS</family>
  <lifecycle>deprecated</lifecycle>
</webscript>

Store: classpath:alfresco/enterprise/webscripts


[No implementation files]

Store: classpath:webscripts


[No implementation files]
============================================================================================


One more thing what I observed is, when I am taking previous versions noderef and running that in nodebrowser I am finding cm:content property as null for alfresco model(i.e {http://www.alfresco.org/model/content/1.0}content = null), but for my custom model(i.e sk:content) am seeing content in node browser.when I revert the previous version to my current, its replacing my current version and am able to see the content there..!!!!!

Any solution for this….?


Thanks,
Saina