@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.
Modifier and Type | Field and Description |
---|---|
static long |
NEW_ITEM_ID |
Constructor and Description |
---|
GenericItemType(GenericItemService genericItemService,
GenericItemManager genericItemManager,
StructurePluginHelper helper) |
Modifier and Type | Method and Description |
---|---|
GenericItem |
accessItem(ItemIdentity itemId)
Does not check for permissions.
|
StructureRow |
createDummyRow(long rowId,
long semantics,
Map<String,Object> values,
ErrorCollection errors) |
ItemIdentity |
createItem(Map<String,Object> values,
ErrorCollection errors) |
void |
filterDead(ItemIdentitySet items,
ItemIdentitySet deadCollector)
Item is considered dead, if the item ID is guaranteed to never be valid again.
|
void |
filterInaccessible(ItemIdentitySet items,
ApplicationUser user,
boolean overrideSecurity,
ItemIdentitySet inaccessibleCollector) |
ItemIdentity |
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.
|
void |
init(ModuleDescriptor descriptor) |
boolean |
isVisible(GenericItem item,
ApplicationUser user) |
void |
updateItem(ItemIdentity itemId,
Map<String,Object> values,
ErrorCollection errors) |
public static final long NEW_ITEM_ID
public GenericItemType(GenericItemService genericItemService, GenericItemManager genericItemManager, StructurePluginHelper helper)
@Internal public void init(ModuleDescriptor descriptor)
@Nullable public GenericItem accessItem(@NotNull ItemIdentity itemId)
StructureItemType
accessItem
in interface StructureItemType<GenericItem>
public boolean isVisible(@NotNull GenericItem item, @Nullable ApplicationUser user)
isVisible
in interface StructureItemType<GenericItem>
public StructureRow createDummyRow(long rowId, long semantics, Map<String,Object> values, ErrorCollection errors) throws StructureException
createDummyRow
in interface CreatableItemType
StructureException
public ItemIdentity createItem(Map<String,Object> values, ErrorCollection errors) throws StructureException
createItem
in interface CreatableItemType
StructureException
public void updateItem(ItemIdentity itemId, Map<String,Object> values, ErrorCollection errors) throws StructureException
updateItem
in interface UpdatableItemType
StructureException
@NotNull public ItemIdentity getOwnedItem(@NotNull ItemIdentity itemId, long structureId, boolean copyIfSame) throws StructureException
StructureOwnedItemType
getOwnedItem
in interface StructureOwnedItemType
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.StructureException
public void filterDead(ItemIdentitySet items, ItemIdentitySet deadCollector)
DeadItemsCheckingItemType
filterDead
in interface DeadItemsCheckingItemType
items
- items to look up for dead onesdeadCollector
- collection to add dead items to.public void filterInaccessible(ItemIdentitySet items, ApplicationUser user, boolean overrideSecurity, ItemIdentitySet inaccessibleCollector)
filterInaccessible
in interface BulkAccessCheckingItemType
Copyright © 2023 ALM Works. All Rights Reserved.