The UserAction class represents the user-defined action of DOCUMENTS.
More...
The UserAction class represents the user-defined action of DOCUMENTS.
- Since
- DOCUMENTS 4.0d
- Example:
var folder = context.createFolder("test", "public");
action.widget = "DropdownList";
action.setFileTypeForNewFile("FileType1");
if (!action.addToFolder(folder))
util.out(action.getLastError());
◆ UserAction()
UserAction UserAction::UserAction |
( |
String |
name, |
|
|
String |
label = "" , |
|
|
String |
widget = "Button" , |
|
|
String |
type = "NewFile" , |
|
|
String |
scope = "Unrestricted" |
|
) |
| |
Create a new instance of the UserAction class.
- Parameters
-
name | String value containing the desired user action name. |
label | String value containing the desired user action label. |
widget | String value containing the desired user action widget. |
type | String value containing the desired user action type. |
scope | String value containting the desired user action scope. |
- Since
- DOCUMENTS 4.0d
- Example:
var action =
new UserAction(
"testAction",
"de:Aktion;en:Action",
"DropdownList",
"PortalScript",
"ProcessesOnly");
- See also
- UserAction.widget, UserAction.type, UserAction.scope
◆ addToFolder()
boolean UserAction::addToFolder |
( |
Folder |
folder | ) |
|
Add the user action to a Folder.
- Parameters
-
- Returns
true
if successful, false
in case of any error
- Since
- DOCUMENTS 4.0d
- Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
if (action)
{
if (!action.addToFolder(folder))
util.out(action.getLastError());
}
}
◆ getLastError()
String UserAction::getLastError |
( |
| ) |
|
Get the description of the last error that occurred.
- Returns
- Text of the last error as String
- Since
- DOCUMENTS 4.0d
◆ getOID()
String UserAction::getOID |
( |
boolean |
oidLow = false | ) |
|
Returns the object-id.
- Parameters
-
oidLow | Optional flag:
If true only the id of the user action object (m_oid ) will be returned.
If false the id of the user action 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 or an empty string in case the user action has not yet been added to a proper parent object.
- Since
- DOCUMENTS 4.0d
-
DOCUMENTS 5.0 (new parameter
oidLow
)
◆ getPosition()
int UserAction::getPosition |
( |
| ) |
|
Retrieve the position of the user action within the user-defined action list of the parent object.
- Returns
- The zero-based position of the user action as integer or -1 in case of any error.
- Since
- DOCUMENTS 4.0d
- Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
util.out(action.getPosition());
}
◆ remove()
boolean UserAction::remove |
( |
| ) |
|
Remove the user action from the parent object.
- Note
- If the user action has not yet been added to a proper parent object, this function does nothing.
- Returns
true
if successful, false
in case of any error
- Since
- DOCUMENTS 4.0d
- Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
action.remove();
}
◆ setContext()
boolean UserAction::setContext |
( |
String |
context | ) |
|
Set the context for a user action of type JSP
.
- Parameters
-
context | String containing the desired context. |
- Returns
true
if successful, false
in case of any error
- Note
- This function is only available for a user action of type
JSP
.
- Since
- DOCUMENTS 4.0d
- Example:
action.type = "JSP";
if (!action.setContext("myContext"))
util.out(action.getLastError());
◆ setCreateDefaultWorkflow()
boolean UserAction::setCreateDefaultWorkflow |
( |
boolean |
createDefaultWorkflow | ) |
|
Set the flag whether to create the default workflow for a user action of type NewFile
.
- Parameters
-
createDefaultWorkflow | Flag indicating whether to create the default workflow for a new file. |
- Returns
true
if successful, false
in case of any error
- Note
- This function is only available for a user action of type
NewFile
.
- Since
- DOCUMENTS 4.0d
- Example:
if (!action.setCreateDefaultWorkflow(false))
util.out(action.getLastError());
◆ setFileTypeForNewFile()
boolean UserAction::setFileTypeForNewFile |
( |
String |
fileType | ) |
|
Set the file type for a user action of type NewFile
.
- Parameters
-
fileType | The technical name of the desired file type; use empty string ('') if you want to remove the associated file type. |
- Returns
true
if successful, false
in case of any error
- Note
- This function is only available for a user action of type
NewFile
.
- Since
- DOCUMENTS 4.0d
- Example:
if (!action.setFileTypeForNewFile("Filetype1"))
util.out(action.getLastError());
action.setFileTypeForNewFile('');
◆ setPortalScript()
boolean UserAction::setPortalScript |
( |
String |
scriptName | ) |
|
Set the portal script for a user action of type PortalScript
.
- Parameters
-
scriptName | The name of the desired portal script; use empty string ('') if you want to remove the associated script. |
- Returns
true
if successful, false
in case of any error
- Note
- This function is only available for a user action of type
PortalScript
.
- Since
- DOCUMENTS 4.0d
- Example:
action.type = "PortalScript";
if (!action.setPortalScript("testScript"))
util.out(action.getLastError());
action.setPortalScript('');
◆ setPosition()
boolean UserAction::setPosition |
( |
int |
position | ) |
|
Place the user action at the given position in the user-defined action list of the parent object.
- Note
- 0 at the beginning and -1 at the end.
- Parameters
-
position | The 0-based position for the user action. |
- Returns
true
if successful, false
in case of any error.
- Since
- DOCUMENTS 4.0d
- Example:
var it = context.getFoldersByName("testFolder");
var folder = it.first();
if (folder)
{
var action = folder.getActionByName("testAction");
if (action)
action.setPosition(-1);
}
◆ label
The entire label defined for the UserAction object.
- Returns
- String containing the entire label.
- Since
- DOCUMENTS 4.0d
◆ name
The technical name of the UserAction object.
- Returns
- String containing the technical name of the UserAction.
- Since
- DOCUMENTS 4.0d
◆ scope
The scope of the UserAction object.
- Returns
- String containing the scope. There are three possible scopes available:
Unrestricted
ProcessesOnly
EasArchiveOnly
- Since
- DOCUMENTS 4.0d
◆ type
The type of the UserAction object.
- Returns
- String containing the type. There are four possible types available:
NewFile
PortalScript
JSP
Gadget
- Since
- DOCUMENTS 4.0d
◆ widget
String UserAction::widget |
The widget identifier of the UserAction object.
- Returns
- String containing the widget identifier. There are two possible widget identifiers available:
- Since
- DOCUMENTS 4.0d