Class GenericItemType
Object
GenericItemType
- All Implemented Interfaces:
BulkAccessCheckingItemType,CreatableItemType,DeadItemsCheckingItemType,StructureItemType<GenericItem>,StructureOwnedItemType,UpdatableItemType
@PublicApi
public class GenericItemType
extends Object
implements StructureItemType<GenericItem>, CreatableItemType, UpdatableItemType, StructureOwnedItemType, DeadItemsCheckingItemType, BulkAccessCheckingItemType
GenericItemType is responsible for generic items support in Structure plugin.
It is used as a reference in structure-item-type module that declares generic item type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GenericItemManagerprotected final GenericItemServiceprotected final StructurePluginHelperstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionGenericItemType(GenericItemService genericItemService, GenericItemManager genericItemManager, StructurePluginHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionaccessItem(ItemIdentity itemId) Does not check for permissions.createDummyRow(long rowId, long semantics, Map<String, Object> values, ErrorCollection errors) createItem(Map<String, Object> values, ErrorCollection errors) voidfilterDead(ItemIdentitySet items, ItemIdentitySet deadCollector) Item is considered dead, if the item ID is guaranteed to never be valid again.voidfilterInaccessible(ItemIdentitySet items, ApplicationUser user, boolean overrideSecurity, ItemIdentitySet inaccessibleCollector) getOwnedItem(ItemIdentity itemId, long structureId, boolean copyIfSame) Associate an item with a structure, or create a copy of the given item and associate the copy with the structure.voidinit(ModuleDescriptor descriptor) booleanisVisible(GenericItem item, ApplicationUser user) protected voidreadItemValues(GenericItem.Builder builder, Map<String, Object> values, GenericItem existing, ErrorCollection errors) voidupdateItem(ItemIdentity itemId, Map<String, Object> values, ErrorCollection errors)
-
Field Details
-
NEW_ITEM_ID
public static final long NEW_ITEM_ID- See Also:
-
myGenericItemService
-
myGenericItemManager
-
myHelper
-
-
Constructor Details
-
GenericItemType
public GenericItemType(GenericItemService genericItemService, GenericItemManager genericItemManager, StructurePluginHelper helper)
-
-
Method Details
-
init
@Internal public void init(ModuleDescriptor descriptor) -
accessItem
Description copied from interface:StructureItemTypeDoes not check for permissions.- Specified by:
accessItemin interfaceStructureItemType<GenericItem>- Returns:
-
isVisible
- Specified by:
isVisiblein interfaceStructureItemType<GenericItem>
-
createDummyRow
public StructureRow createDummyRow(long rowId, long semantics, Map<String, Object> values, ErrorCollection errors) throws StructureException- Specified by:
createDummyRowin interfaceCreatableItemType- Throws:
StructureException
-
createItem
public ItemIdentity createItem(Map<String, Object> values, ErrorCollection errors) throws StructureException- Specified by:
createItemin interfaceCreatableItemType- Throws:
StructureException
-
updateItem
public void updateItem(ItemIdentity itemId, Map<String, Object> values, ErrorCollection errors) throws StructureException- Specified by:
updateItemin interfaceUpdatableItemType- Throws:
StructureException
-
getOwnedItem
@NotNull public ItemIdentity getOwnedItem(@NotNull ItemIdentity itemId, long structureId, boolean copyIfSame) throws StructureException Description copied from interface:StructureOwnedItemTypeAssociate an item with a structure, or create a copy of the given item and associate the copy with the structure.- Specified by:
getOwnedItemin interfaceStructureOwnedItemType- Parameters:
itemId- The item ID.structureId- The structure ID.copyIfSame- Create a copy of the item even if it is already associated with the given structure.- Returns:
- The ID of the associated item.
- Throws:
StructureException
-
filterDead
Description copied from interface:DeadItemsCheckingItemTypeItem is considered dead, if the item ID is guaranteed to never be valid again.- Specified by:
filterDeadin interfaceDeadItemsCheckingItemType- Parameters:
items- items to look up for dead onesdeadCollector- collection to add dead items to.
-
filterInaccessible
public void filterInaccessible(ItemIdentitySet items, ApplicationUser user, boolean overrideSecurity, ItemIdentitySet inaccessibleCollector) - Specified by:
filterInaccessiblein interfaceBulkAccessCheckingItemType
-
readItemValues
protected void readItemValues(@NotNull GenericItem.Builder builder, @Nullable Map<String, Object> values, @Nullable GenericItem existing, @NotNull ErrorCollection errors)
-