cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Content Type

massanen
Champ in-the-making
Champ in-the-making
Hello everybody. I'm pretty new in Alfresco's world but I have many things to do. I'm working with alfresco 3.4d, and I need to design a Workflow for a Designer School, who need to store their students best works. Every work is a set of files (report, photos, etc.), so I've created a custom model to edit every work with a specific metadata. The metadata is like:

- name of student
- career
- Speciality
- course
- Subject
- …

Of course, "career" will be a combo box with all the possible careers, but I'd also like to charge the specialities in function of the career, the same with the courses (in function of Speciallity), and the same with subjects (in function of the course, and Speciality). I know to create the type of metadata ComboBox ("type list", "allowed values", "value"…), but I've got no idea how to charge it in function of the parameter before. Any idea of how should it be done?

In another hand, I'd like that the user could fill the metadata when he creates the space/folder, because now I only know to fill the metadata when he edits the folder. Is there any way to do it??


Thanks a lot
6 REPLIES 6

jpotts
World-Class Innovator
World-Class Innovator
It sounds like you are trying to change the values in one dropdown based on the selected value of a previous dropdown. So, if someone selects "Physician" in Career, you would like your Specialty field to show only specialties related to a Physician (Pediatrician, Oncology, etc.).

As of 3.4d, there is no out-of-the-box way to do this that I know of. You're going to have to develop your own custom component. I would start with http://wiki.alfresco.com/wiki/Forms and http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Customization.

The detailed steps are too numerous to outline here, but you will essentially do something like:
- Add all possible values to your constraints
- Override the default controls for the primary and secondary dropdowns with your own custom controls
- Write custom controls that can be configured to be dependent upon the value set in another control
- Write client-side JavaScript bound to the onChange event of the independent control such that when it is changed, it tells the dependent control to filter its list of options based on the value selected in the independent control.

The above assumes you are customizing Alfresco Share for your UI.

I don't understand the second half of your question. When you create a folder in the Share UI, you get a dialog with some metadata fields. Those fields are the default set but you *should* be able to override the Share form config to add/remove any metadata you want to that popup.

Jeff

massanen
Champ in-the-making
Champ in-the-making
yes, that's correct, I want to do what you told. Well, I can try to follow these steps, but I'm working with /alfresco, not with /share. Actually, because I'm not really familiar with alfresco, yet. Do you think I should use /share? The main points I have to do are:

- Create content types for every work (a work is a folder/space)
- Create content types for every document (a document is a part of a work)
- Create a workflow for all the works( the states are: CREATION, PRELIMINARY APPROVAL, REJECTED, HISTORIC, RETENTION, PUBLICATION)
- Create thumbnails for every work.

The second half question is about content types. When I create a new content type to introduce new metadata to every work, I can edit these metadatas when I go to "details" "edit details", not when I create the folder. I also read that is not possible to fill the new metadata when you create a new folder, you always have to go to "details" and "edit details", once is created.


Thanks

jpotts
World-Class Innovator
World-Class Innovator
Yes, you should definitely be using Share if at all possible. It is much easier to customize and it is the client that Alfresco is spending the most time on from an Engineering perspective. There are fewer reasons to use the Explorer client with every release.

If you must use the Explorer client, you might want to take a look at Jean Barmash's blog post on "cascading dropdowns". He built his example based on a custom constraint type that runs a Lucene query, but the cascade functionality might be a good example for what you are trying to do.

Jeff

massanen
Champ in-the-making
Champ in-the-making
I can choose if it's better to use Alfresco Share or the other one. If you advise me to use Share, I can try to work with share, with the hope that it won't be too different.

Now I've seen there is a new version of Alfresco (3.4.e) with a new motor to make workflows, but I'm affraid of documentation.

Sorry for my poor experience, but to design content types, for documents and spaces/folders metadatas, is the same with Explorer client than with Share??

(this blog post seems to be perfect for me (it I can use it with share  :lol:  ))

massanen
Champ in-the-making
Champ in-the-making
Sorry, now I see that Share it's so much better, because it has the repository + better interface + more user options

So, I'm going to work with Share, it will be more powerfull for my client. Thank you very much jpotts!

jpotts
World-Class Innovator
World-Class Innovator
You are welcome. By the way, 3.4.e is a preview release showing the Activiti engine working side-by-side with jBPM. We still consider 3.4.d to be the latest stable release, so if you are using Community for production, use 3.4.d, not 3.4.e.

There should be a major stable release of Alfresco Community that includes Activiti around the August timeframe.

Jeff