- Alfresco Developer Guide
- Jeff Potts
- 223字
- 2025-02-21 02:52:52
Step-by-Step: Finishing up the Model
Let's finish up the model by doing two things: First, the remaining departments need content types added to them. Second, there is an out of the box aspect that needs to be applied to all the content. It's called generalclassifiable
. It allows content to be categorized. SomeCo wants all of its content to be classifiable as soon as it hits the repository. To make that happen, you need to define the aspect as mandatory. Because SomeCo wants it across the board, you can do it on the root type sc:doc
, and have it trickle down to all of SomeCo's types.
To add the remaining departmental content types as well as make the generalclassifiable
aspect mandatory, follow these steps:
- Edit the
scModel.xml
file. - Add the the following types:
<type name="sc:hrDoc"> <title>Someco HR Document</title> <parent>sc:doc</parent> </type> <type name="sc:salesDoc"> <title>Someco Sales Document</title> <parent>sc:doc</parent> </type> <type name="sc:opsDoc"> <title>Someco Operations Document</title> <parent>sc:doc</parent> </type> <type name="sc:legalDoc"> <title>Someco Legal Document</title> <parent>sc:doc</parent> </type>
- Modify the
sc:doc
type to includecm:generalclassifiable
as a mandatory aspect. Note that you can add as many mandatory aspects as you need:<type name="sc:doc"> <title>Someco Document</title> <parent>cm:content</parent> <associations> </associations> <mandatory-aspects> <aspect>cm:generalclassifiable</aspect> </mandatory-aspects> </type>
- Save the
model
file. - Run
ant
deploy
and restart Tomcat.
Watch the log for content model-related errors. If everything starts up cleanly, you are ready to move on. In the next set of examples, you'll configure the web client so that you can work with your new model.