cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing (managing) Aspect on line

fabernate
Champ in-the-making
Champ in-the-making
Hi

is there a way to view Aspect I created via Java (OpenCmis) on line with Alfresco Explorer ?
and search they which  have some value ?

I created a model that Alfresco load on startup vith some properties and I just want view on line them !

Thanks
21 REPLIES 21

jpotts
World-Class Innovator
World-Class Innovator
Please read this tutorial:
http://ecmarchitect.com/archives/2012/01/09/1509

Which covers how to define custom types and aspects, how to configure those custom types and aspects to show up in both Alfresco Explorer and Alfresco Share, and how to work with instances of those types and aspects with CMIS.

If you work through that tutorial successfully and still have questions, please come back and provide the code you are attempting to use and any error messages you are seeing.

Jeff

fabernate
Champ in-the-making
Champ in-the-making
HI

I think it's too generic and  shuffled that tutorial though it's easy and clear about author mean.
But I don't know which tags take….

I just want my aspect properties are shown when I click on the detail icon…if it is possible

please can you tell the paragraph, or page to get only and only those tags i need ?

Regards
Fabio

jpotts
World-Class Innovator
World-Class Innovator
"Part 2: Configuring Alfresco Share" starts on page 18.

"Configuring Forms for Custom Properties" starts on page 22.

"Configuring the form service for custom properties" starts on page 23.

Listing 7 shows how to do it.

Jeff

fabernate
Champ in-the-making
Champ in-the-making
Hi Jeff
I can't let it gone:

this is my share config custom xml

<alfresco-config>
   <config evaluator="string-compare" condition="DocumentLibrary">
      <aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="lynx:docType"/>
            <aspect name="lynx:refId" />
         </visible>
         
         <addable>
         </addable>
         
         <removeable>
         </removeable>
      </aspects>
   </config>      
   <config evaluator="aspect" condition="lynx:documentable">
      <forms>
         <form>
            <field-visibility>
               <show id="lynx:docType" />
               <show id="lynx:refId" />
            </field-visibility>
         <appearance>
            <field id="lynx:docType" label-id="prop.lynx_docType" />
            <field id="lynx:refId" label-id="prop.lynx_refId" />
         </appearance>
         </form>
      </forms>
   </config>
   
   <config evaluator="model-type" condition="lynx:documentable">
      <forms>
         <form id="search">
            <field-visibility>
               <show id="lynx:docType" />
               <show id="lynx:refId" force="true" />
            </field-visibility>
            <appearance>
               <field id="lynxType">
                  <control template="/org/alfresco/components/form/controls/lynxType.ftl"/>
               </field>
            </appearance>
         </form>
      </forms>
   </config>
</alfresco-config>




this is the slinghot app


<?xml version='1.0' encoding='UTF-8'?>
<beans>
   
   <bean id="someco.resources"
   class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
            <value>alfresco.web-extension.messages.lynxModel</value>
         </list>
      </property>
   </bean>
</beans>


and this is the prop file

aspect.lynx_documentable=Document Properties
prop.lynx_docType=Document Type
prop.lynx_refId=ID Number

where am I wrong?

Regards

jpotts
World-Class Innovator
World-Class Innovator
Try adding a third config element for "node-type" that is a copy of your "model-type" config element, like this:

<config evaluator="node-type" condition="lynx:documentable">
<forms>
<form>
<field-visibility>
<show id="lynx:docType" />
<show id="lynx:refId" force="true" />
</field-visibility>
<appearance>
<field id="lynxType">
<control template="/org/alfresco/components/form/controls/lynxType.ftl"/>
</field>
</appearance>
</form>
</forms>
</config>
Also note that I am removing the id attribute from the form tag for this config element.

The "model-type" config is used for creating new nodes while the "node-type" config is used for existing nodes.

Jeff

fabernate
Champ in-the-making
Champ in-the-making
Hi Jeff

going too fastly I supposed and then forgot that the ftl string is not a key, but really a template file…I can't do it, it is not mentioned…
Infact that's why I left it behind…..

that ftl extension appear when I want to apply a model on the top of the detail…it can be OK, but I'd rather prefer the properties to appear just
in the detail box if possible……

I choosed another model by chance and on the list of its properties, the mine also appear..but that model is ugly….I don't like it even because there too many prop….

so is that ftl template important or not….on the detail tab can them appear ?

Regards

jpotts
World-Class Innovator
World-Class Innovator
Yes, you can take out that control template and Share will use the default control template based on the data type of that property.

Yes, when you use this form configuration, your custom properties will show up in the "Properties" collapsible section on the document details page in Share.

Jeff

fabernate
Champ in-the-making
Champ in-the-making
Hi Jeff

I get this on Alfresco start up log

Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 2 in XML document from file [C:\Alfresco\tomcat\shared\classes\alfresco\web-extension\custom-slingshot-application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
   at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
   at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
   at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:186)
   … 50 more
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)

the xml file is above listed

jpotts
World-Class Innovator
World-Class Innovator
Can you make sure that your custom-slingshot-application-context.xml file has the DOCTYPE specified, like this:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
Jeff