public interface IResourceService
Gateway to resource instance data. Use this service to perform CRUD operations on Resource. --- Snippet Code to create Resource---- // Create Resource Service IResourceService rs = serviceFactory.createResourceService(); // Create MetaDate Service IMetaDataService mss = serviceFactory.creatMetaDataService(); // Get the Resource Factory IResourceFactory rss = rss.getResourceFactory(); // Get the type Definition of the Object being created ITypeDefinition objectTypeDef = mss.getType(type); // Create AutoNamed Child Object IGRCObject newObject = rss.createAutoNamedGRCObject(objectTypeDef); //Set Description newObject.setDescription(childDescription); //Set Parent Association newObject.setPrimaryParent(parentObject.getId()); //Create the Object newObject = rss.saveResource(newObject);
ResourceUtil.setFieldValue(
com.ibm.openpages.api.resource.IField, java.lang.Object)IResource,
IServiceFactory,
IField,
ITypeDefinition,
GRCObjectFilter,
FolderFilter,
IFolder| Modifier and Type | Method and Description |
|---|---|
void |
associate(Id grcObject,
java.util.List<Id> parents,
java.util.List<Id> children)
Associate a list of parents, children to a given object.
|
boolean |
canCreate(ITypeDefinition intendedTypeToCreate,
Id intendedFolder,
Id intendedParent)
Checks if the current user has the permissions to create a GRC Object.
|
java.util.List<Id> |
canCreateObjectsForTypes(Id userId,
java.util.List<Id> typesToCreate)
Considers Folder based security, Role based security and Rule based
security globally to check for a list of potential object types which ones the
user may have access to create.
|
java.util.List<Id> |
canCreateObjectsForTypes(java.util.List<Id> typesToCreate,
Id intendedParentObject)
Considers Folder based security, Role based security and Rule based
security to check for a list of potential object types which ones the
current user may have access to create for a specific intended parent GRC Object.
|
Id |
decryptWithExternalKey()
DecryptWithExternalKey - it starts a long running process which decrypts the following
1.
|
void |
deleteResource(Id resourceId)
Delete a resource by id and all its associated primary children resources as well.
|
void |
deleteResource(IResource resource)
Deletes a resource by object and all its associated primary children resources as well.
|
java.lang.String |
determineDefaultFolder(ITypeDefinition typeToCreate,
IGRCObject intendedParent,
boolean createFolders)
Determines the correct default folder for a new GRC Object to be created
as a child of an intended parent GRC Object.
|
void |
dissociate(Id grcObject,
java.util.List<Id> parents,
java.util.List<Id> children)
Dissociate a list of parents, children to a given object.
|
Id |
encryptWithExternalKey()
EncryptWithExternalKey - it starts a long running process which encrypts the following
1.
|
boolean |
exists(Id parentFolderId,
java.lang.String resourcName,
boolean defaultSuffix)
Checks whether a resource with the name already exists in the folder.
|
java.util.List<IDeletedResource> |
findDeletedResources(DeletedResourceFilter filter)
Get a list of deleted GRC objects.
|
IResourcePermission |
getEffectivePermissions(Id userOrGroup,
Id resourceToCheck)
Retrieves the effective resource permissions, read, write, delete, and
associate that a user has for a specific OpenPages resource.
|
IFolder |
getFolder(Id id)
Get a Folder object by Id for the current period.
|
IFolder |
getFolder(Id id,
FolderFilter filter)
Get a Folder object by Id.
|
IFolder |
getFolder(java.lang.String path)
Get a Folder object by path for the current period.
|
IFolder |
getFolder(java.lang.String path,
FolderFilter filter)
Get a Folder object by path.
|
IGRCObject |
getGRCObject(Id id)
Get a GRC object by Id for the the current period including all fields and no associations.
|
IGRCObject |
getGRCObject(Id id,
GRCObjectFilter filter)
Get a GRC object by ID with specified filter for fields and associations.
|
IGRCObject |
getGRCObject(java.lang.String path)
Get a GRC object by path for the current period including all fields and no associations.
|
IGRCObject |
getGRCObject(java.lang.String path,
GRCObjectFilter filter)
Get a GRC object by path with specified filter for fields and associations.
|
Id |
getIdForPath(java.lang.String fullPath)
Retrieves just the Id for a GRC Object or Folder given a full path
without retrieving the entire object.
|
IResourceFactory |
getResourceFactory()
Returns the factory for creating in memory instances of objects.
|
void |
overwriteProperties(Id id,
java.util.List<Id> fieldDefinitionIds,
java.lang.String newValue)
Overwrite text properties of a object with a specific value.
|
void |
purgeResource(Id id)
Fully removes all references to the object from the system, including past versions, audit trail, OpenPages storage
and records from reporting periods.
|
<T extends IResource> |
saveResource(T resource)
Save a resource.
|
IResourceFactory getResourceFactory()
IGRCObject getGRCObject(java.lang.String path, GRCObjectFilter filter)
path - (required) The path to the object to retrievefilter - (required) GRCObjectFilterIGRCObject getGRCObject(java.lang.String path)
path - (required) The path to the object to retrieveIGRCObject getGRCObject(Id id, GRCObjectFilter filter)
id - (required)The Id of the object to retrievefilter - (required) GRCObjectFilterIGRCObject getGRCObject(Id id)
id - (required) The Id of the object to retrieveId getIdForPath(java.lang.String fullPath)
fullPath - the full path for the GRC Object or FolderIFolder getFolder(java.lang.String path, FolderFilter filter)
path - (required) The path to the object to retrievefilter - (required) a filterIFolder getFolder(java.lang.String path)
path - (required) The path to the object to retrieveIFolder getFolder(Id id, FolderFilter filter)
id - (required) The Id of the object to retrievefilter - (required) A filterIFolder getFolder(Id id)
id - (required) The Id of the object to retrieve<T extends IResource> T saveResource(T resource)
resource - (required) The resource to savecanCreate(ITypeDefinition, Id, Id)void deleteResource(IResource resource)
resource - (required) The resource to deletevoid deleteResource(Id resourceId)
resourceId - (required) The id of the resource to deletevoid associate(Id grcObject, java.util.List<Id> parents, java.util.List<Id> children)
grcObject - (required) Id of the target objectparents - (required) List of Parent Idschildren - (required)List of Children Idsvoid dissociate(Id grcObject, java.util.List<Id> parents, java.util.List<Id> children)
grcObject - (required) Id of the target objectparents - (required) List of Parent Idschildren - (required) List of Children IdsIResourcePermission getEffectivePermissions(Id userOrGroup, Id resourceToCheck)
user - (required) User to check permissions forresourceToCheck - (required) Id of the Resource to check permissions onboolean canCreate(ITypeDefinition intendedTypeToCreate, Id intendedFolder, Id intendedParent)
Checks if the current user has the permissions to create a GRC Object. This evaluates the Security Rules to check if user has create permission as well as with required Role-based Security.
The permissions required to create an object are read and write on the intended folder and read and associate on the intended parent.
intendedTypeToCreate - (required) the type to check if can createintendedFolderId - (optional) the folder location where the new object will be
created or null to use the default folder location for the
parent and type.intendedParent - (optional) the parent that the new object will be associated
to as a child or null if orphanedjava.util.List<Id> canCreateObjectsForTypes(Id userId, java.util.List<Id> typesToCreate)
Considers Folder based security, Role based security and Rule based security globally to check for a list of potential object types which ones the user may have access to create. Role-based
This considers whether a user has Read, Write permissions at any context for each type. Restrict rules are not evaluated, extend rules will be OR'd to the folder and role based permissions for each type.
For the special case of Signature objects, additional checks are made that if the user has required access permissions for the Signature object type, then he/she must also be in the correct user groups to have the signoff capability for at least one type, as defined by the OpenPages Settings under 'setting '/OpenPages/Applications/GRCM/Signature/Permission'. Refer to the Administrators Guide for more information on Signature permissions.
userId - (required) User to check permissions fortypesToCreate - (required) List of ITypeDefinition Ids for Object Types that
will checked for the user's ability to create instances of
themjava.util.List<Id> canCreateObjectsForTypes(java.util.List<Id> typesToCreate, Id intendedParentObject)
Considers Folder based security, Role based security and Rule based security to check for a list of potential object types which ones the current user may have access to create for a specific intended parent GRC Object.
This evaluates the Security Rules to check if user has create permission as well as with required Role-based Security.
For the special case of Signature objects, additional checks are made that if the user has required access permissions for the Signature object type, then he/she must also be in the correct user groups to have the signoff capability for at least one type, as defined by the OpenPages Settings under 'setting '/OpenPages/Applications/GRCM/Signature/Permission'. Refer to the Administrators Guide for more information on Signature permissions.
typesToCreate - (required) List of ITypeDefinition Ids for Object Types that
will checked for the user's ability to create instances of
themintendedParentObject - (required) Id of intended parent if known, null if not known.java.lang.String determineDefaultFolder(ITypeDefinition typeToCreate, IGRCObject intendedParent, boolean createFolders)
typeToCreate - type of the child that is to be createdintendedParent - the parent GRC Object to create the child fromcreateFolders - if the folders in the path should be created if they do not exist currentlyboolean exists(Id parentFolderId, java.lang.String resourcName, boolean defaultSuffix)
parentFolderID - resourcename - defaultSuffix - true to append .txt to the resource namejava.util.List<IDeletedResource> findDeletedResources(DeletedResourceFilter filter)
Permissions:
The operation can only be performed by a super user.
filter - (optional) The path to the object to retrieve
DeletedResourceFilter filter = new DeletedResourceFilter();
List resources;
Id userId = currentUserId;
filter.getConditions()
.add(new DeletedResourceFilter.FilterCondition(DeletedResourceFilter.FIELD_RESOURCE_TYPE, DeletedResourceFilter.OPERATOR_EQUAL_TO, 1));
filter.getConditions().add(new DeletedResourceFilter.FilterCondition(DeletedResourceFilter.FIELD_DESCRIPTION, DeletedResourceFilter.OPERATOR_LIKE,
"%" + descriptionAll + "%"));
filter.getConditions().add(new DeletedResourceFilter.FilterCondition(DeletedResourceFilter.FIELD_LOCATION, DeletedResourceFilter.OPERATOR_LIKE,
"/_op_sox/Project/Default%"));
filter.getConditions().add(new DeletedResourceFilter.FilterCondition(DeletedResourceFilter.FIELD_LAST_MODIFICATION_DATE,
DeletedResourceFilter.OPERATOR_GREATER_THAN_OR_EQUAL, createdtDate));
filter.getConditions().add(
new DeletedResourceFilter.FilterCondition(DeletedResourceFilter.FIELD_LAST_MODIFIED_BY, DeletedResourceFilter.OPERATOR_EQUAL_TO, userId));
filter.getConditions().add(new DeletedResourceFilter.FilterCondition(DeletedResourceFilter.FIELD_CONTENT_TYPE_ID,
DeletedResourceFilter.OPERATOR_EQUAL_TO, busEntityType.getId()));
filter.setStartRow(1);
filter.setEndRow(1000);
resources = resourceService.findDeletedResources(filter);
DeletedResourceFiltervoid purgeResource(Id id)
Permissions:
The operation can only be performed by a super user.
id - (required)The Id of the object to purge. The id can be an object id or a soft deleted object id.void overwriteProperties(Id id, java.util.List<Id> fieldDefinitionIds, java.lang.String newValue)
Limitations:
DataType.STRING_TYPEDataType.MEDIUM_STRING_TYPEDataType.LARGE_STRING_TYPEDataType.UNLIMITED_STRING_TYPEDisplayTypes.TEXT_BOXDisplayTypes.TEXT_AREADisplayTypes.RICH_TEXTDisplayTypes.LINKDisplayTypes.LINK_RTDisplayTypes.IN_LINEPermissions:
The operation can only be performed by a super user.
id - (required) The Id of the object to overwritefieldDefinitionIds - (required) a list of field definition id to which the new value is overwrittennewValue - (required) the new valueId encryptWithExternalKey()
Permissions:
The operation can only be performed by a super user.
Id decryptWithExternalKey()
Permissions:
The operation can only be performed by a super user.
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.