cancel
Showing results for 
Search instead for 
Did you mean: 

How to display 'content type'?

llin
Champ in-the-making
Champ in-the-making
Hello,

I have created my custom content model and exposed most of properties in UI. But I lost "Content Type" and "Encoding" as displayed as Alfresco cm:content.

How can I modify in order to edit "Content Type" and "Encoding" for my custom content model inside Alfresco Web Client?

Thank you.

Ally
2 REPLIES 2

srojas
Champ in-the-making
Champ in-the-making
you must create a file named "web-client-config-custom.xml" into the extension directory. Later you registry the types of your new model in that file. Example: i´ve the next type in my model:

<type name="as:asuntos">
    <title>type1</title>
    <parent>cm:content</parent>
    <properties>
   <property name="as:codigo_as">
        <type>d:text</type>
        <mandatory>true</mandatory>
   </property>
    </properties>
</type>

well, in the "web-client-config-custom.xml" i introduce the following code:

<config evaluator="node-type" condition="as:asuntos">
     <property-sheet>
          <show-property name="as:codigo_as" display-label=" Código    Asunto "/>
     </property-sheet>
</config>

<config evaluator="string-compare" condition="Content Wizards">
     <content-types>
   <type name="as:asuntos" />
     </content-types>
</config>

llin
Champ in-the-making
Champ in-the-making
Thank you, Srojas. But I think I didn't state my question clearly.

I created my content model with a bunch of properties. I have also created "web-client-config-custom.xml". Somewhere inside the XML, I have lines like to expose properties:

<config evaluator="node-type" condition="tal:lilacdoc">
      <property-sheet>
       <show-property name="mimetype" display-label-id="submission.mimetype" show-in-view-mode="true" show-in-edit-mode="false" />
         <show-property name="tal:url" display-label-id="submission.url" />
….

The "Content Type" I meant is the mimetype property on "Details" page. For the out-of-box type "Content", it will display the document's mimetype, for example "Content Type: Plain Text". When you edit properties, it even comes with a drop-down list to make change to document mimetype.

But for my custom content model, I lost the capability as "Content". Using the line <show-property name="mimetype" ….>, I only get it displaying on "Details" page, but can't have it editable. I also tried converter="org.alfresco.faces.MimeTypeConverter". But it lost the drop-down list in edit mode and even worst, lost the mimetype if you click "Close".

Anyone has experience with the issue?

Thanks.

Ally