public interface Folder
ProcedureInventory
is a folder too and it is the common parent of all other folders and procedures.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROCEDURE_ARGUMENTS
A constant used for
export and import functionality of the folder. |
static java.lang.String |
PROCEDURE_HAS_SHORTCUT
A constant used for
export and import functionality of the folder. |
static java.lang.String |
PROCEDURE_ICON_REF
A constant used for
export and import functionality of the folder. |
static java.lang.String |
PROCEDURE_NAME
A constant used for
export and import functionality of the folder. |
static java.lang.String |
PROCEDURE_PATH
A constant used for
export and import functionality of the folder. |
static java.lang.String |
PROCEDURE_TEXT
A constant used for
export and import functionality of the folder. |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcedure(java.lang.String name,
java.io.InputStream in)
Adds procedure with a given name and script text supplied as an input stream to the current
folder.
|
void |
addProcedure(java.lang.String name,
java.lang.String text)
Adds procedure with a given name and script text to the current folder.
|
Procedure |
addProcedure(java.lang.String name,
java.lang.String text,
boolean hasShortcut,
Argument[] arguments,
java.io.InputStream icon)
Adds a procedure with a given name and all the other parameters.
|
Folder |
createFolder(java.lang.String name)
Creates a new subfolder of this folder.
|
Argument |
createProcedureArgument(java.lang.String description,
java.lang.String type,
java.lang.String[] values)
Creates a new instance of
Argument type. |
void |
deleteFolder()
Deletes the current folder and all its content.
|
void |
deleteProcedure(java.lang.String name)
Deletes procedure with a given name.
|
void |
exportInventory(java.io.OutputStream out)
Exports the content of the folder into a Java Archive file.
|
void |
exportProcedures(Folder[] folders,
Procedure[] procedures,
java.io.OutputStream out)
Exports the content of the given folders and procedures as a ZIP archive file.
|
Folder |
getFolder(java.lang.String name)
Returns sub folder with a given name.
|
Folder[] |
getFolders()
Returns all sub folders of this folder.
|
java.lang.String |
getFullPath()
Returns the full path to this folder in format <folder1>/<folder2>/.../<folderName>.
|
java.lang.String |
getName()
Gets the name of the folder.
|
java.lang.String |
getPath()
Returns the full path to this folder in format <folder1>/<folder2>/.../<folderN>.
|
Procedure |
getProcedure(java.lang.String name)
Gets a procedure object, containing its name, text and its metadata from the inventory.
|
java.lang.String[] |
getProcedureNames()
Returns the names of all procedures contained in this folder.
|
Procedure[] |
getProcedures()
Gets all procedures objects in this folder from the inventory.
|
java.lang.String |
getProcedureText(java.lang.String name)
Returns the script text of a procedure with a given name.
|
void |
importInventory(java.io.InputStream in)
Imports the saved procedures from a file in this folder.
|
boolean |
isEmpty()
Returns whether the folder is empty, i.e.
|
void |
moveTo(java.lang.String targetFolderPath,
boolean replace)
Move this folder to the specified one.
|
int |
parseProcedureText(java.lang.String text)
Parses the given procedure text to extract all procedure parameters.
|
static final java.lang.String PROCEDURE_NAME
export and import functionality of the folder.static final java.lang.String PROCEDURE_PATH
export and import functionality of the folder.static final java.lang.String PROCEDURE_ICON_REF
export and import functionality of the folder.static final java.lang.String PROCEDURE_ARGUMENTS
export and import functionality of the folder.static final java.lang.String PROCEDURE_TEXT
export and import functionality of the folder.static final java.lang.String PROCEDURE_HAS_SHORTCUT
export and import functionality of the folder.java.lang.String getName()
throws ManagementException
/. This symbol is the separator
of the folders.ManagementException - if system error occurs.java.lang.String getPath()
throws ManagementException
ManagementException - if system error occurs.java.lang.String getFullPath()
throws ManagementException
/.ManagementException - if system error occurs.boolean isEmpty()
throws ManagementException
true if the folder is empty.ManagementException - if system error occurs.Folder createFolder(java.lang.String name) throws ManagementException
ProcedureEvent.FOLDER_ADDED and it contains the added folder
as source available via getSource().name - the name of the folder. It must be unique in the scope of this folder.ManagementException - if the name of the folder already exists or
system level error occurs or the logged user does not imply the proper role.Folder[] getFolders() throws ManagementException
ManagementException - if system error occurs or the logged user does not imply the proper role.Folder getFolder(java.lang.String name) throws ManagementException
null.name - the name of folder.ManagementException - if system error occurs or the logged user does not imply the proper role.void addProcedure(java.lang.String name,
java.lang.String text)
throws ManagementException
name - name of the procedure.text - the script text of the procedure.ManagementException - if system error occurs or the logged user does not imply the proper role.Procedure addProcedure(java.lang.String name, java.lang.String text, boolean hasShortcut, Argument[] arguments, java.io.InputStream icon) throws ManagementException
name - name of the procedure.text - script text of the procedure.hasShortcut - if there is assigned a shortcut to itarguments - the arguments info of the procedureicon - the icon dataProcedure object represented the added procedureManagementException - if system error occurs or if the length of arguments is different from result of the method parseProcedureText()
or the logged user does not imply the proper role.void addProcedure(java.lang.String name,
java.io.InputStream in)
throws ManagementException
name - name of the procedure.in - input stream contains the text of the procedure.ManagementException - if system error occurs or the logged user does not imply the proper role.java.lang.String getProcedureText(java.lang.String name)
throws ManagementException
null is returned.name - name of the procedure.ManagementException - if system error occurs or the logged user does not imply the proper role.java.lang.String[] getProcedureNames()
throws ManagementException
ManagementException - if system error occurs or the logged user does not imply the proper role.void deleteProcedure(java.lang.String name)
throws ManagementException
name - name of the procedure.ManagementException - if system error occurs or the logged user does not imply the proper role.void deleteFolder()
throws ManagementException
ProcedureEvent.FOLDER_REMOVED shall be
generated and shall contain the full path of the removed folder.ManagementException - if system error occurs or the logged user does not imply the proper role.Procedure[] getProcedures() throws ManagementException
ManagementException - if system error occurs or the logged user does not imply the proper role.Procedure getProcedure(java.lang.String name) throws ManagementException
name - the procedure's namenull if there aren't any.ManagementException - if system error occurs or the logged user does not imply the proper role.Argument createProcedureArgument(java.lang.String description, java.lang.String type, java.lang.String[] values)
Argument type. The created argument is used in
the method setArguments with other arguments be set to a procedure.description - the user description of the argumenttype - the type of the description; types are listed in Argument interfacevalues - will be set if the type is equal to Argument.ENUMERATED_TYPEint parseProcedureText(java.lang.String text)
throws ManagementException
% symbol followed by a number.text - the procedure text to be parsedManagementException - if there is a % symbol, followed by incorrect number (every number which is not integer and greater than zero)
or the logged user does not imply the proper role.void importInventory(java.io.InputStream in)
throws ManagementException
in - the InputStream of the file where the procedures are previously exported.ManagementException - if system error occurs or the logged user does not imply the proper role.void exportInventory(java.io.OutputStream out)
throws ManagementException
procedures.txt. If there are icons for some of the procedures, they are also saved as entries in the JAR file.out - the output to which the content is written.ManagementExceptionvoid exportProcedures(Folder[] folders, Procedure[] procedures, java.io.OutputStream out) throws ManagementException
folders - the folders which content to be exportedprocedures - the procedures to be exportedout - the output where the content is writtenManagementExceptionvoid moveTo(java.lang.String targetFolderPath,
boolean replace)
throws ManagementException
replace
argument has value false a ManagementExeption will be thrown. Otherwise the folder will be replaced with the moved one.
If the folder is successfully moved an event will be generated with type ProcedureEvent.FOLDER_MOVED and it contains the moved folder
as source available via getSource(), and the old full path of the moved folder.targetFolderPath - the path of the folder where the procedure to be moved to.replace - specifies whether it will be replaced, if there is an existing folder with such path existsManagementException - If a system error occurs, a folder with the specified path does not exist or the logged user does not imply the proper roleCopyright © 2019 Bosch Software Innovations GmbH. All Rights Reserved.