AnsweredAssumed Answered

Crear Nuevo Tipo de Contenido

Question asked by ajss on Mar 27, 2008
Latest reply on Apr 12, 2013 by andgarcia
Pues bien, cuando se añade un documento al repositorio, alfresco nos da la posibilidad de elegir en el asistente de añadir documento. que tipo de documento es (y no me refiero a si es doc, jpeg, pdf, etc.), y en base a esta eleccion, que en la posterior ventana, nos salgan unos metadatos u otros a rellenar. Esto es lo que quiero hacer:

You may consider calling your custom content type Press Release with the properties as shown in the table below:

   Property Type …………… Property Name…………….Property Label

   text………………………PRName ………………………PR Person Name
   text ………………………PREmail ……………………… PR Person Email
   text………………………PRPhone………………………PR Person Phone
   lnt    ……………………… PRDate  ………………………  Released Date


Y estos son los codigos y archivos modificados:

A)Open the customModel . xml file and add the following XML code before the aspects block:

<types> 
<!– Definition of new Content Type: Press Release –>
<type name="custom:pressrelease">
    <title>Press Release</title>
    <parent>cm:content</parent>
    <properties>
      <property name="custom:PRName">
        <title>PR Person Name</title>
        <type>d:text</type>
      </property>

     <property name="custom:PREmail">
       <title>PR Person Email</title>
       <type>d:text</type>
     </property>

     <property name="custom:PRPhone">
       <title>PR Person Phone</title>
       <type>d:text</type>
     </property>

     <property name="custom:PRDate">
        <title>PR Released Date</title>
        <type>d:date</type>
      </property>
</properties>

<mandatory-aspects>
   <aspect>cm:versionable</aspect>
</mandatory-aspects>

</type>
</types>

Open the web-client-config-custom. xml file and add the following lines of code that are highlighted (es lo que está entre SUBTYPES)


<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
  <aspects>
   <aspect name="custom:CustomerDetailS"/>
  </aspects>
<subtypes>
  <type name="custom:pressrelease"/>
</subtypes>
</config>

This code ensures that the Press Release content is shown in the Business Rules Action wizard. (pero a mi no me aparece luego :S)


Add the following XML code just before the block shown above. This code ensures that the press release content type is listed when you create new content. (Y tampoco me aparece luego :S)


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


Add the following XML code just before the block shown above. This code ensures that the properties are available to edit in the edit properties window for press release content.


<config evaluator="node-type" condition="custom:pressrelease">
  <property-sheet>
    <show-property name="mimetype"
      display-label-id="content_type"
      component-generator="MimeTypeSelectorGenerator" />
    <show-property name="size"
      display-label-id="size"
      converter="org.alfresco.faces.ByteSizeConverter"
      show-in-edit-mode="false" />
    <show-property name="custom:PRName" />
    <show-property name="custom:PREmail" />
    <show-property name="custom:PRPhone" />
    <show-property name="custom:PRDate" />
  </property-sheet>
</config>

Y el resultado deberia ser algo asi…. pero no me sale:

[img]http://img87.imageshack.us/img87/5807/48508261lz8.jpg[/img]

[img]http://img179.imageshack.us/img179/9146/21600736ro6.jpg[/img]

No se si hay algun fallo en los códigos… es copiado tal cual del manual :S

Outcomes