cancel
Showing results for 
Search instead for 
Did you mean: 

content classes?

timv
Champ in-the-making
Champ in-the-making
Hi,
I have been reading in the wiki docs, but it's not all clear to me.

In other cmses I create a content class, say Event, which has some attributes, let's say an image, a title, a description, a start-date. After that I can create a couple of instances of the event type, event1, event2, event3,… .

How can I do this in Alfresco? I saw you can add a type in the content model, I see there is a type 'Person' defined there with a couple of attributes. But I don't see in Alfresco a way to just create a Person instance.
Where will I find a form to create an Event instance after I created the 'event' content type?

Thanks.
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
You configure the web client to show the custom types you would like to be able to create.

http://wiki.alfresco.com/wiki/Web_Client_Model_Configuration_Guide

timv
Champ in-the-making
Champ in-the-making
Thanks alot.

I created the content and a couple of 'instances' of it. Let's say event1 and event2.
Now, using the webservices API I can fetch the content (and I guess also other normal properties) like this:

Reference EventFolder = new Reference(store, null, "/app:company_home/cm:Public_x0020_website/cm:Events/cm:jfall");
Content[] readResult = contentService.read(new Predicate(new Reference[]{EventFolder}, store, null),Constants.PROP_CONTENT);
Content content = readResult[0];
writer.println(ContentUtils.getContentAsString(content);

But now for my event, having a description property (cm:myDescription), how can I fetch the value of this description property in my code?

Thank You.
timv

gavinc
Champ in-the-making
Champ in-the-making
You can either use the getProperties() method on NodeService or if you are using the web service API you can use the get() method in the RepositoryWebService. The resulting Node objects have the individual properties.

timv
Champ in-the-making
Champ in-the-making
thanks again