cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide metadata from a custom type.

cristinamr
World-Class Innovator
World-Class Innovator
Hi.

I've this custom model in Share:

<type name ="am:expjuridico">
            <title>Expedientes</title>
            <parent>cm:folder</parent>
            
            <properties>
            
            </properties>
         
         </type>

Anohter side, I've this aspect:
<aspects>
      <aspect name="am:datosGenericosExp">
         <title>Datos Genéricos</title>
         <properties>
         
            <property name="am:asunto">
               <title>Asunto</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
….

In the share-config-custom.xml, I've this code:
 <config evaluator="node-type" condition="am:expjuridico">
      <forms>
         <!– Default form configuration used on the document details and edit metadata pages –>
         <form>
            <field-visibility>
         
            <!– Datos modelo ARDOC - Expedientes Jurídicos –>
            <show id="am:asunto" />
….

<config evaluator="node-type" condition="cm:folder">
      <forms>
         <form id="rm">
            <field-visibility>
            <hide id="cm:name"/>
            <hide id="cm:title"/>
            <hide id="cm:description" />
…..

I want to hide the cm:folder's metadatas (cm:name, cm:description … ). I've tried this:

- I create a folder.
- I change the folder's type to "expjuridico".
- I apply the aspect "datosGenericosExp".

But the field cm:name, for example, it shows and I can't hide it. What Can I do for hide the fields from cm:folder ?

Any ideas? Smiley Sad

Thanks.
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc
9 REPLIES 9

loftux
Star Contributor
Star Contributor
Have you tried just to remove <show id="cm:title"/>?
Note that you would have to keep the cm:name one upon creation, else you cannot create new folders. That would be under section <config evaluator="model-type" condition="cm:folder">

cristinamr
World-Class Innovator
World-Class Innovator
Have you tried just to remove <show id="cm:title"/>?

Now I tried this solution and nothing: The field is shows  still Smiley Sad

Another idea?
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc

gavinc
Champ in-the-making
Champ in-the-making
Hi,

It's not entirely clear what you want to do so I'll have a guess…

If you want to hide the name, title and description fields for the out-of-the-box cm:folder type you can use the following config (note the use of the default form, not a form with an id of "rm")…


<config evaluator="node-type" condition="cm:folder">
   <forms>
      <form>
         <field-visibility>
            <hide id="cm:name"/>
            <hide id="cm:title"/>
            <hide id="cm:description" />
            …
</config>

When configuring your own type you just provide the fields you want to show (there is no inheritance from the config of the parent).


<config evaluator="node-type" condition="am:expjuridico">
   <forms>
      <form>
         <field-visibility>
            <show id="am:asunto"/>
            …
</config>

If you have this config in place and you still don't see your custom fields I'd guess that the type of the folder has not been changed for some reason!

Hope that helps!

cristinamr
World-Class Innovator
World-Class Innovator
Hi gavinc.

Thank you very much for your help, but I 've got to hide the cm:folder's fields still.

Ok, now my files are as these:

share-config-custom.xml

 <config evaluator="node-type" condition="am:expediente">
      <forms>
         <!– Default form configuration used on the document details and edit metadata pages –>
         <form>
            <field-visibility>
            <show id="am:asunto" />
            <show id="am:descripcion" />
            …..
            </field-visibility>
            <appearance>
            <field id="am:asunto" label-id="label.am_asunto" />
            <field id="am:descripcion" label-id="label.am_descripcion" />
           …..
         </appearance>
         </form>

         <!– Document Library pop-up Edit Metadata form –>
         <form id="doclib-simple-metadata">
            <field-visibility>
            <show id="am:asunto" />
            <show id="am:descripcion" />
           …   
            </field-visibility>
         
         <edit-form template="../documentlibrary/forms/doclib-simple-metadata.ftl" />
           
         <appearance>
            <field id="am:asunto" label-id="label.am_asunto" />
            <field id="am:descripcion" label-id="label.am_descripcion" />
            …
            </appearance>
         </form>

         <!– Document Library Inline Edit form –>
         <form id="doclib-inline-edit">
            <field-visibility>
            <show id="am:asunto" />
            <show id="am:descripcion" />
           …
            </field-visibility>
            <appearance>
            <field id="am:asunto" label-id="label.am_asunto" />
            <field id="am:descripcion" label-id="label.am_descripcion" />
            …
            </appearance>
         </form>
      </forms>
   </config>

 <config evaluator="node-type" condition="cm:folder">
      <forms>
         <form>
            <field-visibility>
               <show id="cm:mimetype" for-mode="view" />
            </field-visibility>
            <appearance>
            <field id="cm:mimetype" label-id="label.cm_mimetype" />
            </appearance>
          </form>
      </forms>
   </config>

I guess that this configuration only show me my custom's fields and cm:folder's mymetype (on mode "view").

But, share shows me that: View form.

And when i try to edit it, share shows me that: Edit form.

It's curious but share hides "mimetype", however It must show as mode view.

I've tried to delete temp/ and work/ but nothing Smiley Frustrated

Does somebody knows how to show ONLY the fields from my costum aspect?  Smiley Surprisedops:
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc

cristinamr
World-Class Innovator
World-Class Innovator
Uhm… Another question (this is easy, I promise it Smiley Very Happy 😞

When I apply my custom aspect, I see this tag: aspect.am_expediente. In my custom-slingshot-application-context.xml, I added this line: <ref bean="alfresco.web-extension.messages.MyModel" /> . I created inside of web-client/, another folder with name messages. Inside of this folder, I created a new file with name MyModel.properties with this lines:

label.am_asunto=Asunto
label.am_descripcion=Descripción


I tried to put label.am_expjuridico=Expedientes Jurídicos, and share show me this label wrong. I tried to put as aspect.am_expjuridico=Expedientes Jurídicos and nothing, too.

How I must to do it for Share shows me the translations?

I got the solution!! ^__^

Can somebody help me with another question?

Thanks!
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc

gavinc
Champ in-the-making
Champ in-the-making
Hi,

Looking at your screenshots I can conclude that your custom configuration is not being picked up, that is why you end up with a form containing all possible fields.

Where are you placing your share-config-custom.xml file? It must be in the <tomcat>/shared/classes/alfresco/web-extension folder.

As for adding custom messages files I'd suggest taking a look at the FDK, this has an example of adding custom messages files into Share, you can find details on the wiki here: http://wiki.alfresco.com/wiki/Forms_Development_Kit

cristinamr
World-Class Innovator
World-Class Innovator
Yep, my share-config-custom.xml is in tomcat\shared\classes\alfresco\web-extension. I think that my share not picked up my custom-configuration well, but I
don't know what is the problem or how can i solved it.

Yesterday I saw the FDK, and I think that it's the solution easier. But if i understand well, Must I install it on my share and on my Eclipse? I downloaded the jar and the amp but I don't understand well this lines:

Building the FDK

If you are building Alfresco from source using a development environment you may wish to also build and deploy the FDK.

The main Ant build.xml file provides several targets to allow for this.

incremental-fdk
    Builds the repository and client FDK files

install-fdk-amp
    Builds the FDK AMP and installs it in the repository WAR file, the "deploy-webclient-tomcat" needs to be called subsequently to deploy the WAR file to Tomcat

deploy-repo-fdk-exploded
    Deploys the FDK repository files to Tomcat in exploded mode

deploy-share-fdk
    Builds the FDK client JAR and deploys it to Share

deploy-share-fdk-exploded
    Deploys the FDK client files to Share in exploded mode

Where is these files?
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc

gavinc
Champ in-the-making
Champ in-the-making
Have you configured your Tomcat to include shared/classes in it's classpath. If you are using an installed Alfresco this should already be done for you but if you are using a Tomcat you installed yourself it may be that you haven't configured it yet, see http://wiki.alfresco.com/wiki/Install_Tomcat6 for details, particularly steps 3 and 4.

As for the FDK again it depends on how you have put Alfresco on your system, if you are building from source all you need to do is run "ant deploy-fdk", that will build everything for you, if you want the pre-built files you can get them from here: http://wiki.alfresco.com/wiki/Community_file_list_3.4.b

cristinamr
World-Class Innovator
World-Class Innovator
Okay, Now I understand it better. Thank you very muchhh!!! ^__^
--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc