@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public abstract class RootEntity extends PersistableNamedObject implements INotScriptFriendly, IEntityDefinition, IConfigurableObject, IDesignTimeSecurableEntity, IRunTimeSecurableEntity, IVisibilitySecurableEntity, IAvatar, IAspectContainer, ITaggableObject, IDiffableObject, IEntityLifeCycleEvent, IDependencyScannableObject
The base class for all persistable entities in Thingworx.
The RootEntity
class defines the minimum amount of functionality required for all entities that are available in the Thingworx
platform, as well as providing the necessary methods to handle the entity lifecycle. All entities in Thingworx must extend this class or
one of its subclasses.
All entities have the following lifecycle, at a minimum (subclasses may introduce new events):
Inactive ? Preinitializing ? Validating ? Initializing ? Cleaning Up ? DisposingThese lifecycle events have the following methods:
State | Method | Description |
---|---|---|
Preinitialize | preInitializeEntity() |
Occurs only during the import process. |
Validate | validateConfiguration(ImportedEntityCollection) |
Occurs only during the entity import process. Validates all requirements of the entity. |
Initialize | initializeEntity() |
Initializes the entity. Should be used to initialize the state of the entity. |
Cleanup | cleanupEntity(PatchType) |
Deactivates the entity. Should be used to clean up any managed or long-lived artifacts. |
Dispose | dispose() |
Removes any remaining references to this entity. |
RootEntity
is not thread-safe nor is it designed to be mutated by multiple threads simultaneously.
Modifier and Type | Field and Description |
---|---|
static java.util.HashSet<java.lang.String> |
BASIC_PROPERTIES
Set of basic properties for any entity.
|
NAME_COMPARATOR
Constructor and Description |
---|
RootEntity() |
Modifier and Type | Method and Description |
---|---|
void |
AddConfigurationTableDefinition(java.lang.String name,
java.lang.String description,
java.lang.String category,
java.lang.Integer ordinal,
java.lang.Boolean isHidden,
java.lang.Boolean isMultiRow,
java.lang.String dataShapeName)
Service Category: Configuration
Service Description: Adds a ConfigurationTableDefinition and creates and ConfigurationTable from the definition.
|
void |
addDesignTimePermission(PermissionTypes permissionType,
Permission permission) |
void |
AddDesignTimePermission(java.lang.String type,
java.lang.String principal,
java.lang.String principalType,
java.lang.Boolean allow)
Service Category: Permissions
Service Description: Add a design time permission.
|
void |
addRunTimePermission(PermissionTypes permissionType,
java.lang.String resourceName,
Permission permission) |
void |
AddRunTimePermission(java.lang.String type,
java.lang.String resource,
java.lang.String principal,
java.lang.String principalType,
java.lang.Boolean allow)
Service Category: Permissions
Service Description: Add a run time permission.
|
void |
AddTags(TagCollection tags)
Service Category: Metadata
Service Description: Append additional tags to an entity.
|
void |
addVisibilityPermission(PermissionTypes permissionType,
Permission permission) |
void |
AddVisibilityPermission(java.lang.String principal,
java.lang.String principalType)
Service Category: Permissions
Service Description: Add a visibility permission.
|
java.lang.Boolean |
CheckDesignTimePermission(java.lang.String type)
Service Category: Permissions
Service Description: Check to see if an entity has a specific design time permission for the current user.
|
java.lang.Boolean |
CheckDesignTimePermissionForGroup(java.lang.String group,
java.lang.String type)
Service Category: Permissions
Service Description: Check to see if an entity has a specific design time permission for a specific group.
|
java.lang.Boolean |
CheckDesignTimePermissionForUser(java.lang.String user,
java.lang.String type)
Service Category: Permissions
Service Description: Check to see if an entity has a specific design time permission for a specific user.
|
java.lang.Boolean |
CheckPermission(java.lang.String type,
java.lang.String name)
Service Category: Permissions
Service Description: Check to see if an entity has a specific run time permission for the current user.
|
java.lang.Boolean |
CheckPermissionForGroup(java.lang.String group,
java.lang.String type,
java.lang.String name)
Service Category: Permissions
Service Description: Check to see if an entity has a specific run time permission for a specific group.
|
java.lang.Boolean |
CheckPermissionForUser(java.lang.String user,
java.lang.String type,
java.lang.String name)
Service Category: Permissions
Service Description: Check to see if an entity has a specific run time permission for a specific user.
|
void |
cleanupEntity()
|
void |
cleanupEntity(PatchType patchType)
|
void |
DeleteAllConfigurationTableRows(java.lang.String tableName,
java.lang.Boolean persistent)
Service Category: Configuration
Service Description: Delete all rows from a multi-row configuration table.
|
void |
DeleteConfigurationTable(java.lang.String tableName,
java.lang.Boolean persistent)
Service Category: Configuration
Service Description: Delete an entire configuration table.
|
void |
DeleteConfigurationTableRows(java.lang.String tableName,
InfoTable values,
java.lang.Boolean persistent)
Service Category: Configuration
Service Description: Delete one or more rows from a multi-row configuration table.
|
void |
deleteDesignTimePermission(PermissionTypes permissionType,
Permission permission) |
void |
DeleteDesignTimePermission(java.lang.String type,
java.lang.String principal,
java.lang.String principalType)
Service Category: Permissions
Service Description: Delete a design time permission.
|
void |
deleteRunTimePermission(PermissionTypes permissionType,
java.lang.String resourceName,
Permission permission) |
void |
DeleteRunTimePermission(java.lang.String type,
java.lang.String resource,
java.lang.String principal,
java.lang.String principalType)
Service Category: Permissions
Service Description: Delete a run time permission.
|
void |
deleteVisibilityPermission(PermissionTypes permissionType,
Permission permission) |
void |
DeleteVisibilityPermission(java.lang.String principal,
java.lang.String principalType)
Service Category: Permissions
Service Description: Delete a visibility permission.
|
void |
dispose()
|
AspectCollection |
getAspects()
|
ImagePrimitive |
GetAvatar()
Service Category: Metadata
Service Description: Get avatar image.
|
byte[] |
getAvatarContent() |
java.lang.String |
GetAvatarURL()
Service Category: Metadata
Service Description: Get avatar image url.
|
InfoTable |
GetConfigurationChangeHistory()
Service Category: Editing
Service Description: Get the configuration change history.
|
java.lang.Object |
getConfigurationSetting(java.lang.String table,
java.lang.String property) |
ConfigurationTable |
getConfigurationTable(java.lang.String table) |
InfoTable |
GetConfigurationTable(java.lang.String tableName)
Service Category: Configuration
Service Description: Get a specific configuration table as an InfoTable.
|
InfoTable |
GetConfigurationTableDefinition(java.lang.String tableName)
Service Category: Configuration
Service Description: Get a specific configuration table definition as an InfoTable.
|
InfoTable |
GetConfigurationTableRow(java.lang.String tableName,
java.lang.String key)
Service Category: Configuration
Service Description: Get a specific configuration table row as an InfoTable.
|
InfoTable |
GetConfigurationTables()
Service Category: Configuration
Service Description: Get a list of configuration tables.
|
java.lang.String |
GetDescription()
Service Category: Metadata
Service Description: Get the description for an entity.
|
DesignTimePermissionCollection |
getDesignTimePermissions() |
InfoTable |
GetDesignTimePermissions()
Service Category: Permissions
Service Description: Get a list of assigned design time permissions.
|
org.json.JSONObject |
GetDesignTimePermissionsAsJSON()
Service Category: Permissions
Service Description: Get a list of assigned designtime permissions.
|
java.lang.String |
getDocumentationContent() |
abstract RelationshipTypes.ThingworxRelationshipTypes |
getEntityType()
|
java.lang.String |
getEntityTypeAsString() |
InfoTable |
GetEventDefinition(java.lang.String name)
Service Category: Metadata
Service Description: Get ann event definitions for this thing.
|
InfoTable |
GetEventDefinitions(java.lang.String category,
java.lang.String dataShape)
Service Category: Metadata
Service Description: Get the current event definitions for this thing.
|
java.lang.String |
GetHomeMashup()
Service Category: Mashups
Service Description: Get home mashup.
|
InfoTable |
GetIncomingDependencies(java.lang.Double maxItems)
Service Category: Dependencies
Service Description: Get the incoming dependencies.
|
InfoTable |
GetIncomingDependenciesAsNetwork(java.lang.Double maxItems,
java.lang.Double maxDepth)
Service Category: Dependencies
Service Description: Get the incoming dependencies as a network.
|
org.json.JSONObject |
GetInstanceMetadataAsJSON()
Service Category: Metadata
Service Description: Get the instance metadata in JSON format.
|
org.json.JSONObject |
GetInstanceMetadataWithPermissionsAsJSON()
Service Category: Metadata
Service Description: Get the instance metadata in JSON format.
|
org.joda.time.DateTime |
GetLastModifiedDate()
Service Category: Editing
Service Description: Get the date edit was last modified.
|
InfoTable |
GetMetadata()
Service Category: Metadata
Service Description: Get the metadata in InfoTable format.
|
org.json.JSONObject |
GetMetadataAsJSON()
Service Category: Metadata
Service Description: Get the metadata in JSON format.
|
org.json.JSONObject |
GetMetadataWithPermissionsAsJSON()
Service Category: Metadata
Service Description: Get the metadata in JSON format.
|
InfoTable |
GetOutgoingDependencies(java.lang.Double maxItems)
Service Category: Dependencies
Service Description: Get the outgoing dependencies.
|
InfoTable |
GetOutgoingDependenciesAsNetwork(java.lang.Double maxItems,
java.lang.Double maxDepth)
Service Category: Dependencies
Service Description: Get the outgoing dependencies as a network.
|
EntityReference |
getOwner() |
InfoTable |
GetPermissionsForCurrentUser(java.lang.String permissionName,
java.lang.String name)
Service Category: Permissions
Service Description: Get current user permissions.
|
InfoTable |
GetPermissionsForGroup(java.lang.String group,
java.lang.String permissionName,
java.lang.String name)
Service Category: Permissions
Service Description: Get group permissions.
|
InfoTable |
GetPermissionsForUser(java.lang.String user,
java.lang.String permissionName,
java.lang.String name)
Service Category: Permissions
Service Description: Get user permissions.
|
java.lang.String |
GetProjectName()
Service Category: Projects
Service Description: Get the project name of this entity.
|
InfoTable |
GetPropertyDefinition(java.lang.String name)
Service Category: Metadata
Service Description: Get the current property definitions for this thing.
|
InfoTable |
GetPropertyDefinitions(java.lang.String category,
java.lang.String type,
java.lang.String dataShape)
Service Category: Metadata
Service Description: Get the current property definitions for this thing.
|
RunTimePermissionCollection |
getRunTimePermissions() |
InfoTable |
GetRunTimePermissions()
Service Category: Permissions
Service Description: Get a list of assigned runtime permissions.
|
org.json.JSONObject |
GetRunTimePermissionsAsJSON()
Service Category: Permissions
Service Description: Get a list of assigned runtime permissions.
|
InfoTable |
GetServiceDefinition(java.lang.String name)
Service Category: Metadata
Service Description: Get a service definition for this thing.
|
InfoTable |
GetServiceDefinitions(java.lang.String category,
java.lang.String type,
java.lang.String dataShape)
Service Category: Metadata
Service Description: Get the current service definitions for this thing.
|
java.lang.String |
getStringConfigurationSetting(java.lang.String table,
java.lang.String property) |
java.lang.String |
getStringConfigurationSettingWithDefault(java.lang.String table,
java.lang.String property,
java.lang.String defaultValue) |
InfoTable |
GetSummaryInformation()
Service Category: Metadata
Service Description: Get summary information.
|
TagCollection |
getTags() |
TagCollection |
GetTags()
Service Category: Metadata
Service Description: Get the tags for an entity.
|
InfoTable |
GetTagsAsInfoTable()
Service Category: Metadata
Service Description: Get the tags for an entity as an InfoTable.
|
VisibilityPermissionCollection |
getVisibilityPermissions() |
InfoTable |
GetVisibilityPermissions()
Service Category: Permissions
Service Description: Get a list of assigned visibility permissions.
|
org.json.JSONObject |
GetVisibilityPermissionsAsJSON()
Service Category: Permissions
Service Description: Get a list of assigned visibility permissions.
|
java.lang.Boolean |
HasIncomingDependencies()
Service Category: Dependencies
Service Description: Has incoming dependencies.
|
java.lang.Boolean |
HasOutgoingDependencies()
Service Category: Dependencies
Service Description: Has outgoing dependencies.
|
void |
initializeEntity()
|
boolean |
isEditable() |
boolean |
isEditableExtensionObject() |
boolean |
isEditableSystemObject() |
boolean |
isExtensionObject() |
java.lang.Boolean |
IsMultiRowTable(java.lang.String tableName)
Service Category: Configuration
Service Description: Check if a configuration table is a multi-row table.
|
boolean |
isOwner(EntityReference principal) |
boolean |
isSystemObject() |
boolean |
isThemeObject() |
boolean |
isVisible() |
boolean |
isVisible(SecurityContext securityContext) |
void |
persistDesignTimePermissions() |
void |
persistRunTimePermissions() |
void |
persistVisibilityPermissions() |
void |
preInitializeEntity()
Pre initialize the entity. |
void |
RemoveTags(TagCollection tags)
Service Category: Metadata
Service Description: Remove tags from an entity.
|
void |
SaveConfigurationTables()
Service Category: Configuration
Service Description: Save any changes to configuration tables.
|
void |
SetAvatar(byte[] content)
Service Category: Metadata
Service Description: Set the avatar icon for the entity.
|
void |
setConfigurationSetting(java.lang.String table,
java.lang.String property,
java.lang.Object value) |
void |
SetConfigurationTable(java.lang.String tableName,
InfoTable configurationTable,
java.lang.Boolean persistent)
Service Category: Configuration
Service Description: Set an entire configuration table.
|
void |
SetConfigurationTableRows(java.lang.String tableName,
InfoTable values,
java.lang.Boolean persistent)
Service Category: Configuration
Service Description: Update/add one or more rows in a multi-row configuration table.
|
void |
SetDescription(java.lang.String description)
Service Category: Metadata
Service Description: Overwrite/set the description for an entity.
|
void |
setDesignTimePermissions(DesignTimePermissionCollection value) |
void |
SetDesignTimePermissionsAsJSON(org.json.JSONObject permissions)
Service Category: Permissions
Service Description: Set a list of assigned design time permissions.
|
void |
setDocumentationContent(java.lang.String value) |
void |
setExtensionObject(boolean value) |
void |
SetHomeMashup(java.lang.String name)
Service Category: Mashups
Service Description: Set home mashup.
|
void |
setLastModifiedDate(org.joda.time.DateTime value) |
void |
SetMultiRowConfigurationTable(java.lang.String tableName,
InfoTable configurationTable,
java.lang.Boolean persistent)
Service Category: Configuration
Service Description: Set an entire multi-row configuration table.
|
void |
setOwner(EntityReference principal) |
void |
SetOwner(java.lang.String name)
Service Category: Permissions
Service Description: Assign an owner to this entity.
|
void |
SetProjectName(java.lang.String projectName)
Service Category: Projects
Service Description: Set the project name of this entity.
|
void |
setRunTimePermissions(RunTimePermissionCollection value) |
void |
SetRunTimePermissionsAsJSON(org.json.JSONObject permissions)
Service Category: Permissions
Service Description: Set a list of assigned runtime permissions.
|
void |
setStringConfigurationSetting(java.lang.String table,
java.lang.String property,
java.lang.String value) |
void |
SetTags(TagCollection tags)
Service Category: Metadata
Service Description: Overwrite/set the tags for an entity.
|
void |
setVisibilityPermissions(VisibilityPermissionCollection value) |
void |
SetVisibilityPermissionsAsJSON(org.json.JSONObject permissions)
Service Category: Permissions
Service Description: Set a list of assigned visibility permissions.
|
org.json.JSONObject |
toJSON()
Deprecated.
no replacement
|
org.json.JSONObject |
toJSONDefinition()
Deprecated.
no replacement
|
void |
validateConfiguration(ImportedEntityCollection importedEntityCollections)
|
getID, hasID, isTransient
getDescription, getName, setDescription, setName, toValueCollection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName
getID, getName
public static final java.util.HashSet<java.lang.String> BASIC_PROPERTIES
@ThingworxExtensionApiMethod(since={6,6}) public DesignTimePermissionCollection getDesignTimePermissions()
getDesignTimePermissions
in interface IDesignTimeSecurable
@ThingworxExtensionApiMethod(since={6,6}) public void setDesignTimePermissions(DesignTimePermissionCollection value)
setDesignTimePermissions
in interface IDesignTimeSecurable
@ThingworxExtensionApiMethod(since={6,6}) public VisibilityPermissionCollection getVisibilityPermissions()
getVisibilityPermissions
in interface IVisibilitySecurable
@ThingworxExtensionApiMethod(since={6,6}) public void setVisibilityPermissions(VisibilityPermissionCollection value)
setVisibilityPermissions
in interface IVisibilitySecurable
@ThingworxExtensionApiMethod(since={6,6}) public RunTimePermissionCollection getRunTimePermissions()
getRunTimePermissions
in interface IRunTimeSecurable
@ThingworxExtensionApiMethod(since={6,6}) public void setRunTimePermissions(RunTimePermissionCollection value)
setRunTimePermissions
in interface IRunTimeSecurable
@ThingworxExtensionApiMethod(since={6,6}) public void SetOwner(java.lang.String name) throws java.lang.Exception
name
- User name - USERNAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void AddRunTimePermission(java.lang.String type, java.lang.String resource, java.lang.String principal, java.lang.String principalType, java.lang.Boolean allow) throws java.lang.Exception
type
- Permission type (PropertyRead PropertyWrite ServiceInvoke EventInvoke EventSubscribe) - STRINGresource
- Resource name (* = all or enter a specific resource (i.e. Service, Property, Event) to override) - STRINGprincipal
- Principal name (name of user or group) - STRINGprincipalType
- Principal type (User or Group) - STRINGallow
- Permission (true = allow, false = deny) - BOOLEANjava.lang.Exception
- If an error occurs
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteRunTimePermission(java.lang.String type, java.lang.String resource, java.lang.String principal, java.lang.String principalType) throws java.lang.Exception
type
- Permission type - STRINGresource
- Resource name - STRINGprincipal
- Principal name (name of user or group) - STRINGprincipalType
- Principal type (User or Group) - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void addRunTimePermission(PermissionTypes permissionType, java.lang.String resourceName, Permission permission) throws java.lang.Exception
addRunTimePermission
in interface IRunTimeSecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void deleteRunTimePermission(PermissionTypes permissionType, java.lang.String resourceName, Permission permission) throws java.lang.Exception
deleteRunTimePermission
in interface IRunTimeSecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetRunTimePermissionsAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void SetRunTimePermissionsAsJSON(org.json.JSONObject permissions) throws java.lang.Exception
permissions
- Permissions in JSON format - JSONjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetRunTimePermissions() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void AddDesignTimePermission(java.lang.String type, java.lang.String principal, java.lang.String principalType, java.lang.Boolean allow) throws java.lang.Exception
type
- Permission type (Create, Read, Update, Delete) - STRINGprincipal
- Principal name (name of user or group) - STRINGprincipalType
- Principal type (User or Group) - STRINGallow
- Permission (true = allow, false = deny) - BOOLEANjava.lang.Exception
- If an error occurs
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteDesignTimePermission(java.lang.String type, java.lang.String principal, java.lang.String principalType) throws java.lang.Exception
type
- Permission type - STRINGprincipal
- Principal name (name of user or group) - STRINGprincipalType
- Principal type (User or Group) - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetDesignTimePermissionsAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void SetDesignTimePermissionsAsJSON(org.json.JSONObject permissions) throws java.lang.Exception
permissions
- Permissions in JSON format - JSONjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetDesignTimePermissions() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void AddVisibilityPermission(java.lang.String principal, java.lang.String principalType) throws java.lang.Exception
principal
- Principal name (name of organization or organization unit) - STRINGprincipalType
- Principal type (Organization or Organization Unit) - STRINGjava.lang.Exception
- If an error occurs
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteVisibilityPermission(java.lang.String principal, java.lang.String principalType) throws java.lang.Exception
principal
- Principal name (name of organization or organization unit) - STRINGprincipalType
- Principal type (Organization or Organization Unit) - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetVisibilityPermissionsAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void SetVisibilityPermissionsAsJSON(org.json.JSONObject permissions) throws java.lang.Exception
permissions
- Permissions in JSON format - JSONjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetVisibilityPermissions() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean CheckPermission(java.lang.String type, java.lang.String name) throws java.lang.Exception
type
- Permission type - STRINGname
- Name of the resource (i.e. property, service, event) to check - STRINGjava.lang.Exception
- If an error occurs
The valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, ServiceInvoke
.@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean CheckPermissionForUser(java.lang.String user, java.lang.String type, java.lang.String name) throws java.lang.Exception
user
- User name - USERNAMEtype
- Permission type - STRINGname
- Name of the resource (i.e. property, service, event) to check - STRINGjava.lang.Exception
- If an error occurs
The valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, and ServiceInvoke
.@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean CheckPermissionForGroup(java.lang.String group, java.lang.String type, java.lang.String name) throws java.lang.Exception
group
- Group name - GROUPNAMEtype
- Permission type - STRINGname
- Name of the resource (i.e. property, service, event) to check - STRINGjava.lang.Exception
- If an error occurs
The valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, and ServiceInvoke
.If the current user does not have visibility to the group being checked, then the permission will be returned as false (with no exception message).
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean CheckDesignTimePermission(java.lang.String type) throws java.lang.Exception
type
- Permission type - STRINGjava.lang.Exception
- If an error occurs
The service returns only true or false. If false, the exception message is not returned.
The type input can be one of the following (case-sensitive): Create, Read, Update, or Delete.
The current user must also have ServiceInvoke permission on the entity that they're trying to check the design time permission on.
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean CheckDesignTimePermissionForUser(java.lang.String user, java.lang.String type) throws java.lang.Exception
user
- User name - USERNAMEtype
- Permission type - STRINGjava.lang.Exception
- If an error occurs
The service returns only true or false. If false, the exception message is not returned.
The type input can be one of the following (case-sensitive): Create, Read, Update, or Delete.
If the current user does not have visibility on the user being passed, then the service will return false (with no message/exception). However, if the current user doesn't have visibility on the entity being checked (e.g. a Thing) but has design time permissions on the entity, then the service will return true for the specific permission.
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean CheckDesignTimePermissionForGroup(java.lang.String group, java.lang.String type) throws java.lang.Exception
group
- Group name - GROUPNAMEtype
- Permission type - STRINGjava.lang.Exception
- If an error occurs
The service returns only true or false. If false, the exception message is not returned.
The type input can be one of the following (case-sensitive): Create, Read, Update, or Delete.
The current user must also have ServiceInvoke permission on the entity that they're trying to check the design time permission on.
@ThingworxExtensionApiMethod(since={6,6}) public boolean isVisible()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isVisible(SecurityContext securityContext)
@ThingworxExtensionApiMethod(since={6,6}) public void validateConfiguration(ImportedEntityCollection importedEntityCollections) throws java.lang.Exception
Validates the configuration of the entity during the import process. This method is called whenever a entity is created or modified
via the REST APIs. During the validation step, there may be other associated entities that are being imported. These can be accessed
via the importedEntities
collection if needed.
Note that some resources belonging to the entity or other associated entities may not be available during this step in the lifecycle.
It is required for all subclasses of RootEntity
to call super.validateConfiguration(importedEntityCollections)
if
they override this method.
importedEntityCollections
- - a typed collection of entities currently being importedjava.lang.Exception
- if the entity is invalid@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getEntityTypeAsString()
@ThingworxExtensionApiMethod(since={6,6}) public abstract RelationshipTypes.ThingworxRelationshipTypes getEntityType()
Returns the type of this entity.
@ThingworxExtensionApiMethod(since={6,6}) public void setLastModifiedDate(org.joda.time.DateTime value)
@ThingworxExtensionApiMethod(since={6,6}) public org.joda.time.DateTime GetLastModifiedDate()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isEditable()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isSystemObject()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isEditableSystemObject()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isEditableExtensionObject()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isThemeObject()
@ThingworxExtensionApiMethod(since={6,6}) public boolean isExtensionObject()
@ThingworxExtensionApiMethod(since={6,6}) public void setExtensionObject(boolean value)
@ThingworxExtensionApiMethod(since={6,6}) public AspectCollection getAspects()
@ThingworxExtensionApiMethod(since={6,6}, canOverride=true) public void preInitializeEntity() throws java.lang.Exception
java.lang.Exception
- if an error occurs during the pre-initialization process@ThingworxExtensionApiMethod(since={6,6}, canOverride=true) public void initializeEntity() throws java.lang.Exception
Initializes the internal state of the entity. This method may be called more than once on the same entity during initialization.
All metadata, including aspects and configuration tables, are available at this point in the lifecycle.
java.lang.Exception
- if an error occurs during the initialization process@ThingworxExtensionApiMethod(since={6,6}, canOverride=true, deprecatedSince={9,0}) public void cleanupEntity() throws java.lang.Exception
Releases all managed or long-lived resources held by the entity. Cleanup that should be done regardless of patchRemove or delete should be done here
All metadata, including aspects and configuration tables, are available at this point in the lifecycle. Extensions should not attempt to clean up metadata or any other resources that are managed internally by Thingworx.
java.lang.Exception
- if an error occurs during the cleanup process@ThingworxExtensionApiMethod(since={9,0}, canOverride=true) public void cleanupEntity(PatchType patchType) throws java.lang.Exception
Releases all managed or long-lived resources held by the entity. Cleanup that should be done regardless of patchRemove or delete should be done here
All metadata, including aspects and configuration tables, are available at this point in the lifecycle. Extensions should not attempt to clean up metadata or any other resources that are managed internally by Thingworx.
patchType
- model synchronization patch operationjava.lang.Exception
- if an error occurs during the cleanup process@ThingworxExtensionApiMethod(since={6,6}) public void addDesignTimePermission(PermissionTypes permissionType, Permission permission) throws java.lang.Exception
addDesignTimePermission
in interface IDesignTimeSecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void deleteDesignTimePermission(PermissionTypes permissionType, Permission permission) throws java.lang.Exception
deleteDesignTimePermission
in interface IDesignTimeSecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void persistRunTimePermissions() throws java.lang.Exception
persistRunTimePermissions
in interface IRunTimeSecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void persistDesignTimePermissions() throws java.lang.Exception
persistDesignTimePermissions
in interface IDesignTimeSecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void persistVisibilityPermissions() throws java.lang.Exception
persistVisibilityPermissions
in interface IVisibilitySecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void addVisibilityPermission(PermissionTypes permissionType, Permission permission) throws java.lang.Exception
addVisibilityPermission
in interface IVisibilitySecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void deleteVisibilityPermission(PermissionTypes permissionType, Permission permission) throws java.lang.Exception
deleteVisibilityPermission
in interface IVisibilitySecurable
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationChangeHistory() throws java.lang.Exception
java.lang.Exception
- If an error occurs
This service is not specific to configuration tables. Any create or update to an entity is listed in the change history.
@ThingworxExtensionApiMethod(since={6,6}) public boolean isOwner(EntityReference principal)
isOwner
in interface ISecurable
@ThingworxExtensionApiMethod(since={6,6}) public void setOwner(EntityReference principal)
@ThingworxExtensionApiMethod(since={6,6}) public EntityReference getOwner()
getOwner
in interface ISecurable
@ThingworxExtensionApiMethod(since={6,6}) public TagCollection getTags()
getTags
in interface ITaggableObject
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getDocumentationContent()
@ThingworxExtensionApiMethod(since={6,6}) public void setDocumentationContent(java.lang.String value)
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetSummaryInformation() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String GetDescription()
@ThingworxExtensionApiMethod(since={6,6}) public void SetDescription(java.lang.String description) throws java.lang.Exception
description
- Description for an entity - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public TagCollection GetTags()
@ThingworxExtensionApiMethod(since={6,6}) public void SetTags(TagCollection tags) throws java.lang.Exception
tags
- Tags for an entity - TAGSjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetTagsAsInfoTable() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void AddTags(TagCollection tags) throws java.lang.Exception
tags
- Tags for an entity - TAGSjava.lang.Exception
- If an error occurs
@ThingworxExtensionApiMethod(since={6,6}) public void RemoveTags(TagCollection tags) throws java.lang.Exception
tags
- Tags to remove from the entity - TAGSjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String GetHomeMashup()
@ThingworxExtensionApiMethod(since={6,6}) public void SetHomeMashup(java.lang.String name) throws java.lang.Exception
name
- Home mashup name - MASHUPNAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public ImagePrimitive GetAvatar() throws java.lang.Exception
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String GetAvatarURL()
Returns a URL for an avatar. Example: /Thingworx/Things/ThingName/Avatar
@ThingworxExtensionApiMethod(since={6,6}) public void SetAvatar(byte[] content) throws java.lang.Exception
@ThingworxExtensionApiMethod(since={6,6}) public byte[] getAvatarContent() throws java.lang.Exception
getAvatarContent
in interface IAvatar
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public ConfigurationTable getConfigurationTable(java.lang.String table) throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Object getConfigurationSetting(java.lang.String table, java.lang.String property)
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getStringConfigurationSetting(java.lang.String table, java.lang.String property)
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String getStringConfigurationSettingWithDefault(java.lang.String table, java.lang.String property, java.lang.String defaultValue)
@ThingworxExtensionApiMethod(since={6,6}) public void setConfigurationSetting(java.lang.String table, java.lang.String property, java.lang.Object value) throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void setStringConfigurationSetting(java.lang.String table, java.lang.String property, java.lang.String value) throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={8,3}) public void AddConfigurationTableDefinition(java.lang.String name, java.lang.String description, java.lang.String category, java.lang.Integer ordinal, java.lang.Boolean isHidden, java.lang.Boolean isMultiRow, java.lang.String dataShapeName) throws java.lang.Exception
name
- The name of the configuration table. This name should be used when retrieving values from the configuration table during execution. Configuration tables must have unique names that obey standard ThingWorx entity naming conventions. It is strongly recommended that you always specify a non-empty configuration table name - STRINGdescription
- A short description of the configuration table and its purpose - STRINGcategory
- A category that conceptually groups together related configuration tables. - STRINGordinal
- Controls the order in which the configuration tables should be rendered. Any non-negative integer is permitted, where lower values take higher precedence over larger values. If several tables share the same ordinal, then the order is non-deterministic - INTEGERisHidden
- Controls whether the configuration table should be hidden by Composer (e.g. if the configuration is for internal purposes only) - BOOLEANisMultiRow
- Controls whether the configuration table should accept tabular entry of data or key/value entry. When set to true, the fields in the data shape provided will be interpreted as column descriptors. When set to false or omitted, the fields are interpreted as row descriptors - BOOLEANdataShapeName
- This datashape will be used as the data shape for the Configuration table. Any changes to the datashape like adding or deleting fields will reflect on the configuration table. - DATASHAPENAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={8,3}) public InfoTable GetConfigurationTableDefinition(java.lang.String tableName) throws java.lang.Exception
tableName
- Configuration table name - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTables() throws java.lang.Exception
java.lang.Exception
- If an error occurs
This service can be used for single or multi-row configuration tables.
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTable(java.lang.String tableName) throws java.lang.Exception
tableName
- Configuration table name - STRINGjava.lang.Exception
- If an error occurs
This service can be used for single or multi-row configuration tables.
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTableRow(java.lang.String tableName, java.lang.String key) throws java.lang.Exception
tableName
- Configuration table name - STRINGkey
- Row key value - STRINGjava.lang.Exception
- If an error occurs
This service can be used to validate existing settings, to update configuration table rows, or to get a current structure and settings.
This service only works on multi-row configuration tables that also have a primary key assigned. If this service is run against a single row configuration table or a multi-row configuration table that does not have a primary key, it will throw an exception (HTTP NOT FOUND). Infotable rows are identified by a primary key throughout ThingWorx. Therefore, without a primary key, there is no way to get a specific row.
@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean IsMultiRowTable(java.lang.String tableName) throws java.lang.Exception
tableName
- Configuration table name - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void SetConfigurationTable(java.lang.String tableName, InfoTable configurationTable, java.lang.Boolean persistent) throws java.lang.Exception
tableName
- Configuration table name - STRINGconfigurationTable
- Configuration table content - INFOTABLEpersistent
- Persist these changes - BOOLEANjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void SetMultiRowConfigurationTable(java.lang.String tableName, InfoTable configurationTable, java.lang.Boolean persistent) throws java.lang.Exception
tableName
- Configuration table name - STRINGconfigurationTable
- Configuration table content - INFOTABLEpersistent
- Persist these changes - BOOLEANjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void SetConfigurationTableRows(java.lang.String tableName, InfoTable values, java.lang.Boolean persistent) throws java.lang.Exception
tableName
- Configuration table name - STRINGvalues
- Configuration table rows to modify - INFOTABLEpersistent
- Persist these changes - BOOLEANjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void DeleteConfigurationTable(java.lang.String tableName, java.lang.Boolean persistent) throws java.lang.Exception
tableName
- Configuration table name - STRINGpersistent
- Persist these changes - BOOLEANjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void DeleteConfigurationTableRows(java.lang.String tableName, InfoTable values, java.lang.Boolean persistent) throws java.lang.Exception
tableName
- Configuration table name - STRINGvalues
- Configuration table rows to modify - INFOTABLEpersistent
- Persist these changes - BOOLEANjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void DeleteAllConfigurationTableRows(java.lang.String tableName, java.lang.Boolean persistent) throws java.lang.Exception
tableName
- Configuration table name - STRINGpersistent
- Persist these changes - BOOLEANjava.lang.Exception
- If an error occurs
If the persistent parameter is set to false, some settings may still be visible in the multi-row configuration table in Composer that were actually deleted (in-memory only), unless the entity is restarted (call RestartThing for things and verify that the settings are no longer displayed).
If the entity is saved (in Composer) while the settings in the multi-row configuration table are still being displayed (after deleting with persistent = false), then the settings will become persisted (in-memory) again (i.e. as if it was never deleted).
@ThingworxExtensionApiMethod(since={6,6}) public void SaveConfigurationTables() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPropertyDefinitions(java.lang.String category, java.lang.String type, java.lang.String dataShape) throws java.lang.Exception
category
- Category to filter on - STRINGtype
- Type to filter on - BASETYPENAMEdataShape
- Data shape to filter on if InfoTable base type - DATASHAPENAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPropertyDefinition(java.lang.String name) throws java.lang.Exception
name
- Name - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEventDefinitions(java.lang.String category, java.lang.String dataShape) throws java.lang.Exception
category
- Category to filter on - STRINGdataShape
- Data shape to filter on if InfoTable base type - DATASHAPENAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEventDefinition(java.lang.String name) throws java.lang.Exception
name
- Name - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetServiceDefinitions(java.lang.String category, java.lang.String type, java.lang.String dataShape) throws java.lang.Exception
category
- Category to filter on - STRINGtype
- Type to filter on - BASETYPENAMEdataShape
- Data shape to filter on if InfoTable base type - DATASHAPENAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetServiceDefinition(java.lang.String name) throws java.lang.Exception
name
- Name - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetMetadata() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetMetadataAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetMetadataWithPermissionsAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetInstanceMetadataAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetInstanceMetadataWithPermissionsAsJSON() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetIncomingDependencies(java.lang.Double maxItems) throws java.lang.Exception
maxItems
- Maximum number of items to return - NUMBERjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetOutgoingDependencies(java.lang.Double maxItems) throws java.lang.Exception
maxItems
- Maximum number of items to return - NUMBERjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetIncomingDependenciesAsNetwork(java.lang.Double maxItems, java.lang.Double maxDepth) throws java.lang.Exception
maxItems
- Maximum number of items to return - NUMBERmaxDepth
- Maximum depth to traverse - NUMBERjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetOutgoingDependenciesAsNetwork(java.lang.Double maxItems, java.lang.Double maxDepth) throws java.lang.Exception
maxItems
- Maximum number of items to return - NUMBERmaxDepth
- Maximum depth to traverse - NUMBERjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean HasIncomingDependencies() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.Boolean HasOutgoingDependencies() throws java.lang.Exception
java.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForCurrentUser(java.lang.String permissionName, java.lang.String name) throws java.lang.Exception
permissionName
- Permission name - STRINGname
- Target name (or wildcard) - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForUser(java.lang.String user, java.lang.String permissionName, java.lang.String name) throws java.lang.Exception
user
- User name - STRINGpermissionName
- Permission name - STRINGname
- Target name (or wildcard) - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForGroup(java.lang.String group, java.lang.String permissionName, java.lang.String name) throws java.lang.Exception
group
- Group name - STRINGpermissionName
- Permission name - STRINGname
- Target name (or wildcard) - STRINGjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public void dispose() throws java.lang.Exception
Removes any remaining references of this entity and disposes any resources that were not cleaned up earlier in the lifecycle. This method is only invoked when the entity is in the process of deletion.
java.lang.Exception
- If an error occurs@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSON() throws java.lang.Exception
java.lang.Exception
- when an error occurs during the construction/population of the JSONObject@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSONDefinition() throws java.lang.Exception
java.lang.Exception
- when an error occurs during the construction/population of the JSONObject@ThingworxExtensionApiMethod(since={6,6}) public void SetProjectName(java.lang.String projectName) throws java.lang.Exception
projectName
- Project name - PROJECTNAMEjava.lang.Exception
- If an error occurs@ThingworxExtensionApiMethod(since={6,6}) public java.lang.String GetProjectName() throws java.lang.Exception
java.lang.Exception
- If an error occurs