cancel
Showing results for 
Search instead for 
Did you mean: 

Category as Aspect type

natnat
Champ in-the-making
Champ in-the-making
Hello! I am new to Alfresco, and need some help from you!

The situation is the following. I've defined a new Category "Document type" using the Admin UI, which can contain the following values: "Complaint", "Petition", "Letter" etc. So, I would like to use this Category values as characteristics of each content (document) in the repository. With this aim I would like to create a new Aspect in Custom Content model, which could have a property with a type of this category. I have found in Alfresco documentation, that Aspect property can have a type d:category, but can't find anywhere an example, how I can use it in my situation. Can it be done only using the Custom model configuration, or should I write some Javascript or Java code? Static list constraint is not a solution for us because it is a requirement of our customer to be able to maintain the "Document type" category using Admin UI.

Please, help me or point to existing topic/example of my case!
8 REPLIES 8

jpotts
World-Class Innovator
World-Class Innovator
There is a classifiable aspect available out-of-the-box. It is called cm:generalclassifiable or in the Share UI you'll see it under Manage Aspects as just "classifiable".

So add that aspect then edit the properties to add your new categories to the document.

Jeff

natnat
Champ in-the-making
Champ in-the-making
Thank you for your help!!

natnat
Champ in-the-making
Champ in-the-making
Hi, I have a question again.

Is it possible to restrict a classifiable aspect to allow to select only one value from categories list?

I've created two classifiable aspects, one via Admin UI, another in custom content model with the following code:

    <aspect name="custom:clAspect">
      <title>Category</title>
      <parent>cm:classifiable</parent>
      <properties>
        <property name="custom:categories">
          <title>Category</title>
          <type>d:category</type>
          <mandatory>true</mandatory>
          <multiple>false</multiple>
        </property>
      </properties>
    </aspect>

But both of them allow to select several category values at a time.

jpotts
World-Class Innovator
World-Class Innovator
I do not know off the top of my head. I'd start by checking to see if the category picker component has a parameter that allows you to restrict how many can be selected. If it doesn't you'll have to create a custom version of the category picker that works the way you want it to.

Jeff

natnat
Champ in-the-making
Champ in-the-making
Hi! Thank you for your reply! As you suggested, I started looking at category template and found that it admits a parameter multipleSelectMode, which is true by default. Then I started investigation, how I can use this parameter and found that it is possible to pass false into this parameter in share-config-custom.xml.

So, in the form configuration, I write something like this:

<form>
  <field-visibility>
    <show id="custom:documentType" />
    …
   </field-visibility>
   <appearance>
      <field id="custom:documentType">
        <control>
          <control-param name="multipleSelectMode">false</control-param>
        </control>
      </field>
   </appearance>
</form>

There are also a lot of other useful parameters as startLocation etc.

shubhada
Champ in-the-making
Champ in-the-making
I want to create custom category types. What I am trying to implement is, as OOB alfresco category has two properties as Name and Description. Now I want to add few more properties eg, title to my custom category.
Can anybody suggest on how to proceed ?
Thank you,

kaynezhang
World-Class Innovator
World-Class Innovator
You can refer to https://wiki.alfresco.com/wiki/Classification_And_Categories on how to custom classification

bhaumikt
Champ in-the-making
Champ in-the-making

Hi
I want to add new field in add new discussion module,so how is it possible?

I tried with aspect and model but it didn't worked.