API Doc svyProperties

Classes

Property

Functions

changeExternalDBTransactionSupportFlag(mustSupportExternalTransactions)

Use this method to change the behavior of the svyProperties module with respect to DB transactions.

If the flag is set to false (default) then when saving or deleting security-related records if an external DB transaction is detected the operation will fail. If the flag is set to true then when saving or deleting security-related records the module will start/commit a DB transaction only if an external DB transaction is not detected. On exceptions any DB transaction will be rolled back regardless if it is started internally or externally (exceptions will be propagated to the external transaction so callers will be able to react on them accordingly)

deleteProperty(property)Boolean

Immediately and permanently deletes the specified property.

getGlobalProperty(propertyKey, propertyType)Property

Returns the global property with the given key and type Global properties are properties where the tenant and user name is not set

getGlobalPropertyValue(propertyKey, propertyType)String

Returns the value of the global property with the given key and type Global properties are properties where the tenant and user name is not set

getProperties(propertyKey, [propertyType], [tenantName], [userName])[ 'Array' ].<Property>

Returns all properties with the given key and type, optional tenant and user name\

If tenantName is not provided, it will not be queried; if a null value is provided, only global properties are returned If userName is not provided, it will not be queried; if a null value is provided, only tenant wide properties are returned\

getPropertiesByType(propertyType, [tenantName], [userName])[ 'Array' ].<Property>

Returns all properties of the given type, optional tenant and user name\

If tenantName is not provided, it will not be queried; if a null value is provided, only global properties are returned If userName is not provided, it will not be queried; if a null value is provided, only tenant wide properties are returned\

getProperty(propertyKey, propertyType, [tenantName], [userName])Property

Returns the property with the given key and type or null if not found All parameters given need to match exactly

getTenantProperty(propertyKey, propertyType)Property

Returns the tenant wide property with the given key and type for the tenant set via setUserName() Tenant wide properties are properties where the user name is not set

getTenantPropertyValue(propertyKey, propertyType)String

Returns the value of the tenant wide property with the given key and type for the tenant set via setUserName() Tenant wide properties are properties where the user name is not set

getUserProperty(propertyKey, propertyType)Property

Returns the property with the given key and type for the user set via setUserName()

getUserPropertyValue(propertyKey, propertyType)String

Returns the value of the property with the given key and type for the user set via setUserName()

getVersion()String

Gets the version of this module

setGlobalProperty(propertyKey, propertyType, value)Property

Sets the given value to the global property with the given key and type or creates a new property if not found Global properties are properties where the tenant and user name is not set

setProperty(propertyKey, propertyType, value, userName, tenantName)Property

Sets the given value to the property with the given key and type or creates a new property if not found

setTenantProperty(propertyKey, propertyType, value)Property

Sets the given value to the tenant wide property with the given key and type or creates a new property if not found Tenant wide properties are properties where the user name is not set

setUserName(userName, [tenantName])

Sets the user and tenant name for the logged in user Both are used in all convenience methods to get or set properties for the user or the tenant When svySecurity is used, this is called automatically after login

setUserProperty(propertyKey, propertyType, value)Property

Sets the given value to the user property with the given key and type or creates a new property if not found

Property


property.deleteProperty() ⇒ Boolean

Immediately and permanently deletes this property.

Returns: Boolean - true if property could be deleted

Note: USE WITH CAUTION! There is no undo for this operation.


property.getDisplayName() ⇒ String

Gets the display name for this property.

Returns: String - The property value of this property. Can be null if a display name is not set.


property.getPropertyUUID() ⇒ UUID

Gets the property uuid for this property.

Returns: UUID - The property uuid of this property.


property.getPropertyValue() ⇒ String

Gets the property value for this property.

Returns: String - The property value of this property. Can be null if a property value is not set.


property.getTenantName() ⇒ String

Gets the tenant name for this property.

Returns: String - The property value of this property. Can be null if a display name is not set.


property.getUserName() ⇒ String

Gets the user name for this property.

Returns: String - The property value of this property. Can be null if a display name is not set.


property.setDisplayName() ⇒ Property

Sets the property display name for this property.

Returns: Property - The property uuid of this property.


property.setPropertyValue(propertyValue) ⇒ Property

Sets the property value for this property.

Returns: Property - This property for call-chaining support.


new Property(record)


changeExternalDBTransactionSupportFlag(mustSupportExternalTransactions)

Use this method to change the behavior of the svyProperties module with respect to DB transactions.

If the flag is set to false (default) then when saving or deleting security-related records if an external DB transaction is detected the operation will fail. If the flag is set to true then when saving or deleting security-related records the module will start/commit a DB transaction only if an external DB transaction is not detected. On exceptions any DB transaction will be rolled back regardless if it is started internally or externally (exceptions will be propagated to the external transaction so callers will be able to react on them accordingly)

Note: If using external DB transactions then callers are responsible for refreshing the state of security-related objects upon transaction rollbacks which occur after successful calls to the svyProperties API.


deleteProperty(property) ⇒ Boolean

Immediately and permanently deletes the specified property.

Returns: Boolean - False if property could not be deleted.

Note: USE WITH CAUTION! There is no undo for this operation.


getGlobalProperty(propertyKey, propertyType) ⇒ Property

Returns the global property with the given key and type Global properties are properties where the tenant and user name is not set

Returns: Property - the property found or null if not found


getGlobalPropertyValue(propertyKey, propertyType) ⇒ String

Returns the value of the global property with the given key and type Global properties are properties where the tenant and user name is not set

Returns: String - the value of the property found or null if not found


getProperties(propertyKey, [propertyType], [tenantName], [userName]) ⇒ [ 'Array' ].<Property>

Returns all properties with the given key and type, optional tenant and user name\

If tenantName is not provided, it will not be queried; if a null value is provided, only global properties are returned If userName is not provided, it will not be queried; if a null value is provided, only tenant wide properties are returned\


getPropertiesByType(propertyType, [tenantName], [userName]) ⇒ [ 'Array' ].<Property>

Returns all properties of the given type, optional tenant and user name\

If tenantName is not provided, it will not be queried; if a null value is provided, only global properties are returned If userName is not provided, it will not be queried; if a null value is provided, only tenant wide properties are returned\


getProperty(propertyKey, propertyType, [tenantName], [userName]) ⇒ Property

Returns the property with the given key and type or null if not found All parameters given need to match exactly

Returns: Property - the property found or null if not found


getTenantProperty(propertyKey, propertyType) ⇒ Property

Returns the tenant wide property with the given key and type for the tenant set via setUserName() Tenant wide properties are properties where the user name is not set

Returns: Property - the property found or null if not found


getTenantPropertyValue(propertyKey, propertyType) ⇒ String

Returns the value of the tenant wide property with the given key and type for the tenant set via setUserName() Tenant wide properties are properties where the user name is not set

Returns: String - the value of the property found or null if not found


getUserProperty(propertyKey, propertyType) ⇒ Property

Returns the property with the given key and type for the user set via setUserName()

Returns: Property - the property found or null if not found

Example

function onShow(firstShow, event) {
	var propertyKey = application.getSolutionName() + "-" + controller.getName() + "-" + elements.table.getName();
	var columnState = scopes.svyProperties.getUserProperty(propertyKey, 'table-state');
	
	// restore the ng-grid state 
	if (columnState) elements.table.restoreColumnState(columnState.getPropertyValue());
}

getUserPropertyValue(propertyKey, propertyType) ⇒ String

Returns the value of the property with the given key and type for the user set via setUserName()

Returns: String - the value of the property found or null if not found

Example

function onShow(firstShow, event) {
	var propertyKey = application.getSolutionName() + "-" + controller.getName() + "-" + elements.table.getName();
	var columnState = scopes.svyProperties.getUserPropertyValue(propertyKey, 'table-state');
	
	// restore the ng-grid state 
	if (columnState) elements.table.restoreColumnState(columnState);
}

getVersion() ⇒ String

Gets the version of this module

Returns: String - the version of the module using the format Major.Minor.Revision


setGlobalProperty(propertyKey, propertyType, value) ⇒ Property

Sets the given value to the global property with the given key and type or creates a new property if not found Global properties are properties where the tenant and user name is not set


setProperty(propertyKey, propertyType, value, userName, tenantName) ⇒ Property

Sets the given value to the property with the given key and type or creates a new property if not found


setTenantProperty(propertyKey, propertyType, value) ⇒ Property

Sets the given value to the tenant wide property with the given key and type or creates a new property if not found Tenant wide properties are properties where the user name is not set


setUserName(userName, [tenantName])

Sets the user and tenant name for the logged in user Both are used in all convenience methods to get or set properties for the user or the tenant When svySecurity is used, this is called automatically after login

Example

function onSolutionOpen(arg, queryParams) {
  // don't set the tenant if the solution doesn't support multi-tenancy
  // scopes.svyProperties.setUserName(loggedUserName);

  scopes.svyProperties.setUserName(loggedUniqueUserName, loggedUniqueTenantName);
}

setUserProperty(propertyKey, propertyType, value) ⇒ Property

Sets the given value to the user property with the given key and type or creates a new property if not found

Example

//persist the state of the NG Grid as user property  
function onColumnStateChanged(columnState) {
	 var propertyNameSpace = application.getSolutionName() + "-" + controller.getName() + "." + elements.table.getName();	
	 scopes.svyProperties.setUserProperty(propertyNameSpace, 'table-state', columnState);
}

Last updated