Constraints for creating hierarchical items
Constraints are enforced when you create hierarchical items and documents.
The following constraints are enforced at run time when you create a hierarchical item or document:
- Name constraint: Each hierarchical item or document requires a name.
- Parent constraint: Each hierarchical item or document requires a single hierarchical parent folder.
- Reachable constraint: The hierarchical item or document must be reached from the root hierarchical folder.
- Same-name sibling constraint: The name value of a hierarchical item or document must be unique within a given hierarchical parent folder.
- Folders-only constraint: Each item in a folders-only item type must have a semantic type of Folder.
- Specifying a hierarchical parent folder
- Because a parent folder is required, it must be specified when
you create a hierarchical item, unless the system is configured to
use a default folder. The parent folder is specified during item creation
using the DKConstantICM.DK_ICM_PROPERTY_PARENT_FOLDER property.
For example:
DKDDO parent = dsICM.getRootFolder(); propId = ddo.addProperty (DKConstantICM.DK_ICM_PROPERTY_PARENT_FOLDER,parent); - Security checking
- To create a hierarchical item or document, you must have the ItemAdd privilege. In addition, you must have access with the linking privileges on both the input hierarchical parent folder and the created hierarchical item.
- System-defined objects protection
- You cannot create new items in the ICM$FOLDER item type.
- Auto-folder considerations
- According to auto-linking rules, a hierarchical item type can be a target item type and a non-hierarchical item type can be a source item type. Non-hierarchical folders are propagated and linked as normal when a hierarchical item is created in the target item type.
The following table compares constraints for creating hierarchical and non-hierarchical items
| Constraint | Hierarchical item | Non-hierarchical item |
|---|---|---|
| Parent folder input (System Hierarchical Default Folder option is disabled) | Required. No default hierarchical parent folder if you do not provide a hierarchical parent folder (default behavior). | Optional |
| Parent folder input (System Hierarchical Default Folder option is enabled) | Optional. Defaults to ICMSYSDEFAULTFOLDER folder when you do not provide the hierarchical parent folder. | Optional. The System Hierarchical Default Folder option does not apply. |
| Semantic type Folder is enforced for input parent folder | Yes | Yes |
| ICM$NAME input | Yes. There is no default value for ICM$NAME. | Not applicable |
| Hierarchical constraints enforcement |
|
No |
| Folders-only constraint enforcement | Yes | Yes |
| Auto-folder support | Yes, but a hierarchical item can be the target item. | Yes |