Class RootEntity
- All Implemented Interfaces:
IConfigurableObject
,INotScriptFriendly
,ISupportsDeprecation
,IDiffableObject
,IAvatar
,IEntityLifeCycleEvent
,ITaggableObject
,IDependencyScannableObject
,IEntityDefinition
,IPersistableObject<String>
,IDesignTimeSecurable
,IDesignTimeSecurableEntity
,IRunTimeSecurable
,IRunTimeSecurableEntity
,ISecurable
,IVisibilitySecurable
,IVisibilitySecurableEntity
,IAspectContainer
,INamedObject
,Serializable
- Direct Known Subclasses:
ServiceProviderEntity
,Thing
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(ContextType) |
Initializes the entity. Should be used to initialize the state of the entity based on the patch operation. |
Cleanup | cleanupEntity(ContextType) |
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.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyDefinitionCollection
Set of basic properties for any entity.static final Set
<RelationshipTypes.ThingworxRelationshipTypes> Fields inherited from class com.thingworx.types.NamedObject
NAME_COMPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
AddConfigurationTableDefinition
(String name, String description, String category, Integer ordinal, Boolean isHidden, Boolean isMultiRow, String dataShapeName) Deprecated.void
AddConfigurationTableDefinition
(String name, String description, String category, Integer ordinal, Boolean isHidden, Boolean isMultiRow, String dataShapeName, org.json.JSONObject accessModifier) Service Category: Configuration Service Description: Adds a ConfigurationTableDefinition and creates and ConfigurationTable from the definition.void
addDesignTimePermission
(PermissionTypes permissionType, Permission permission) void
AddDesignTimePermission
(String type, String principal, String principalType, Boolean allow) Service Category: Permissions Service Description: Add a design time permission.void
addRunTimePermission
(PermissionTypes permissionType, String resourceName, Permission permission) void
AddRunTimePermission
(String type, String resource, String principal, String principalType, 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
(String principal, String principalType) Service Category: Permissions Service Description: Add a visibility permission.Service Category: Permissions Service Description: Check to see if an entity has a specific design time permission for the current user.CheckDesignTimePermissionForGroup
(String group, String type) Service Category: Permissions Service Description: Check to see if an entity has a specific design time permission for a specific group.CheckDesignTimePermissionForUser
(String user, String type) Service Category: Permissions Service Description: Check to see if an entity has a specific design time permission for a specific user.CheckPermission
(String type, String name) Service Category: Permissions Service Description: Check to see if an entity has a specific run time permission for the current user.CheckPermissionForGroup
(String group, String type, String name) Service Category: Permissions Service Description: Check to see if an entity has a specific run time permission for a specific group.CheckPermissionForUser
(String user, String type, 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
(ContextType contextType) void
DeleteAllConfigurationTableRows
(String tableName, Boolean persistent) Service Category: Configuration Service Description: Delete all rows from a multi-row configuration table.void
DeleteConfigurationTable
(String tableName, Boolean persistent) Service Category: Configuration Service Description: Delete an entire configuration table.void
DeleteConfigurationTableRows
(String tableName, InfoTable values, Boolean persistent) Deprecated.void
DeleteConfigurationTableRows
(String tableName, InfoTable values, Boolean persistent, Boolean removeAllMatchingRows) Service Category: Configuration Service Description: Delete one or more rows from a multi-row configuration table.void
deleteDesignTimePermission
(PermissionTypes permissionType, Permission permission) void
DeleteDesignTimePermission
(String type, String principal, String principalType) Service Category: Permissions Service Description: Delete a design time permission.void
deleteRunTimePermission
(PermissionTypes permissionType, String resourceName, Permission permission) void
DeleteRunTimePermission
(String type, String resource, String principal, String principalType) Service Category: Permissions Service Description: Delete a run time permission.void
deleteVisibilityPermission
(PermissionTypes permissionType, Permission permission) void
DeleteVisibilityPermission
(String principal, String principalType) Service Category: Permissions Service Description: Delete a visibility permission.void
dispose()
Service Category: Metadata Service Description: Get avatar image.byte[]
Service Category: Metadata Service Description: Get avatar image url.Service Category: Editing Service Description: Get the configuration change history.getConfigurationSetting
(String table, String property) getConfigurationTable
(String table) GetConfigurationTable
(String tableName) Service Category: Configuration Service Description: Get a specific configuration table as an InfoTable.GetConfigurationTableDefinition
(String tableName) Service Category: Configuration Service Description: Get a specific configuration table definition as an InfoTable.GetConfigurationTableRow
(String tableName, String key) Service Category: Configuration Service Description: Get a specific configuration table row as an InfoTable.Service Category: Configuration Service Description: Get a list of configuration tables.Service Category: Metadata Service Description: Get the description for an entity.Service Category: Permissions Service Description: Get a list of assigned design time permissions.org.json.JSONObject
Service Category: Permissions Service Description: Get a list of assigned designtime permissions.GetEventDefinition
(String name) Service Category: Metadata Service Description: Get ann event definitions for this thing.GetEventDefinitions
(String category, String dataShape) Service Category: Metadata Service Description: Get the current event definitions for this thing.Service Category: Mashups Service Description: Get home mashup.GetIncomingDependencies
(Double maxItems) Service Category: Dependencies Service Description: Get the incoming dependencies.GetIncomingDependenciesAsNetwork
(Double maxItems, Double maxDepth) Service Category: Dependencies Service Description: Get the incoming dependencies as a network.org.json.JSONObject
Service Category: Metadata Service Description: Get the instance metadata in JSON format.org.json.JSONObject
Service Category: Metadata Service Description: Get the instance metadata in JSON format.org.joda.time.DateTime
Service Category: Editing Service Description: Get the date edit was last modified.Service Category: Metadata Service Description: Get the metadata in InfoTable format.org.json.JSONObject
Service Category: Metadata Service Description: Get the metadata in JSON format.org.json.JSONObject
Service Category: Metadata Service Description: Get the metadata in JSON format.GetOutgoingDependencies
(Double maxItems) Service Category: Dependencies Service Description: Get the outgoing dependencies.GetOutgoingDependenciesAsNetwork
(Double maxItems, Double maxDepth) Service Category: Dependencies Service Description: Get the outgoing dependencies as a network.getOwner()
GetOwner()
Service Category: Permissions Service Description: Get an owner to this entity.GetPermissionsForCurrentUser
(String permissionName, String name) Service Category: Permissions Service Description: Get current user permissions.GetPermissionsForGroup
(String group, String permissionName, String name) Service Category: Permissions Service Description: Get group permissions.GetPermissionsForUser
(String user, String permissionName, String name) Service Category: Permissions Service Description: Get user permissions.Service Category: Projects Service Description: Get the project name of this entity.GetPropertyDefinition
(String name) Service Category: Metadata Service Description: Get the current property definitions for this thing.GetPropertyDefinitions
(String category, String type, String dataShape) Service Category: Metadata Service Description: Get the current property definitions for this thing.Service Category: Permissions Service Description: Get a list of assigned runtime permissions.org.json.JSONObject
Service Category: Permissions Service Description: Get a list of assigned runtime permissions.GetServiceDefinition
(String name) Service Category: Metadata Service Description: Get a service definition for this thing.GetServiceDefinitions
(String category, String type, String dataShape) Service Category: Metadata Service Description: Get the current service definitions for this thing.getStringConfigurationSetting
(String table, String property) getStringConfigurationSettingWithDefault
(String table, String property, String defaultValue) Service Category: Metadata Service Description: Get summary information.getTags()
GetTags()
Service Category: Metadata Service Description: Get the tags for an entity.Service Category: Metadata Service Description: Get the tags for an entity as an InfoTable.Service Category: Permissions Service Description: Get a list of assigned visibility permissions.org.json.JSONObject
Service Category: Permissions Service Description: Get a list of assigned visibility permissions.Service Category: Dependencies Service Description: Has incoming dependencies.Service Category: Dependencies Service Description: Has outgoing dependencies.void
initializeEntity
(ContextType contextType) boolean
boolean
boolean
boolean
IsMultiRowTable
(String tableName) Service Category: Configuration Service Description: Check if a configuration table is a multi-row table.boolean
isOwner
(EntityReference principal) boolean
boolean
boolean
boolean
isVisible
(SecurityContext securityContext) Service Category: Aspects Service Description: Service returns the deprecated references of entity and characteristic, which is used by current entity.void
void
void
void
Pre initialize the entity.void
RemoveTags
(TagCollection tags) Service Category: Metadata Service Description: Remove tags from an entity.void
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
(String table, String property, Object value) void
SetConfigurationTable
(String tableName, InfoTable configurationTable, Boolean persistent) Service Category: Configuration Service Description: Set an entire configuration table.void
SetConfigurationTableRows
(String tableName, InfoTable values, Boolean persistent) Service Category: Configuration Service Description: Update/add one or more rows in a multi-row configuration table.void
SetDescription
(String description) Service Category: Metadata Service Description: Overwrite/set the description for an entity.void
void
SetDesignTimePermissionsAsJSON
(org.json.JSONObject permissions) Service Category: Permissions Service Description: Set a list of assigned design time permissions.void
setDocumentationContent
(String value) void
setExtensionObject
(boolean value) void
SetHomeMashup
(String name) Service Category: Mashups Service Description: Set home mashup.void
setLastModifiedDate
(org.joda.time.DateTime value) void
SetMultiRowConfigurationTable
(String tableName, InfoTable configurationTable, Boolean persistent) Service Category: Configuration Service Description: Set an entire multi-row configuration table.void
setOwner
(EntityReference principal) void
Service Category: Permissions Service Description: Assign an owner to this entity.void
SetProjectName
(String projectName) Service Category: Projects Service Description: Set the project name of this entity.
Sets the name of the project for this entity to be associated with and updates entity's project dependencies by scanning entity's external dependencies.void
void
SetRunTimePermissionsAsJSON
(org.json.JSONObject permissions) Service Category: Permissions Service Description: Set a list of assigned runtime permissions.void
setStringConfigurationSetting
(String table, String property, String value) void
SetTags
(TagCollection tags) Service Category: Metadata Service Description: Overwrite/set the tags for an entity.void
void
SetVisibilityPermissionsAsJSON
(org.json.JSONObject permissions) Service Category: Permissions Service Description: Set a list of assigned visibility permissions.org.json.JSONObject
toJSON()
Deprecated.no replacementorg.json.JSONObject
Deprecated.no replacementvoid
Service Category: Projects Service Description: Updates Project's 'dependends-on Projects' by scanning current entity's external dependencies.
Updates entity's project dependencies by scanning entity's external dependenciesvoid
validateConfiguration
(ImportedEntityCollection importedEntityCollections) Methods inherited from class com.thingworx.persistence.common.PersistableNamedObject
getID, hasID, isTransient
Methods inherited from class com.thingworx.types.NamedObject
getDescription, getName, setDescription, setName, toValueCollection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.thingworx.types.INamedObject
getDescription, getName
Methods inherited from interface com.thingworx.security.permissions.ISecurable
getID, getName
Methods inherited from interface com.thingworx.deprecation.ISupportsDeprecation
getDeprecated, isDeprecated, isDeprecatedBefore, since
-
Field Details
-
BASIC_PROPERTY_DEFINITIONS
Set of basic properties for any entity. -
EXCLUDED_ENTITY_TYPES_IN_PROJECT
public static final Set<RelationshipTypes.ThingworxRelationshipTypes> EXCLUDED_ENTITY_TYPES_IN_PROJECT
-
-
Constructor Details
-
RootEntity
public RootEntity()
-
-
Method Details
-
ListDeprecatedUsage
- Service Category:
- Aspects
- Service Description:
- Service returns the deprecated references of entity and characteristic, which is used by current entity.
- Returns:
- result Deprecated Usage for the entity - INFOTABLE - Aspects {dataShape:DeprecatedUsage}
- Throws:
Exception
- If an error occurs
-
getDesignTimePermissions
@ThingworxExtensionApiMethod(since={6,6}) public DesignTimePermissionCollection getDesignTimePermissions()- Specified by:
getDesignTimePermissions
in interfaceIDesignTimeSecurable
-
setDesignTimePermissions
@ThingworxExtensionApiMethod(since={6,6}) public void setDesignTimePermissions(DesignTimePermissionCollection value) - Specified by:
setDesignTimePermissions
in interfaceIDesignTimeSecurable
-
getVisibilityPermissions
@ThingworxExtensionApiMethod(since={6,6}) public VisibilityPermissionCollection getVisibilityPermissions()- Specified by:
getVisibilityPermissions
in interfaceIVisibilitySecurable
-
setVisibilityPermissions
@ThingworxExtensionApiMethod(since={6,6}) public void setVisibilityPermissions(VisibilityPermissionCollection value) - Specified by:
setVisibilityPermissions
in interfaceIVisibilitySecurable
-
getRunTimePermissions
@ThingworxExtensionApiMethod(since={6,6}) public RunTimePermissionCollection getRunTimePermissions()- Specified by:
getRunTimePermissions
in interfaceIRunTimeSecurable
-
setRunTimePermissions
@ThingworxExtensionApiMethod(since={6,6}) public void setRunTimePermissions(RunTimePermissionCollection value) - Specified by:
setRunTimePermissions
in interfaceIRunTimeSecurable
-
GetOwner
- Service Category:
- Permissions
- Service Description:
- Get an owner to this entity.
- Returns:
- result User name - USERNAME
- Throws:
Exception
- If an error occurs
-
SetOwner
- Service Category:
- Permissions
- Service Description:
- Assign an owner to this entity.
- Parameters:
name
- User name - USERNAME- Throws:
Exception
- If an error occurs
-
AddRunTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void AddRunTimePermission(String type, String resource, String principal, String principalType, Boolean allow) throws Exception - Service Category:
- Permissions
- Service Description:
- Add a run time permission.
- Parameters:
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) - BOOLEAN- Throws:
Exception
- If an error occurs
Additional Information The user that calls this service must have service invoke permissions on the entity that they are adding the run time permission to. For example, If UserA doesn't have ServiceInvoke permission on ThingA, then it won't be able to call the AddRunTimePermission service on the thing.
-
DeleteRunTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteRunTimePermission(String type, String resource, String principal, String principalType) throws Exception - Service Category:
- Permissions
- Service Description:
- Delete a run time permission.
- Parameters:
type
- Permission type - STRINGresource
- Resource name - STRINGprincipal
- Principal name (name of user or group) - STRINGprincipalType
- Principal type (User or Group) - STRING- Throws:
Exception
- If an error occurs
-
addRunTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void addRunTimePermission(PermissionTypes permissionType, String resourceName, Permission permission) throws Exception - Specified by:
addRunTimePermission
in interfaceIRunTimeSecurable
- Throws:
Exception
- If an error occurs
-
deleteRunTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void deleteRunTimePermission(PermissionTypes permissionType, String resourceName, Permission permission) throws Exception - Specified by:
deleteRunTimePermission
in interfaceIRunTimeSecurable
- Throws:
Exception
- If an error occurs
-
GetRunTimePermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetRunTimePermissionsAsJSON() throws Exception- Service Category:
- Permissions
- Service Description:
- Get a list of assigned runtime permissions.
- Returns:
- result Permission list - JSON
- Throws:
Exception
- If an error occurs
-
SetRunTimePermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public void SetRunTimePermissionsAsJSON(org.json.JSONObject permissions) throws Exception - Service Category:
- Permissions
- Service Description:
- Set a list of assigned runtime permissions.
- Parameters:
permissions
- Permissions in JSON format - JSON- Throws:
Exception
- If an error occurs
-
GetRunTimePermissions
- Service Category:
- Permissions
- Service Description:
- Get a list of assigned runtime permissions.
- Returns:
- result Permission list - INFOTABLE - Aspects {dataShape:Permissions}
- Throws:
Exception
- If an error occurs
-
AddDesignTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void AddDesignTimePermission(String type, String principal, String principalType, Boolean allow) throws Exception - Service Category:
- Permissions
- Service Description:
- Add a design time permission.
- Parameters:
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) - BOOLEAN- Throws:
Exception
- If an error occurs
Additional Information If a value is not passed for the allow parameter, the default permission will be set to true.
-
DeleteDesignTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteDesignTimePermission(String type, String principal, String principalType) throws Exception - Service Category:
- Permissions
- Service Description:
- Delete a design time permission.
- Parameters:
type
- Permission type - STRINGprincipal
- Principal name (name of user or group) - STRINGprincipalType
- Principal type (User or Group) - STRING- Throws:
Exception
- If an error occurs
-
GetDesignTimePermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetDesignTimePermissionsAsJSON() throws Exception- Service Category:
- Permissions
- Service Description:
- Get a list of assigned designtime permissions.
- Returns:
- result Permission list - JSON
- Throws:
Exception
- If an error occurs
-
SetDesignTimePermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public void SetDesignTimePermissionsAsJSON(org.json.JSONObject permissions) throws Exception - Service Category:
- Permissions
- Service Description:
- Set a list of assigned design time permissions.
- Parameters:
permissions
- Permissions in JSON format - JSON- Throws:
Exception
- If an error occurs
-
GetDesignTimePermissions
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetDesignTimePermissions() throws Exception- Service Category:
- Permissions
- Service Description:
- Get a list of assigned design time permissions.
- Returns:
- result Permission list - INFOTABLE - Aspects {dataShape:Permissions}
- Throws:
Exception
- If an error occurs
-
AddVisibilityPermission
@ThingworxExtensionApiMethod(since={6,6}) public void AddVisibilityPermission(String principal, String principalType) throws Exception - Service Category:
- Permissions
- Service Description:
- Add a visibility permission.
- Parameters:
principal
- Principal name (name of organization or organization unit) - STRINGprincipalType
- Principal type (Organization or Organization Unit) - STRING- Throws:
Exception
- If an error occurs
Additional Information- For the principal input, the name of the organization must be followed by a colon and the organizational unit name. For example, for an organization unit named Test_OrganizationUnit that is derived from an organization named TestOrganization, specify the principal input as follows: Test_Organization:Test_OrganizationalUnit
- The top-most level of an organization (the organizational unit with the same name as the organization entity) can also be set as the principal input using the convention above (the principaltype must be set to OrganizationalUnit instead of Organization. For example, Test_Organization:Test_Organization
- The permission applies only to members of the top-most level of the organization, as the permission does not flow down to all organizational units.
- To add the permission to the entire organization and its organization units, the principalType parameter must be specified
as Organization and the name of the organization in the principal parameter.
-
DeleteVisibilityPermission
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteVisibilityPermission(String principal, String principalType) throws Exception - Service Category:
- Permissions
- Service Description:
- Delete a visibility permission.
- Parameters:
principal
- Principal name (name of organization or organization unit) - STRINGprincipalType
- Principal type (Organization or Organization Unit) - STRING- Throws:
Exception
- If an error occurs
-
GetVisibilityPermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetVisibilityPermissionsAsJSON() throws Exception- Service Category:
- Permissions
- Service Description:
- Get a list of assigned visibility permissions.
- Returns:
- result Permission list - JSON
- Throws:
Exception
- If an error occurs
-
SetVisibilityPermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public void SetVisibilityPermissionsAsJSON(org.json.JSONObject permissions) throws Exception - Service Category:
- Permissions
- Service Description:
- Set a list of assigned visibility permissions.
- Parameters:
permissions
- Permissions in JSON format - JSON- Throws:
Exception
- If an error occurs
-
GetVisibilityPermissions
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetVisibilityPermissions() throws Exception- Service Category:
- Permissions
- Service Description:
- Get a list of assigned visibility permissions.
- Returns:
- result Permission list - INFOTABLE - Aspects {dataShape:Permissions}
- Throws:
Exception
- If an error occurs
-
CheckPermission
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckPermission(String type, String name) throws Exception - Service Category:
- Permissions
- Service Description:
- Check to see if an entity has a specific run time permission for the current user.
- Parameters:
type
- Permission type - STRINGname
- Name of the resource (i.e. property, service, event) to check - STRING- Returns:
- result True/false based on if the user has the specified permission - BOOLEAN
- Throws:
Exception
- If an error occurs
Additional InformationThe valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, ServiceInvoke
.
-
CheckPermissionForUser
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckPermissionForUser(String user, String type, String name) throws Exception - Service Category:
- Permissions
- Service Description:
- Check to see if an entity has a specific run time permission for a specific user.
- Parameters:
user
- User name - USERNAMEtype
- Permission type - STRINGname
- Name of the resource (i.e. property, service, event) to check - STRING- Returns:
- result True/false based on if the user has the specified permission - BOOLEAN
- Throws:
Exception
- If an error occurs
Additional InformationThe valid inputs for the type parameter are (case sensitive): PropertyRead, PropertyWrite, EventSubscribe , EventInvoke, and ServiceInvoke
.
-
CheckPermissionForGroup
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckPermissionForGroup(String group, String type, String name) throws Exception - Service Category:
- Permissions
- Service Description:
- Check to see if an entity has a specific run time permission for a specific group.
- Parameters:
group
- Group name - GROUPNAMEtype
- Permission type - STRINGname
- Name of the resource (i.e. property, service, event) to check - STRING- Returns:
- result True/false based on if the group has the specified permission - BOOLEAN
- Throws:
Exception
- If an error occurs
Additional InformationThe 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).
-
CheckDesignTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckDesignTimePermission(String type) throws Exception - Service Category:
- Permissions
- Service Description:
- Check to see if an entity has a specific design time permission for the current user.
- Parameters:
type
- Permission type - STRING- Returns:
- result True/false based on if the user has the specified permission - BOOLEAN
- Throws:
Exception
- If an error occurs
Additional InformationThe 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.
-
CheckDesignTimePermissionForUser
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckDesignTimePermissionForUser(String user, String type) throws Exception - Service Category:
- Permissions
- Service Description:
- Check to see if an entity has a specific design time permission for a specific user.
- Parameters:
user
- User name - USERNAMEtype
- Permission type - STRING- Returns:
- result True/false based on if the user has the specified permission - BOOLEAN
- Throws:
Exception
- If an error occurs
Additional InformationThe 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.
-
CheckDesignTimePermissionForGroup
@ThingworxExtensionApiMethod(since={6,6}) public Boolean CheckDesignTimePermissionForGroup(String group, String type) throws Exception - Service Category:
- Permissions
- Service Description:
- Check to see if an entity has a specific design time permission for a specific group.
- Parameters:
group
- Group name - GROUPNAMEtype
- Permission type - STRING- Returns:
- result True/false based on if the group has the specified permission - BOOLEAN
- Throws:
Exception
- If an error occurs
Additional InformationThe 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.
-
isVisible
-
isVisible
-
validateConfiguration
@ThingworxExtensionApiMethod(since={6,6}) public void validateConfiguration(ImportedEntityCollection importedEntityCollections) throws 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 callsuper.validateConfiguration(importedEntityCollections)
if they override this method.- Parameters:
importedEntityCollections
- - a typed collection of entities currently being imported- Throws:
Exception
- if the entity is invalid
-
getEntityTypeAsString
-
getEntityType
@ThingworxExtensionApiMethod(since={6,6}) public abstract RelationshipTypes.ThingworxRelationshipTypes getEntityType()
Returns the type of this entity.
- Returns:
- the entity type
-
setLastModifiedDate
@ThingworxExtensionApiMethod(since={6,6}) public void setLastModifiedDate(org.joda.time.DateTime value) -
GetLastModifiedDate
- Service Category:
- Editing
- Service Description:
- Get the date edit was last modified.
- Returns:
- lastModifiedDate Last modified date - DATETIME
-
isEditable
-
isSystemObject
-
isEditableSystemObject
-
isEditableExtensionObject
-
isThemeObject
-
isExtensionObject
-
setExtensionObject
-
getAspects
- Returns:
- The entity aspect collection.
-
preInitializeEntity
@ThingworxExtensionApiMethod(since={6,6}, canOverride=true) public void preInitializeEntity() throws Exception
Pre initialize the entity.- Throws:
Exception
- if an error occurs during the pre-initialization process
-
initializeEntity
@ThingworxExtensionApiMethod(since={9,0}, canOverride=true) public void initializeEntity(ContextType contextType) throws 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.
- Parameters:
contextType
- the patch operation- Throws:
Exception
- if an error occurs during the initialization process
-
cleanupEntity
@ThingworxExtensionApiMethod(since={9,0}, canOverride=true) public void cleanupEntity(ContextType contextType) throws 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.
- Parameters:
contextType
- model synchronization patch operation- Throws:
Exception
- if an error occurs during the cleanup process
-
addDesignTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void addDesignTimePermission(PermissionTypes permissionType, Permission permission) throws Exception - Specified by:
addDesignTimePermission
in interfaceIDesignTimeSecurable
- Throws:
Exception
- If an error occurs
-
deleteDesignTimePermission
@ThingworxExtensionApiMethod(since={6,6}) public void deleteDesignTimePermission(PermissionTypes permissionType, Permission permission) throws Exception - Specified by:
deleteDesignTimePermission
in interfaceIDesignTimeSecurable
- Throws:
Exception
- If an error occurs
-
persistRunTimePermissions
- Specified by:
persistRunTimePermissions
in interfaceIRunTimeSecurable
- Throws:
Exception
- If an error occurs
-
persistDesignTimePermissions
@ThingworxExtensionApiMethod(since={6,6}) public void persistDesignTimePermissions() throws Exception- Specified by:
persistDesignTimePermissions
in interfaceIDesignTimeSecurable
- Throws:
Exception
- If an error occurs
-
persistVisibilityPermissions
@ThingworxExtensionApiMethod(since={6,6}) public void persistVisibilityPermissions() throws Exception- Specified by:
persistVisibilityPermissions
in interfaceIVisibilitySecurable
- Throws:
Exception
- If an error occurs
-
addVisibilityPermission
@ThingworxExtensionApiMethod(since={6,6}) public void addVisibilityPermission(PermissionTypes permissionType, Permission permission) throws Exception - Specified by:
addVisibilityPermission
in interfaceIVisibilitySecurable
- Throws:
Exception
- If an error occurs
-
deleteVisibilityPermission
@ThingworxExtensionApiMethod(since={6,6}) public void deleteVisibilityPermission(PermissionTypes permissionType, Permission permission) throws Exception - Specified by:
deleteVisibilityPermission
in interfaceIVisibilitySecurable
- Throws:
Exception
- If an error occurs
-
GetConfigurationChangeHistory
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationChangeHistory() throws Exception- Service Category:
- Editing
- Service Description:
- Get the configuration change history.
- Returns:
- result Configuration changes - INFOTABLE - Aspects {dataShape:ConfigurationChange}
- Throws:
Exception
- If an error occurs
Additional InformationThis service is not specific to configuration tables. Any create or update to an entity is listed in the change history.
-
isOwner
- Specified by:
isOwner
in interfaceISecurable
-
setOwner
-
getOwner
- Specified by:
getOwner
in interfaceISecurable
-
getTags
- Specified by:
getTags
in interfaceITaggableObject
-
getDocumentationContent
-
setDocumentationContent
-
GetSummaryInformation
- Service Category:
- Metadata
- Service Description:
- Get summary information.
- Returns:
- Summary Summary information - INFOTABLE - Aspects {dataShape:EntitySummary}
- Throws:
Exception
- If an error occurs
-
GetDescription
- Service Category:
- Metadata
- Service Description:
- Get the description for an entity.
- Returns:
- description description - STRING
-
SetDescription
@ThingworxExtensionApiMethod(since={6,6}) public void SetDescription(String description) throws Exception - Service Category:
- Metadata
- Service Description:
- Overwrite/set the description for an entity.
- Parameters:
description
- Description for an entity - STRING- Throws:
Exception
- If an error occurs
-
GetTags
- Service Category:
- Metadata
- Service Description:
- Get the tags for an entity.
- Returns:
- tags tags - TAGS - Aspects {tagType:ModelTags}
-
SetTags
- Service Category:
- Metadata
- Service Description:
- Overwrite/set the tags for an entity.
- Parameters:
tags
- Tags for an entity - TAGS- Throws:
Exception
- If an error occurs
-
GetTagsAsInfoTable
- Service Category:
- Metadata
- Service Description:
- Get the tags for an entity as an InfoTable.
- Returns:
- tags tags - INFOTABLE - Aspects {dataShape:VocabularyTermList}
- Throws:
Exception
- If an error occurs
-
AddTags
- Service Category:
- Metadata
- Service Description:
- Append additional tags to an entity.
- Parameters:
tags
- Tags for an entity - TAGS- Throws:
Exception
- If an error occurs
Additional Information AddTags can be used to append new tags to an entity with existing tags. Tags are not overwritten. Use the SetTags service to overwrite existing tags.
-
RemoveTags
@ThingworxExtensionApiMethod(since={6,6}) public void RemoveTags(TagCollection tags) throws Exception - Service Category:
- Metadata
- Service Description:
- Remove tags from an entity.
- Parameters:
tags
- Tags to remove from the entity - TAGS- Throws:
Exception
- If an error occurs
-
GetHomeMashup
- Service Category:
- Mashups
- Service Description:
- Get home mashup.
- Returns:
- HomeMashup Home mashup - MASHUPNAME
-
SetHomeMashup
- Service Category:
- Mashups
- Service Description:
- Set home mashup.
- Parameters:
name
- Home mashup name - MASHUPNAME- Throws:
Exception
- If an error occurs
-
GetAvatar
- Service Category:
- Metadata
- Service Description:
- Get avatar image.
-
GetAvatarURL
- Service Category:
- Metadata
- Service Description:
- Get avatar image url.
- Returns:
- result Entity avatar URL - IMAGELINK
Additional InformationReturns a URL for an avatar. Example:
/Thingworx/Things/ThingName/Avatar
-
SetAvatar
- Service Category:
- Metadata
- Service Description:
- Set the avatar icon for the entity.
-
getAvatarContent
- Specified by:
getAvatarContent
in interfaceIAvatar
- Throws:
Exception
- If an error occurs
-
getConfigurationTable
@ThingworxExtensionApiMethod(since={6,6}) public ConfigurationTable getConfigurationTable(String table) throws Exception - Throws:
Exception
- If an error occurs
-
getConfigurationSetting
@ThingworxExtensionApiMethod(since={6,6}) public Object getConfigurationSetting(String table, String property) -
getStringConfigurationSetting
@ThingworxExtensionApiMethod(since={6,6}) public String getStringConfigurationSetting(String table, String property) -
getStringConfigurationSettingWithDefault
-
setConfigurationSetting
@ThingworxExtensionApiMethod(since={6,6}) public void setConfigurationSetting(String table, String property, Object value) throws Exception - Throws:
Exception
- If an error occurs
-
setStringConfigurationSetting
@ThingworxExtensionApiMethod(since={6,6}) public void setStringConfigurationSetting(String table, String property, String value) throws Exception - Throws:
Exception
- If an error occurs
-
AddConfigurationTableDefinition
@ThingworxExtensionApiMethod(since={8,3}, deprecatedSince={9,4}) @Deprecated public void AddConfigurationTableDefinition(String name, String description, String category, Integer ordinal, Boolean isHidden, Boolean isMultiRow, String dataShapeName) throws Exception Deprecated.- Throws:
Exception
- If an error occurs
-
AddConfigurationTableDefinition
@ThingworxExtensionApiMethod(since={9,4}) public void AddConfigurationTableDefinition(String name, String description, String category, Integer ordinal, Boolean isHidden, Boolean isMultiRow, String dataShapeName, org.json.JSONObject accessModifier) throws Exception - Service Category:
- Configuration
- Service Description:
- Adds a ConfigurationTableDefinition and creates and ConfigurationTable from the definition.
- Parameters:
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. - DATASHAPENAMEaccessModifier
- AccessModifier for configuration table - JSON- Throws:
Exception
- If an error occurs
-
GetConfigurationTableDefinition
@ThingworxExtensionApiMethod(since={8,3}) public InfoTable GetConfigurationTableDefinition(String tableName) throws Exception - Service Category:
- Configuration
- Service Description:
- Get a specific configuration table definition as an InfoTable.
- Parameters:
tableName
- Configuration table name - STRING- Returns:
- result Configuration Table Definition - INFOTABLE
- Throws:
Exception
- If an error occurs
-
GetConfigurationTables
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTables() throws Exception- Service Category:
- Configuration
- Service Description:
- Get a list of configuration tables.
- Returns:
- result Configuration Tables - INFOTABLE - Aspects {dataShape:EntityList}
- Throws:
Exception
- If an error occurs
Additional InformationThis service can be used for single or multi-row configuration tables.
-
GetConfigurationTable
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTable(String tableName) throws Exception - Service Category:
- Configuration
- Service Description:
- Get a specific configuration table as an InfoTable.
- Parameters:
tableName
- Configuration table name - STRING- Returns:
- table table - INFOTABLE
- Throws:
Exception
- If an error occurs
Additional InformationThis service can be used for single or multi-row configuration tables.
-
GetConfigurationTableRow
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetConfigurationTableRow(String tableName, String key) throws Exception - Service Category:
- Configuration
- Service Description:
- Get a specific configuration table row as an InfoTable.
- Parameters:
tableName
- Configuration table name - STRINGkey
- Row key value - STRING- Returns:
- table table - INFOTABLE
- Throws:
Exception
- If an error occurs
Additional InformationThis 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.
-
IsMultiRowTable
@ThingworxExtensionApiMethod(since={6,6}) public Boolean IsMultiRowTable(String tableName) throws Exception - Service Category:
- Configuration
- Service Description:
- Check if a configuration table is a multi-row table.
- Parameters:
tableName
- Configuration table name - STRING- Returns:
- result Flag if table is multi-row or not - BOOLEAN
- Throws:
Exception
- If an error occurs
-
SetConfigurationTable
@ThingworxExtensionApiMethod(since={6,6}) public void SetConfigurationTable(String tableName, InfoTable configurationTable, Boolean persistent) throws Exception - Service Category:
- Configuration
- Service Description:
- Set an entire configuration table.
- Parameters:
tableName
- Configuration table name - STRINGconfigurationTable
- Configuration table content - INFOTABLEpersistent
- Persist these changes - BOOLEAN- Throws:
Exception
- If an error occurs
-
SetMultiRowConfigurationTable
@ThingworxExtensionApiMethod(since={6,6}) public void SetMultiRowConfigurationTable(String tableName, InfoTable configurationTable, Boolean persistent) throws Exception - Service Category:
- Configuration
- Service Description:
- Set an entire multi-row configuration table.
- Parameters:
tableName
- Configuration table name - STRINGconfigurationTable
- Configuration table content - INFOTABLEpersistent
- Persist these changes - BOOLEAN- Throws:
Exception
- If an error occurs
-
SetConfigurationTableRows
@ThingworxExtensionApiMethod(since={6,6}) public void SetConfigurationTableRows(String tableName, InfoTable values, Boolean persistent) throws Exception - Service Category:
- Configuration
- Service Description:
- Update/add one or more rows in a multi-row configuration table.
- Parameters:
tableName
- Configuration table name - STRINGvalues
- Configuration table rows to modify - INFOTABLEpersistent
- Persist these changes - BOOLEAN- Throws:
Exception
- If an error occurs
-
DeleteConfigurationTable
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteConfigurationTable(String tableName, Boolean persistent) throws Exception - Service Category:
- Configuration
- Service Description:
- Delete an entire configuration table.
- Parameters:
tableName
- Configuration table name - STRINGpersistent
- Persist these changes - BOOLEAN- Throws:
Exception
- If an error occurs
-
DeleteConfigurationTableRows
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={9,6}) public void DeleteConfigurationTableRows(String tableName, InfoTable values, Boolean persistent) throws Exception Deprecated.- Throws:
Exception
- If an error occurs
-
DeleteConfigurationTableRows
@ThingworxExtensionApiMethod(since={9,6}) public void DeleteConfigurationTableRows(String tableName, InfoTable values, Boolean persistent, Boolean removeAllMatchingRows) throws Exception - Service Category:
- Configuration
- Service Description:
- Delete one or more rows from a multi-row configuration table.
- Parameters:
tableName
- Configuration table name - STRINGvalues
- Configuration table rows to modify - INFOTABLEpersistent
- Persist these changes - BOOLEANremoveAllMatchingRows
- It will remove all matching rows if value is true - BOOLEAN- Throws:
Exception
- If an error occurs
-
DeleteAllConfigurationTableRows
@ThingworxExtensionApiMethod(since={6,6}) public void DeleteAllConfigurationTableRows(String tableName, Boolean persistent) throws Exception - Service Category:
- Configuration
- Service Description:
- Delete all rows from a multi-row configuration table.
- Parameters:
tableName
- Configuration table name - STRINGpersistent
- Persist these changes - BOOLEAN- Throws:
Exception
- If an error occurs
Additional InformationIf 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).
-
SaveConfigurationTables
- Service Category:
- Configuration
- Service Description:
- Save any changes to configuration tables.
- Throws:
Exception
- If an error occurs
-
GetPropertyDefinitions
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPropertyDefinitions(String category, String type, String dataShape) throws Exception - Service Category:
- Metadata
- Service Description:
- Get the current property definitions for this thing.
- Parameters:
category
- Category to filter on - STRINGtype
- Type to filter on - BASETYPENAMEdataShape
- Data shape to filter on if InfoTable base type - DATASHAPENAME- Returns:
- result Property definitions - INFOTABLE - Aspects {dataShape:PropertyDefinition}
- Throws:
Exception
- If an error occurs
-
GetPropertyDefinition
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPropertyDefinition(String name) throws Exception - Service Category:
- Metadata
- Service Description:
- Get the current property definitions for this thing.
- Parameters:
name
- Name - STRING- Returns:
- result Property definition - INFOTABLE - Aspects {dataShape:PropertyDefinition}
- Throws:
Exception
- If an error occurs
-
GetEventDefinitions
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEventDefinitions(String category, String dataShape) throws Exception - Service Category:
- Metadata
- Service Description:
- Get the current event definitions for this thing.
- Parameters:
category
- Category to filter on - STRINGdataShape
- Data shape to filter on if InfoTable base type - DATASHAPENAME- Returns:
- result Event definitions - INFOTABLE - Aspects {dataShape:EventDefinition}
- Throws:
Exception
- If an error occurs
-
GetEventDefinition
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetEventDefinition(String name) throws Exception - Service Category:
- Metadata
- Service Description:
- Get ann event definitions for this thing.
- Parameters:
name
- Name - STRING- Returns:
- result Event definition - INFOTABLE - Aspects {dataShape:EventDefinition}
- Throws:
Exception
- If an error occurs
-
GetServiceDefinitions
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetServiceDefinitions(String category, String type, String dataShape) throws Exception - Service Category:
- Metadata
- Service Description:
- Get the current service definitions for this thing.
- Parameters:
category
- Category to filter on - STRINGtype
- Type to filter on - BASETYPENAMEdataShape
- Data shape to filter on if InfoTable base type - DATASHAPENAME- Returns:
- result Service definitions - INFOTABLE - Aspects {dataShape:ServiceDefinition}
- Throws:
Exception
- If an error occurs
-
GetServiceDefinition
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetServiceDefinition(String name) throws Exception - Service Category:
- Metadata
- Service Description:
- Get a service definition for this thing.
- Parameters:
name
- Name - STRING- Returns:
- result Service definition - INFOTABLE - Aspects {dataShape:ServiceDefinition}
- Throws:
Exception
- If an error occurs
-
GetMetadata
- Service Category:
- Metadata
- Service Description:
- Get the metadata in InfoTable format.
- Returns:
- result metadata - INFOTABLE
- Throws:
Exception
- If an error occurs
-
GetMetadataAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetMetadataAsJSON() throws Exception- Service Category:
- Metadata
- Service Description:
- Get the metadata in JSON format.
- Returns:
- result metadata - JSON
- Throws:
Exception
- If an error occurs
-
GetMetadataWithPermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetMetadataWithPermissionsAsJSON() throws Exception- Service Category:
- Metadata
- Service Description:
- Get the metadata in JSON format.
- Returns:
- result metadata - JSON
- Throws:
Exception
- If an error occurs
-
GetInstanceMetadataAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetInstanceMetadataAsJSON() throws Exception- Service Category:
- Metadata
- Service Description:
- Get the instance metadata in JSON format.
- Returns:
- result Instance metadata - JSON
- Throws:
Exception
- If an error occurs
-
GetInstanceMetadataWithPermissionsAsJSON
@ThingworxExtensionApiMethod(since={6,6}) public org.json.JSONObject GetInstanceMetadataWithPermissionsAsJSON() throws Exception- Service Category:
- Metadata
- Service Description:
- Get the instance metadata in JSON format.
- Returns:
- result Instance metadata - JSON
- Throws:
Exception
- If an error occurs
-
GetIncomingDependencies
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetIncomingDependencies(Double maxItems) throws Exception - Service Category:
- Dependencies
- Service Description:
- Get the incoming dependencies.
- Parameters:
maxItems
- Maximum number of items to return - NUMBER- Returns:
- result Related entities - INFOTABLE - Aspects {dataShape:EntityDescriptor}
- Throws:
Exception
- If an error occurs
-
GetOutgoingDependencies
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetOutgoingDependencies(Double maxItems) throws Exception - Service Category:
- Dependencies
- Service Description:
- Get the outgoing dependencies.
- Parameters:
maxItems
- Maximum number of items to return - NUMBER- Returns:
- result Related entities - INFOTABLE - Aspects {dataShape:EntityDescriptor}
- Throws:
Exception
- If an error occurs
-
GetIncomingDependenciesAsNetwork
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetIncomingDependenciesAsNetwork(Double maxItems, Double maxDepth) throws Exception - Service Category:
- Dependencies
- Service Description:
- Get the incoming dependencies as a network.
- Parameters:
maxItems
- Maximum number of items to return - NUMBERmaxDepth
- Maximum depth to traverse - NUMBER- Returns:
- result Related entities - INFOTABLE - Aspects {dataShape:EntityNetwork}
- Throws:
Exception
- If an error occurs
-
GetOutgoingDependenciesAsNetwork
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetOutgoingDependenciesAsNetwork(Double maxItems, Double maxDepth) throws Exception - Service Category:
- Dependencies
- Service Description:
- Get the outgoing dependencies as a network.
- Parameters:
maxItems
- Maximum number of items to return - NUMBERmaxDepth
- Maximum depth to traverse - NUMBER- Returns:
- result Related entities - INFOTABLE - Aspects {dataShape:EntityNetwork}
- Throws:
Exception
- If an error occurs
-
HasIncomingDependencies
- Service Category:
- Dependencies
- Service Description:
- Has incoming dependencies.
- Returns:
- result Has dependencies - BOOLEAN
- Throws:
Exception
- If an error occurs
-
HasOutgoingDependencies
- Service Category:
- Dependencies
- Service Description:
- Has outgoing dependencies.
- Returns:
- result Has dependencies - BOOLEAN
- Throws:
Exception
- If an error occurs
-
GetPermissionsForCurrentUser
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForCurrentUser(String permissionName, String name) throws Exception - Service Category:
- Permissions
- Service Description:
- Get current user permissions.
- Parameters:
permissionName
- Permission name - STRINGname
- Target name (or wildcard) - STRING- Returns:
- result Permissions - INFOTABLE - Aspects {dataShape:UserPermissions}
- Throws:
Exception
- If an error occurs
-
GetPermissionsForUser
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForUser(String user, String permissionName, String name) throws Exception - Service Category:
- Permissions
- Service Description:
- Get user permissions.
- Parameters:
user
- User name - STRINGpermissionName
- Permission name - STRINGname
- Target name (or wildcard) - STRING- Returns:
- result Permissions - INFOTABLE - Aspects {dataShape:UserPermissions}
- Throws:
Exception
- If an error occurs
-
GetPermissionsForGroup
@ThingworxExtensionApiMethod(since={6,6}) public InfoTable GetPermissionsForGroup(String group, String permissionName, String name) throws Exception - Service Category:
- Permissions
- Service Description:
- Get group permissions.
- Parameters:
group
- Group name - STRINGpermissionName
- Permission name - STRINGname
- Target name (or wildcard) - STRING- Returns:
- result Permissions - INFOTABLE - Aspects {dataShape:UserPermissions}
- Throws:
Exception
- If an error occurs
-
dispose
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.
- Throws:
Exception
- If an error occurs
-
toJSON
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSON() throws ExceptionDeprecated.no replacement
Returns the state of the entity as JSONObject.- Returns:
- the entity as JSONObject
- Throws:
Exception
- when an error occurs during the construction/population of the JSONObject
-
toJSONDefinition
@Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,4}) public org.json.JSONObject toJSONDefinition() throws ExceptionDeprecated.no replacement
Returns the definition state of the entity as JSONObject.- Returns:
- the entity as JSONObject
- Throws:
Exception
- when an error occurs during the construction/population of the JSONObject
-
SetProjectName
@ThingworxExtensionApiMethod(since={6,6}) public void SetProjectName(String projectName) throws Exception - Service Category:
- Projects
- Service Description:
- Set the project name of this entity.
Sets the name of the project for this entity to be associated with and updates entity's project dependencies by scanning entity's external dependencies. The name of project must be a valid, existing Project. If a project name is supplied that is not valid, an Exception will be thrown. For an editable extension entity a valid project can be the one that exists in same extension or any non extension project type entity that exists on platform. The only restriction(Invalid) project is the project belonging to different extension and projects that don't exist on platform.- Parameters:
projectName
- - The name of the project to associate this entity to.- Throws:
Exception
- - If the specified Project does not exist or you do not have permissions to view it or if there is a problem updating the database.
-
UpdateProjectDependencies
- Service Category:
- Projects
- Service Description:
- Updates Project's 'dependends-on Projects' by scanning current entity's external dependencies.
Updates entity's project dependencies by scanning entity's external dependencies- Throws:
Exception
-
GetProjectName
- Service Category:
- Projects
- Service Description:
- Get the project name of this entity.
- Returns:
- result The project name of this entity - STRING
- Throws:
Exception
- If an error occurs
-