cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Content Type in Share.

beginer
Champ in-the-making
Champ in-the-making
c:\Alfresco\tomcat\shared\classes\alfresco\extension\trModel.xml

<?xml version="1.0" encoding="UTF-8"?>

<model name="tr:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Someco Model</description>
   <author>Jeff Potts</author>
   <version>1.0</version>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <namespaces>
      <namespace uri="http://www.someco.com/model/content/1.0" prefix="tr" />
   </namespaces>

   <constraints />
   
   <types>
      <type name="tr:department">
         <title>Department</title>
         <parent>cm:content</parent>
         <properties>
            <property name="tr:department_name">
               <title>Department name</title>
               <type>d:text</type>
               <protected>false</protected>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </type>
    </types>
</model>

c:\Alfresco\tomcat\shared\classes\alfresco\extension\web-client-config-custom.xml

<alfresco-config>

   <config evaluator="string-compare" condition="Content Wizards" replace="true">
      <content-types>
         <type name="tr:department" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="tr:department">
      <property-sheet>            
         <show-property name="tr:department_name" />
      </property-sheet>
   </config>
</alfresco-config>

c:\Alfresco\tomcat\shared\classes\alfresco\web-extension\share-config-custom.xml

<alfresco-config>
  
   <config evaluator="string-compare" condition="RepositoryLibrary" replace="true">
      <visible>true</visible>
   </config>


   <!– Department –>
   <config evaluator="model-type" condition="tr:department">
      <forms>
         <form>
            <field-visibility>
               <show id="tr:department_name" />
            </field-visibility>
         </form>
      </forms>
   </config>
   <config evaluator="node-type" condition="tr:department">
      <forms>
         <form>
            <field-visibility>
               <show id="tr:department_name" />
            </field-visibility>
         </form>
      </forms>
   </config>
   <config evaluator="string-compare" condition="DocumentLibrary">
      <types>
         <type name="cm:content">
            <subtype name="tr:department" />
         </type>
      </types>
      <create-content>
         <content id="html" mimetype="text/html" label="department" itemid="tr:department"/>
      </create-content>
   </config>
</alfresco-config>
Establish a department. Create new page with link:
http://127.0.0.1:8080/share/page/create-content?destination={node.nodeRef}&itemId=tr:department&mime...
Error when saving:
Failed to create content: org.alfresco.error.AlfrescoRuntimeException: 10060081 Invalid node ref - does not contain forward slash: {node.nodeRef}
What could be the problem?
6 REPLIES 6

mitpatoliya
Star Collaborator
Star Collaborator
Two potential problem I see
In your model
<types> tag is not closed which should give you the error while starting the tomcat.

Also there could be problem with the title and name like Отдел you are using.
It could create problem if your db is not supporting those characters.

beginer
Champ in-the-making
Champ in-the-making
it's just not completely copied xml. Tag  okay and internationalization.
I think the error in destination={node.nodeRef}. but should be destination=workspace://SpacesStore/5ed86ffb-5473-4e26-af36-18646f11924c& may be.
The problem is not solved

beginer
Champ in-the-making
Champ in-the-making
Solved:
change

<create-content>
         <content id="html" mimetype="text/html" label="department" itemid="tr:department"/>
</create-content>
on

<content id="myContent" label="Department" type="pagelink" index="90" >
            <param name="page">create-content?destination={nodeRef}&amp;itemId=tr:department&amp;mimeType=text/html</param>
</content>

pl_componize
Champ in-the-making
Champ in-the-making
Thanks it helped me.

I believe this is a bug in Share customization mechanism, whenever you add you own <create-content> customization, the destination is not set correctly but overriden with {node.nodeRef}

I believe this is a bug as well, I updated the bug report here: https://issues.alfresco.com/jira/browse/ALF-18182

It is marked as trivial and still has not been fixed, I would say it is a bit more than trivial since I have yet to find an example of creating an entry in the content menu by a "newer" method.

I can confirm that this issue is in Alfresco Community 4.2c. The cause is a bug in toolbar.lib.js, which is under HEAD\root\projects\slingshot\config\alfresco\site-webscripts\org\alfresco\components\documentlibrary\include\toolbar.lib.js. On line 133, the line looks like: url = "create-content?destination={node.nodeRef}"; it should be changed to url = "create-content?destination={nodeRef}";
This resolves the issue.

If someone out there wants to patch their current install, you can edit toolbar.lib.js on your server under "ALFRESCO_ROOT/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/documentlibrary/include/toolbar.lib.js". Just go in and edit line 133 as described above. However please be aware that this will NOT persist if you upgrade or redeploy your installation…

horia
Champ in-the-making
Champ in-the-making
thanks beginer, that was of great help!