cancel
Showing results for 
Search instead for 
Did you mean: 

Change Type Dialog

gukguk
Champ in-the-making
Champ in-the-making
Hi !
I'm a newbie in Alfresco.
I want to add new type in change type dialogue.
According to the documentation that i read , i have to modify share-config-custom.xml (located at  \tomcat\shared\classes\alfresco\web-extension
) so the new type will show up in change type dialog.
But it doesn't show up at all.
I also try to put logger.log() statement to debug change-type.get.js because i want to see if the config can be read by the js but there is no log statement being print
Can anybody help me ?

<?xml version="1.0" encoding="utf-8"?>
<alfresco-config>

   <!– Repository Library config section –>
   <config evaluator="string-compare" condition="RepositoryLibrary" replace="true">
      <!–
         Whether the link to the Repository Library appears in the header component or not.
      –>
      <visible>true</visible>
   </config>
   <config evaluator="string-compare" condition="DocumentLibrary" replace="true">
      <types>
         <type name="cm:content">
            <subtype name="tzc:document"/>
         </type>
         <type name="tzc:document">
            <subtype name="tzc:customerDocument"/>
            <subtype name="tzc:salesOrderDocument" />
            
         </type>
         <type name="tzc:salesOrderDocument">
            <subtype name="tzc:receipt" />
            <subtype name="tzc:salesOrderItemDocument" />
         </type>
   </types>
   </config>
</alfresco-config>
7 REPLIES 7

loftux
Star Contributor
Star Contributor
You have updated the config for RepositoryLibrary, that may be what you want to do, but I think you want
<config evaluator="string-compare" condition="DocumentLibrary" replace="true">
(that is for it to show in sites)

Also, when you have replace="true" you need to copy the whole config section for DocumentLibrary from tomcat/webapps/share/WEB-INF/classes/alfresco/share-config.xml

Also, you can allow to directly change from cm:content to for example tzc:customerDocument, assuming that is what you want to allow. Else you users would have to change multiple times.

gukguk
Champ in-the-making
Champ in-the-making
Hi !
I'm not really so sure with what you meant on the previous.
I modify share-config-custom.xml (located at \tomcat\shared\classes\alfresco\web-extension )
Is it something like this below ?
<?xml version="1.0" encoding="utf-8"?>
<alfresco-config>
<config evaluator="string-compare" condition="DocumentLibrary" >
<types>
<type name="cm:content">
<subtype name="tzc:customerDocument"/>
<subtype name="tzc:receipt" />
<subtype name="tzc:salesOrderItemDocument" />
</type>
</types>
</config>
</alfresco-config>

Even i changed the share config file and restart the server , the change type still doesn't show up .
By the way, i cannot find this tomcat/webapps/share/WEB-INF/classes/alfresco/share-config.xml
Can you be more specific ?
Thanks again for your help

loftux
Star Contributor
Star Contributor
In the directory where you have installed alfresco, like /opt/alfresco or C:\alfresco you will have tomcat/webapps/share/WEB-INF/classes/alfresco/share-config.xml.
In that file you will find the default config for share, and that is what you want to override.

I usually take the whole config section i need, and have replace="true"

Have you installed any other extension? If there are many share-config-custom.xml, only the first one encountered will be read.
Try this one (for 3.4)

<alfresco-config>
   <!– Document Library config section –>
   <config evaluator="string-compare" condition="DocumentLibrary" replace="true">

      <tree>
         <!–
            Whether the folder Tree component should enumerate child folders or not.
            This is a relatively expensive operation, so should be set to "false" for Repositories with broad folder structures.
         –>
         <evaluate-child-folders>true</evaluate-child-folders>
        
         <!–
            Optionally limit the number of folders shown in treeview throughout Share.
         –>
         <maximum-folder-count>-1</maximum-folder-count>
      </tree>

      <!–
         Used by the "Manage Aspects" action and Rules pages

         For custom aspects, remember to also add the relevant i18n string(s)
            aspect.cm_myaspect=My Aspect
      –>
      <aspects>

         <!–
            Aspects that a user can see in UI.
            Used by Rules, aspects are the listed aspects for rule's "has-aspect" action condition.
         –>
         <visible>
            <aspect name="cm:generalclassifiable" />
            <aspect name="cm:complianceable" />
            <aspect name="cm:dublincore" />
            <aspect name="cm:effectivity" />
            <aspect name="cm:summarizable" />
            <aspect name="cm:versionable" />
            <aspect name="cm:templatable" />
            <aspect name="cm:emailed" />
            <aspect name="emailserver:aliasable" />
            <aspect name="cm:taggable" />
            <aspect name="app:inlineeditable" />
            <aspect name="gd:googleEditable" />
            <aspect name="cm:geographic" />
            <aspect name="exif:exif" />
         </visible>

         <!–
            Aspects that a user can add in UI.
            Used by Rules, aspects are the listed aspects for rule's "add-features" action.
            Same as "visible" if left empty.
         –>
         <addable>
         </addable>

         <!–
            Aspects that a user can remove in UI.
            Used by Rules, aspects are the listed aspects for rule's "remove-features" action.
            Same as "visible" if left empty
         –>
         <removeable>
         </removeable>
      </aspects>

      <!–
         Used by the "Change Type" action.
         Used by Rules:
          - parent types are the listed types for rule's "is-subtype" action condition
          - sub types are the listed types for rule's "specialise-type" action

         Define valid subtypes using the following example:
            <type name="cm:content">
               <subtype name="cm:mysubtype" />
            </type>

         Remember to also add the relevant i18n string(s):
            type.cm_mysubtype=My SubType
      –>
      <types>
         <type name="cm:content">
<subtype name="tzc:customerDocument"/>
<subtype name="tzc:receipt" />
<subtype name="tzc:salesOrderItemDocument" />
</type>

         <type name="cm:folder">
         </type>
      </types>

      <!–
         If set, will present a WebDAV link for the current item on the Document and Folder details pages.
         Also used to generate the "View in Alfresco Explorer" action for folders.
      –>
      <!–
      <repository-url>http://localhost:8080/alfresco</repository-url>
      –>
     
      <!–
         Google Docs™ integration
      –>
      <google-docs>
         <!–
            Enable/disable the Google Docs UI integration (Extra types on Create Content menu, Google Docs actions).
         –>
         <enabled>false</enabled>
        
         <!–
            The mimetypes of documents Google Docs allows you to create via the Share interface.
            The I18N label is created from the "type" attribute, e.g. google-docs.doc=Google Docs&trade; Document
         –>
         <creatable-types>
            <creatable type="doc">application/msword</creatable>
            <creatable type="xls">application/vnd.ms-excel</creatable>
            <creatable type="ppt">application/vnd.ms-powerpoint</creatable>
         </creatable-types>
      </google-docs>
     
      <!–
         File upload configuration
      –>
      <file-upload>
         <!–
            Adobe Flash™
            In certain environments, an HTTP request originating from Flash cannot be authenticated using an existing session.
            See: http://bugs.adobe.com/jira/browse/FP-4830
            For these cases, it is useful to disable the Flash-based uploader for Share Document Libraries.
         –>
         <adobe-flash-enabled>true</adobe-flash-enabled>
      </file-upload>
   </config>
</alfresco-config>

gukguk
Champ in-the-making
Champ in-the-making
Hi Loftux !
Thanks for your reply.
I can find share-config.xml and i did modify share-config.xml like you told me to, I add new type there but the Change Type dialog doesn't load the new type.
There is a share-config-custom.xml  and i did change that also by adding the new type but still no result.
Is there a way for me to debug if the change type dialog load the type from a particular file ?
Thanks

loftux
Star Contributor
Star Contributor
I didn't mean for you to change the share-config.xml, just use it to find out what the default config settings are.
From my previous post, copy the complete config and make a new tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml. Of course if you have other settings that you need in your share-config-custom.xml, you would have to merge them.

gukguk
Champ in-the-making
Champ in-the-making
HI  Loftux !
Thanks again for your reply.
I did what you've told me but there is no change at all in the Change Type dialog after I restart the server.
Thanks a lot for your help.
I'm not so sure what went wrong .
I have to find a way to debug the change-type.get.js probably it will tell me where it read the type

gukguk
Champ in-the-making
Champ in-the-making
Hi Loftux!
Thanks for your help i got it work by changing only the share-config.xml
Thanks again for your hlep