cancel
Showing results for 
Search instead for 
Did you mean: 

How to make only custom type selectable and hide 'Autho

alexr
Champ in-the-making
Champ in-the-making
Upfront: I am now using Alfresco 1.4 Community Preview edition.

This post is actually 2 questions in one:

Current situation:

Upto now I only made changes to files in the following folderpath:
C:\Alfresco\tomcat\shared\classes\alfresco\extension
And the files created/changed upto now are:

blablaModel.xml  (custom type + properties + constraints)
web-client-config-custom.xml (show custom properties in PropertySheet + Advanced Search)

Specific Questions:

1) How can I restrict the field "type"  to only contain our custom documenttype (e.g. Bla Bla Document) instead of both "content" and "Bla Bla Document") shown in the "General Properties" frame when Adding or Creating Content? What configuration file(s) to change and in which folderpath(s)?

2.) Since I created a custom property (defined at  Bla Bla Document) Author (let's call this 'blablaAuthor'), I want to hide the standard property 'Author' in "Details view of a document", "Modify Content Properties Screen" and in the "Advanced Search screen" (under more search options). Again  what configuration file(s) to change and in which folderpath(s)?

I hope this can be changed in a file in the "C:\Alfresco\tomcat\shared\classes\alfresco\extension"  folderpath, thus keeping the changes simple, clean and portable to newer versions of Alfresco.

Regards,

Alex    :wink:
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
You can indeed do this in the same way.

Basically in the property sheet config for your type you can configure the other "standard" properties to be hidden from view as shown below:

<property-sheet>
   <show-property name="description" show-in-view-mode="false" show-in-edit-mode="false" />
</property-sheet>

You can then repeat that for each property you want to hide.

alexr
Champ in-the-making
Champ in-the-making
Thanks Gavin  Smiley Very Happy

I managed to 'hide' the standard property author.

However when I try to 'move' other standard properties like created, date, modifier etc. to the bottom of the property sheet, it only works for 'content type' and 'size':

The following properties are defined at the bottom property sheet
in the web-client-config-custom.xml file:
——————————————————————————–
      <property-sheet>

         <show-property name="author" show-in-view-mode="false" show-in-edit-mode="false" />

<!–              show-property for custom properties are defined here (not between remark markers!)
–>
       <show-property name="created" show-in-edit-mode="false"/>
       <show-property name="modifier" show-in-edit-mode="false"/>
       <show-property name="modified" show-in-edit-mode="false"/>
       <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" />
      </property-sheet>

——————————————————

Expecting the following properties to be shown at the bottom of the property screen:

Creator
Created Date
Modifier
Modified Date
Edit Inline
Content Type
Size

But only Content Type and Size appear at the bottom and the rest stay at the top of the property screen.

What is wrong with the syntax for Creator, Created Date, Modifier, Modified Date and what would be the syntax for the 'Edit Inine'  property?

I still have a question remaining concerning the not showing 'content' but only 'Bla Bla document' (custom document) during the Creation of new content.

Regards,

Alex

gavinc
Champ in-the-making
Champ in-the-making
The properties you mention are included because the content node has certain aspects applied in this case, cm:auditable & app:inlineeditable.

Properties are included in the order they are found in the config files. For obvious reasons the custom config file is loaded last, what this means though is that any properties defined by out-of-the-box aspects will appear before yours.

There is a way round it though, you need to define a config file that gets loaded before our web-client-config-properties.xml file. To do this you need to override the Spring bean definition for the config service, details of how to do this can be found here: http://wiki.alfresco.com/wiki/Web_Client_Configuration_Guide

For your second point, the "Content" entry is always added to the list by default. If you wish to remove it you will have to customise the create content wizard and basically override the getObjectTypes() method from org.alfresco.web.bean.content.BaseContentWizard and not add the default "Content" option. A good place to start for doing this is: http://wiki.alfresco.com/wiki/Customising_The_Create_Content_Wizard

I've raised this on JIRA as an improvement: http://issues.alfresco.com/browse/AWC-936

alexr
Champ in-the-making
Champ in-the-making
Thanks Gavin.

Regards,

Alex