AnsweredAssumed Answered

Aspect and Advanced Search

Question asked by сougar on Jun 18, 2012
Latest reply on Jun 20, 2012 by guilherme_souza
Hello!
I've finally decided to figure out how to work with aspects and types in Alfresco.
The task is simple - to add one property (the index number) to the document.
While writing I ran into two troubles. (Everything below was set up in Share)
It would've been more convinient to use aspect instead of type.
1) Problem for-mode="view"  for aspect, which means I want to hide the name of the document from user. As far as I understood, it is impossible to do for-mode="view". So how is it possible then?
2) Problem of setting up the Advanced search. I can set it  up for type but I failed to do it for the aspect. Can somebody offer a solution please?

<config evaluator="string-compare" condition="AdvancedSearch">
   <advanced-search>
       <forms>           
          <form label="number" description="Search number"> mk:number</form>
       </forms>

   </advanced-search>
</config>


   <config evaluator="model-type" condition="mk:number">
<forms>
<form id="search">
   <field-visibility>
   <show id="mk:numberID"/>
   </field-visibility>
   </form>
   </forms>
   </config>
</alfresco-config>
where …-model.xml

   <aspects>
      <aspect name="mk:number">
       <title>Number of doc</title>
         <properties>
            <property name="mk:numberId">
               <title>Number of doc</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
                   <index enabled="true">
                     <atomic>true</atomic>
                  </index>
               <constraints>
                  <constraint ref="mk:val"/>
               </constraints>
            </property>
         </properties>
      </aspect>
  </aspects>

Outcomes