cancel
Showing results for 
Search instead for 
Did you mean: 

Can I define this in share-config-custom.xml

bisana
Champ on-the-rise
Champ on-the-rise
Hi All
  I am doing my R&D with custom type and Custom Aspects.
This is what I have to, I have One Custom Type and 2-3 Custom Aspects.
I have folders, in which I have applied rule, such as If I check document to 'FolderOne-withAspectOne' it will apply The defined Custom Type and Custom Aspect One, simillary when I check a document to 'FolderTwo-withAspectTwo' it should apply the The 'defined Custom Type' and 'Custom Aspect Two'. Same  for FolderTwo-withAspectThree' it should apply the The 'Defined Custom Type' and 'Custom Aspect Three'

Now I want to display the Custom Metada for the files which has Custom Aspects defined

If I do the follwoing code in 'share-config-custom.xml' will it work for me, guidance requested

<!– Is this a possiblilty, in which I can put my custom aspect and custom aspect properties
In  share-config-custom.xml , my intention is that I should have a system where there is One Custom Type, then 2 Custom Aspect with custom proerty
I want to display the aspect propery

–> 
<config evaluator="node-type" condition="sc:myaspect">
      <forms>
     <form>
         <field-visibility>    
           <show id="sc:myaspectpropertyOne"/>
      <show id="sc:myaspectpropertyTwo"/>      
         </field-visibility>
     </form>
    </forms>
   </config>
  

  <config evaluator="model-type" condition="sc:myaspect">
      <forms>
      <form id="search">
         <field-visibility>
       <show id="sc:myaspectpropertyOne"/>
           <show id="sc:myaspectpropertyTwo"/>
        </field-visibility>   
     </form>
      </forms>
   </config>


3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator
Hello,

this won't work, since you can't use "node-type" evaluator and an aspect condition together. If you use "aspect" instead of "node-type" it'll work, but keep in mind that the form configuration will apply to every node that has the aspect, even if you might not want it to for a specific type of content.

The second form with "model-type" is never going to work, as - unfortunately - advanced search does not support aspect oriented search forms at the moment. The only option you have is in configuring a "model-type" form for, say, "cmSmiley Surprisedbject" and include only your aspect properties as filter criteria. Unfortunately, if the user does not enter anything in an aspect property field, you may still end up finding content without the aspect.

Regards
Axel

bisana
Champ on-the-rise
Champ on-the-rise
Hi  Axel
Thanks for the reply
When I go through 4.1 documentation, I see in "Displaying aspect metadata" http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Ftasks%2Flibrary-item-m...
They say that it can done
And from the docs it says that
The following example configuration shows the cm:from and cm:to properties for the cm:effectivity aspect.

<config evaluator="node-type" condition="cm:content">
   <forms>
      <form>
         <field-visibility>
            <show id="cm:name" />
            <show id="cm:title" force="true" />
            <show id="cm:description" force="true" />
            <show id="mimetype" />
            <show id="cm:author" force="true" />
            <show id="size" for-mode="view" />
            <show id="cm:creator" for-mode="view" />
            <show id="cm:created" for-mode="view" />
            <show id="cm:modifier" for-mode="view" />
            <show id="cm:modified" for-mode="view" />

            <!– cm:effectivity aspect –>
            <show id="cm:from"/>
            <show id="cm:to"/>
         </field-visibility>
      </form>
   </forms>
</config>

The following example shows how to add the fields of an example aspect to all forms for the cm:content type.


<config evaluator="node-type" condition="cm:content">
   <forms>
      <form>
         <field-visibility>
            <!– fields from my example aspect –>
            <show id="my:aspectProperty" />
            <show id="my:aspectAssociation" />
         </field-visibility>
      </form>
   </forms>
</config>

afaust
Legendary Innovator
Legendary Innovator
Hello,

it works when the condition to your node-type is an actual type as in the documentation. Of course that means you have to adapt each "node-type" form if you have more than just "cm:content", or you go instead with evaluator type of "aspect", but then have no way to suppress these fields in a specific "node-type" form.

Regards
Axel