DOCUMENTS 5 - PortalScripting API
Public Member Functions | Public Attributes | List of all members
AccessProfile Class Reference

The AccessProfile class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means. More...

Public Member Functions

AccessProfile AccessProfile (String nameAccessProfile)
 With the new method is it possible to create a new AccessProfile. More...
 
CustomProperty addCustomProperty (String name, String type, String value)
 Creates a new CustomProperty for the AccessProfile. More...
 
String getAttribute (String attribute)
 Get the String value of an attribute of the AccessProfile. More...
 
CustomPropertyIterator getCustomProperties (String nameFilter="", String typeFilter="")
 Get a CustomPropertyIterator with custom properties of the current AccessProfile. More...
 
String getLastError ()
 If you call a method at an AccessProfile object and an error occurred, you can get the error description with this function. More...
 
String getOID (boolean oidLow=false)
 Returns the object-id. More...
 
SystemUserIterator getSystemUsers (boolean includeLockedUsers=true, boolean includeInvisibleUsers=true)
 Retrieve a list of desired SystemUser which are assigned to the current AccessProfile. More...
 
boolean setAttribute (String attribute, String value)
 Set the String value of an attribute of the AccessProfile to the desired value. More...
 
CustomProperty setOrAddCustomProperty (String name, String type, String value)
 Creates a new CustomProperty or modifies a CustomProperty according the name and type for the AccessProfile. More...
 
boolean setParentProfile (AccessProfile parentProfile)
 Set the parent profile of the current profile. More...
 

Public Attributes

String name
 The technical name of the AccessProfile. More...
 
PropertyCache propCache
 Access to the property cache of the AccessProfile. More...
 

Detailed Description

The AccessProfile class has been added to the DOCUMENTS PortalScripting API to gain full access to the DOCUMENTS access profiles by scripting means.

A SystemUser can be assigned to an AccessProfile. At the filetype it is possible to define several rights depending on the AccessProfile. You can get an AccessProfile object by different methods like Context.findAccessProfile(String ProfileName) or from the AccessProfileIterator.

Since
ELC 3.50b / otrisPORTAL 5.0b

Constructor & Destructor Documentation

◆ AccessProfile()

AccessProfile AccessProfile::AccessProfile ( String  nameAccessProfile)

With the new method is it possible to create a new AccessProfile.

If an access profile with the profile name already exist, the method return the existing access profile.

Returns
The new created AccessProfile object. If the creation fails, the method returns NULL.
Example:
var newAP = new AccessProfile("supportteam");
if (!newAP)
util.out("Creation of AccessProfile failed.");
Since
ELC 3.50b / otrisPORTAL 5.0b
Deprecated:
since ELC 3.60i / otrisPORTAL 6.0i use Context.createAccessProfile() instead

Member Function Documentation

◆ addCustomProperty()

CustomProperty AccessProfile::addCustomProperty ( String  name,
String  type,
String  value 
)

Creates a new CustomProperty for the AccessProfile.

Parameters
nameString value defining the name
typeString value defining the type
valueString value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var office = context.findAccessProfile("office");
if (!office) throw "office is null";
var custProp = office.addCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(office.getLastError());
See also
AccessProfile.setOrAddCustomProperty(String name, String type, String value)
AccessProfile.getCustomProperties(String nameFilter, String typeFilter)

◆ getAttribute()

String AccessProfile::getAttribute ( String  attribute)

Get the String value of an attribute of the AccessProfile.

Parameters
attributeString containing the name of the desired attribute
Returns
String containing the value of the desired attribute
Note
This function is only for experts. Knowledge about the ELC-database schema is necessary!
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ getCustomProperties()

CustomPropertyIterator AccessProfile::getCustomProperties ( String  nameFilter = "",
String  typeFilter = "" 
)

Get a CustomPropertyIterator with custom properties of the current AccessProfile.

Parameters
nameFilterString value defining an optional filter depending on the name
typeFilterString value defining an optional filter depending on the type
Returns
CustomPropertyIterator
Since
DOCUMENTS 5.0
Example:
var office = context.findAccessProfile("office");
if (!office) throw "office is null";
var itProp = office.getCustomProperties();
for (var prop = itProp.first(); prop; prop = itProp.next())
{
util.out(prop.name + ": " + prop.value);
}
See also
Context.findCustomProperties(String filter)
AccessProfile.setOrAddCustomProperty(String name, String type, String value)
AccessProfile.addCustomProperty(String name, String type, String value)

◆ getLastError()

String AccessProfile::getLastError ( )

If you call a method at an AccessProfile object and an error occurred, you can get the error description with this function.

Returns
Text of the last error as String
Since
ELC 3.50b / otrisPORTAL 5.0b
See also
DocFile.getLastError()

◆ getOID()

String AccessProfile::getOID ( boolean  oidLow = false)

Returns the object-id.

Parameters
oidLowOptional flag:
If true only the id of the AccessProfile object (m_oid) will be returned.
If false the id of the AccessProfile object will be returned together with the id of the corresponding class in the form class-id:m_oid.
The default value is false.
Returns
String with the object-id
Since
ELC 3.60c / otrisPORTAL 6.0c
DOCUMENTS 5.0 (new parameter oidLow)

◆ getSystemUsers()

SystemUserIterator AccessProfile::getSystemUsers ( boolean  includeLockedUsers = true,
boolean  includeInvisibleUsers = true 
)

Retrieve a list of desired SystemUser which are assigned to the current AccessProfile.

Parameters
includeLockedUsersOptional flag indicating whether locked users also should be returned. The default value is true.
includeInvisibleUsersOptional flag indicating whether the method also should return users for which the option "Display user in DOCUMENTS lists" in the Documents Manager is not checkmarked. The default value is true.
Returns
SystemUserIterator containing a list of SystemUser
Example:
var ap = context.findAccessProfile("supportteam");
if (ap)
{
var itSU = ap.getSystemUsers();
for (var su = itSU.first(); su; su = itSU.next())
util.out(su.login);
}
else
util.out("AccessProfile does not exist.");
Since
ELC 3.51e / otrisPORTAL 5.1e
DOCUMENTS 5.0c HF2 (new parameters includeLockedUsers and includeInvisibleUsers)

◆ setAttribute()

boolean AccessProfile::setAttribute ( String  attribute,
String  value 
)

Set the String value of an attribute of the AccessProfile to the desired value.

Parameters
attributeString containing the name of the desired attribute
valueString containing the desired value of the attribute
Returns
true if successful, false in case of any error
Note
This function is only for experts. Knowledge about the ELC-database schema is necessary!
Since
ELC 3.50b / otrisPORTAL 5.0b

◆ setOrAddCustomProperty()

CustomProperty AccessProfile::setOrAddCustomProperty ( String  name,
String  type,
String  value 
)

Creates a new CustomProperty or modifies a CustomProperty according the name and type for the AccessProfile.

This method creates or modifies a unique CustomProperty for the AccessProfile. The combination of the name and the type make the CustomProperty unique for the AccessProfile.

Parameters
nameString value defining the name
typeString value defining the type
valueString value defining the value
Returns
CustomProperty
Since
DOCUMENTS 5.0
Example:
var office = context.findAccessProfile("office");
if (!office) throw "office is null";
var custProp = office.setOrAddCustomProperty("favorites", "string", "peachit");
if (!custProp)
util.out(office.getLastError());
See also
AccessProfile.getCustomProperties(String nameFilter, String typeFilter)
AccessProfile.addCustomProperty(String name, String type, String value)

◆ setParentProfile()

boolean AccessProfile::setParentProfile ( AccessProfile  parentProfile)

Set the parent profile of the current profile.

Parameters
parentProfileoptional AccessProfile object being the parent profile of the current profile. If no parent profile is defined, the current profile will be moved to the top level.
Returns
true if successful, false in case of any error
Since
DOCUMENTS 5.0d
Example:
var parentProfile = context.createAccessProfile("parentProfile");
if (parentProfile)
{
var subProfile = context.createAccessProfile("subProfile");
if (subProfile)
{
var success = subProfile.setParentProfile(parentProfile);
if (!success)
util.out(subProfile.getLastError());
// We can move subProfile to the top level as follows:
success = subProfile.setParentProfile();
}
}

Member Data Documentation

◆ name

String AccessProfile::name

The technical name of the AccessProfile.

Returns
String containing the technical name of the AccessProfile.
Since
ELC 3.50b / otrisPORTAL 5.0b
Example:
var su = context.getSystemUser(); // current user
if (su)
{
var apIter = su.getAccessProfiles();
for (var ap = apIter.first(); ap; ap = apIter.next())
{
util.out(ap.name);
}
}

◆ propCache

PropertyCache AccessProfile::propCache

Access to the property cache of the AccessProfile.

Returns
PropertyCache object of the AccessProfile.
Example:
var ap = context.findAccessProfile("Everybody");
if (!ap.propCache.hasProperty("Contacts"))
{
util.out("Creating cache");
ap.propCache.Contacts = ["Peter", "Paul", "Marry"];
}
Since
DOCUMENTS 5.0
See also
PropertyCache, SystemUser.propCache

This documentation refers DOCUMENTS 5.0e (2105).
Created at 11-09-2019. - © 1998-2019 otris software AG, Königswall 21, D-44137 Dortmund. support@otris.de