Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

ClassSpecificAssignment

Summary

Sets the rules for automatic location assignment when uploading related objects.

Usage

 

ClassSpecificAssignment[]= list_of_classes_and_class_groups1;list_of_locations1;main_location1
ClassSpecificAssignment[]= list_of_classes_and_class_groups2;list_of_locations2;main_location2
...

Description

While the "DefaultAssignment" directive sets the default location for newly created (uploaded) related objects, the "ClassSpecificAssignment" directive makes it possible to specify a set of override rules. These rules make it possible to place specific types of objects at desired locations in the tree.

The value of this setting has to be provided as an array where each element must contain two or three values separated by semicolons.

The first value sets which types of objects that should be affected. It has to be a class and/or class group or a comma separated list of classes and/or class groups (both identifiers and ID numbers can be used). Note that classes should come before class groups because it is always the first match that will be used.

The second value tells the system where to place newly uploaded objects of the specified type. It has to be a location or a comma separated list of locations (both paths and ID numbers of the desired nodes can be used). If multiple locations are specified, you can use the optional third parameter to set which of the locations that should be the main node. If the third (main node) parameter is omitted, the first location in the list will be the main node.

From 3.9, the "ClassSpecificAssignment" array may contain several entries using the same first value. This means that you can specify multiple sets of locations for the same class. The system will use the one (the others will be skipped) under which the current user has sufficient "create" privileges.

If the class is not mentioned anywhere in the "ClassSpecificAssignment" setting or if it is mentioned but the current user does not have sufficient "create" privileges at the specified locations, the value (location) specified by the "DefaultAssignment" setting will be used.

Examples

Example 1

 

ClassSpecificAssignment[]=flash;media/movies,media/multimedia,media/myflash;media/multimedia


With this configuration, newly uploaded flash files will be placed at three locations: "media/movies", "media/myflash" and "media/multimedia". The main node will be located under "media/multimedia".

Example 2

Let's say that you have several folders called "computers", "news", "company" and "john_photo" located under the "Media" top level node. In addition, you create the following rules:

ClassSpecificAssignment[]=image;media/computers,media/news
ClassSpecificAssignment[]=image;media/company
ClassSpecificAssignment[]=image;media/john_photo

In this case, the system will choose a location for uploaded images according to the current user's privileges. If the user has sufficient "create" privileges under both "media/computers" and "media/news", all images uploaded by this user will be put to these folders (the system will create main nodes under "media/computers" and additional locations under "media/news"). However, if the user does not have the necessary privileges, the system will skip this line and go to the next one. If the user has sufficient "create" privileges under "media/company", the images will be put inside that folder. If not, the system will skip that line as well and check the next one. If the user has sufficient "create" privileges under "media/john_photo", the images will be put in that folder. Otherwise, the default location will be used.

Julia Shymova (18/05/2007 2:49 pm)

Julia Shymova (21/05/2007 9:24 am)

Julia Shymova, Balazs Halasy


Comments

There are no comments.