cancel
Showing results for 
Search instead for 
Did you mean: 

Group as a property of a content type

anusk
Champ in-the-making
Champ in-the-making
Hi!
I created a custom content type and I need to add a property that is a group of users.Is this possible?
And if it is, could anybody give me a clue about it?

Thanks!
5 REPLIES 5

invictus9
Champ in-the-making
Champ in-the-making
When you say "group of users", do you mean a group in the sense that you manage from the Manage Users and Groups web pages? Or do you mean a list of user accounts?

The property is yours to control. You can create the property as a text field, with repeating values, and store the group or user names in it. Look up the pages on defining new content, and look at multivalue properties.

anusk
Champ in-the-making
Champ in-the-making
Hi invictus9!
When i said "group of users" i mean "in the sense that you manage from the Manage Users".
For example, if i have 3 groups created (org1, org2, org3), what i'm looking for is when you add content, in the Modify Content Properties page should appear a property "organizators" that must be one of the 3 groups.

Although i can create a property as a text field, i don't want to store only the name, because the user may not know the groups that are available. I want to show the groups created and then choose one.
can i do this?

invictus9
Champ in-the-making
Champ in-the-making
Disclaimer: I have only done preliminary research on this to lay out an architecture for a similar feature.

If you go to the page that actually allows you to invite a group to a page, you will see a picker for groups. In my design, I was going to use that to perform a custom search for pages that a particular group had been invited to.

Here is a link to examples of a dynamic list for a drop down field: http://ecmarchitect.com/archives/2008/08/13/845

Here is a link to how to find ACLs on a node: http://forums.alfresco.com/en/viewtopic.php?f=36&t=24185

anusk
Champ in-the-making
Champ in-the-making
Ok, i think maybe it woulb be more easy to display a h:selectOneMenu with all the groups.
Something like this:


<h:selectOneMenu id="select_grupo" value="#{GroupsBean.groupName}" >
<f:selectItems value="#{GroupsBean.groups}"  />
</h:selectOneMenu>

The problem is that #{GroupsBean.groups}" return a List<Map>,
How can i get the name of the groups (converted into SelectItems) to be displayed on the selectOneMenu???

Thanks in advanced!!

anusk
Champ in-the-making
Champ in-the-making
Ok, i finally found the answer.
You have to create an association instead of a property.

with this in the customModel.xml inside of your content type, you can pick up a group from all that are in the root group.


<associations>
         
<association name="custom:nameoftheassociation">
   <title>title of the association</title>
   <target>
                        <!– TODO: Refactor when group is pulled into content model –>
                        <class>usr:authorityContainer</class>
                        <mandatory>false</mandatory>
                        <many>false</many>
                 </target>
</association>   
</associations>

I hope someone find this useful!!
Regards,

Ana