General Communicator stuff
General Communicator
Use it to retrieve general data.
Methods
| method | return | type | Description |
|---|---|---|---|
|
refreshUI() |
void |
read |
Refresh user interface. |
|
getToolBarOption() |
ToolBarOption |
read
|
Retrieve ToolbarOption object. The variables in ToolbarOption show which OpenKM features are enabled or disabled by security. |
|
getLang() |
String |
read |
Get user interface language code. |
|
i18nExtension(String property) |
String |
read |
Retrieve extension translation. |
|
i18n(String property) |
String |
read |
Retrieve frontend translation. |
|
downloadDocument(boolean checkout) |
void |
read |
Download selected document. When the checkout value is "true", the document will be marked as "edition". |
|
downloadDocumentPdf() |
void |
read |
Download selected document as PDF. |
|
extensionCallOwnDownload(String url) |
void |
read |
Used to call |
|
downloadFileByUUID(String uuid, String params) |
void |
read |
Download file with parameters. Allowed parameters:
|
|
downloadFile(String path, String params) |
void |
read |
Download file with parameters. Deprecated in favor of the "downloadFileByUUID" method. |
|
setStatus(String msg) |
void |
void |
Change the status message at the bottom right. |
|
resetStatus() |
void |
read |
Reset the bottom-right status bar. |
|
showError(String callback, Throwable caught) |
void |
read |
Show an error popup with a message. |
|
logout() |
void |
read |
Log out from the OpenKM user interface. |
|
getUserRoleList() |
List<String> |
read |
Retrieve a list of the user's roles. |
|
getUser() |
String |
read |
Retrieve the user ID. |
|
openPath(String path, String docPath) |
void |
read |
Open a node in OpenKM. Parameters:
To open a single folder path, the parameter "docPath" must be empty. |
|
openAllFolderPath(String path, String docPath) |
void |
read |
Open all folders in OpenKM. Parameters:
To open a single folder path, the parameter "docPath" must be empty. |
|
getAppContext() |
String |
read |
Retrieve the application context. |
|
showNextWizard() |
void |
read |
Show the next wizard. Wizards are shown after uploading a document. |
|
isDigitalSignature() |
boolean |
read |
When true, indicates that the digital signature extension is enabled. |
|
getDocumentToSign() |
GWTDocument |
read |
Retrieve a document object to be signed. |
|
getSessionId() |
String |
read |
Retrieve a session. |
|
getWorkspace() |
GWTWorkspace |
read |
Retrieve the GWT Workspace object. The object contains information about UI features - enabled or disabled - among others. |
|
enableKeyShortcuts() |
void |
read |
Enable UI shortcuts. |
|
disableKeyShortcuts() |
void |
void |
Disable UI shortcuts. |
|
openPathByUuid(String uuid) |
void |
void |
Open a node in OpenKM. |
|
getFolderIcon(GWTFolder fld) |
String |
void |
Retrieve the folder icon image path. |
|
get() |
Main |
void |
Retrieve the Main object from the singleton pattern. Main class is the principal frontend class which offers full access to any frontend UI method. |
Sample
// Call to refreshing user interface
GeneralComunicator.refreshUI();
DashboardCommunicator
Use it to retrieve dashboard tab data.
Methods
| method | return | type | Description |
|---|---|---|---|
|
getUserSubscribedDocuments() |
void |
read |
Refresh the user's subscribed documents list. |
|
getUserSubscribedFolders() |
void |
read | Refresh the user's subscribed folders list. |
| refreshAllSearches() |
void |
read | Refresh search list. |
|
showToolBoxExtension(ToolBarBoxExtension extension) |
void |
read | Change selected dashboard button. |
|
getUserSearches(boolean refresh) |
void |
read |
Refresh the user's search list. When the refresh boolean value is true, also refresh search results in the dashboard news view. |
|
isWidgetExtensionVisible(Widget widget) |
boolean |
read |
When true, indicates the widget extension is enabled. |
Sample
// Call to refreshing subscribed documents
DashboardComunicator.getUserSubscribedDocuments();
FileBrowserCommunicator
Use it to retrieve file browser data.
Methods
| method | return | type | Description |
|---|---|---|---|
|
isDocumentSelected() |
boolean |
read |
When a document is selected, it returns "true". |
|
isFolderSelected() |
boolean |
read | When a folder is selected, it returns "true". |
| isMailSelected() |
boolean |
read |
When a mail is selected, it returns "true". |
|
isRecordSelected() |
boolean |
read | When a record is selected, it returns "true". |
|
getDocument() |
GWTDocument |
read | Retrieve a GWT document object of the selected document. |
|
getFolder() |
GWTFolder |
read | Retrieve a GWT folder object of the selected folder. |
|
getMail() |
GWTMail |
read | Retrieve a GWT mail object of the selected mail. |
|
getRecord() |
GWTRecord |
read | Retrieve a GWT record object of the selected record. |
|
isPanelSelected() |
boolean |
read | When the file browser panel is selected, it returns "true". |
|
refreshOnlyFileBrowser() |
void |
read | Refresh only the file browser widget view. |
|
isMassive() |
boolean |
read |
When true, indicates that massive is enabled. |
|
getAllSelectedUUIDs() |
List<String> | read |
Retrieve a list of the selected UUIDs. |
Sample
if (FileBrowserComunicator.isDocumentSelected()) {
Window.alert("document selected");
} else {
Window.alert("document not selected");
}
NavigatorCommunicator
Use it to retrieve navigator data.
The navigator panel contains a stack panel with folder trees (taxonomy, categories, etc.).
Methods
| method | return | type | Description |
|---|---|---|---|
|
getStackIndex() |
int |
read |
Get the stack index ID. |
|
isTaxonomyShown() |
boolean |
read | When true, indicates the taxonomy stack is shown. |
| isCategoriesShown() |
boolean |
read | When true, indicates the categories stack is shown. |
|
isMetadataShown() |
boolean |
read | When true, indicates the metadata stack is shown. |
|
isThesaurusShown() |
boolean |
read |
When true, indicate the thesaurus stack is shown. |
|
isTemplatesShown() |
boolean |
read |
When true, indicates the templates stack is shown. |
|
isPersonalShown() |
boolean |
read |
When true, indicates the personal stack is shown. |
|
isMailShown() |
boolean |
read |
When true, indicates the mail stack is shown. |
|
isTrashShown() |
boolean |
read |
When true, indicates the trash stack is shown. |
|
getFolder() |
GWTFolder |
read |
Retrieve the selected folder object from the enabled tree view. We suggest using the getNode() method rather than this one. |
|
getActualPath() |
String |
read |
Retrieve the path of the selected folder from the enabled tree view. |
|
getRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of the node "/okm:root". |
|
getCategoriesRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of the node "/okm:categories". |
|
getMetadataRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of the node "/okm:metadata". |
|
getThesaurusRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of node "/okm:thesaurus". |
|
getTemplatesRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of node "/okm:templates". |
|
getPersonalRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of node "/okm:personal". |
|
getMailRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of node "/okm:mail". |
|
getTrashRootFolder() |
GWTFolder |
read |
Retrieve the GWT folder object of node "/okm:trash". |
|
isPanelSelected() |
boolean |
read |
When "true", indicates the navigator panel is the selected node. |
|
getNode() |
GWTNode |
read |
Retrieve the selected node object from the enabled tree view. The selected node can be a folder or a record type. |
Sample
int stack = NavigatorComunicator.getStackIndex();
if (stack==0) {
Window.alert("First stack enabled");
} else {
Window.alert("Other stack");
}
SearchCommunicator
Use it to retrieve search data.
Methods
| method | return | type | Description |
|---|---|---|---|
|
setSavedSearch(GWTQueryParams params) |
void | write |
Execute a saved search. |
|
getAllSearches() |
void |
read |
Refresh the saved search panel. |
|
getUserSearches() |
void |
read | Refresh the user's saved search panel. |
| getSelectedRowSearchSaved() |
int |
read |
Retrieve the selected row of the saved search panel. |
|
getSelectedRowUserNews() |
int |
read |
Retrieve the selected row of the user's saved search panel. |
|
getSavedSearch() |
GWTQueryParams |
read |
Retrieve the GWT QueryParams object of the selected saved search. |
|
getSavedUserNews() |
GWTQueryParams |
read |
Retrieve the GWT QueryParams object of the selected user saved search. |
|
showFolderSelectPopup(FindFolderHandler findFolderHandler) |
void |
read |
Register a handler for the find folder popup. |
|
showDocumentSelectPopup(FindDocumentHandler findDocumentHandler, int typeSearch) |
void |
read |
Register a handler for the find document popup. |
|
showMailSelectPopup(FindMailHandler findMailHandler) |
void |
read |
Register a handler for the find mail popup. |
|
showRecordSelectPopup(FindRecordHandler findRecordHandler) |
void |
read |
Register a handler for the find record popup. |
Sample
// Call to refreshing subscribed documents
GWTQueryParams params = new GWTQueryParams();
params.setName("test");
SearchComunicator.setSavedSearch(params);
UtilCommunicator
General purpose methods.
Methods
| method | return | type | Description |
|---|---|---|---|
|
formatSize(double size) |
String |
read |
Convert document size in bytes to a human-readable value (KB, MB, GB, etc.). |
| createHeaderHTML(String imageURL, String caption) |
String |
read | Retrieve a stack header HTML code to be used in a GWT frontend stack widget. |
|
imageItemHTML(String imageUrl, String title, String align) |
String |
read |
Retrieve image HTML code to be used in a GWT frontend widget. |
|
menuHTML(String imageUrl, String text) |
String |
read |
Retrieve menu HTML code to be used in a GWT frontend menu element. |
|
menuHTMLWithoutIcon(String text) |
String |
read |
Retrieve menu HTML code to be used in a GWT frontend menu element. |
|
imageItemHTML(String imageUrl) |
String |
read |
Retrieve image HTML code to be used in a GWT frontend widget. |
|
getTextAsBoldHTML(String text, boolean mark) |
String |
read |
Retrieve the text as bold HTML. |
|
getUserAgent() |
String |
read |
Retrieve the user agent of the browser. |
|
getName(String path) |
String |
read |
Retrieve the name of a path. The name of "/okm:root/temp/doc1.pdf" is "doc1.pdf". |
|
getParent(String path) |
String |
read |
Retrieve the parent path of a path. The parent of "/okm:root/temp/doc1.pdf" is "/okm:root/temp". |
|
mimeImageHTML(String mime) |
String |
read |
Retrieve the URL of the MIME type icon. |
|
hSpace(String width) |
HTML |
read |
Retrieve a GWT HTML horizontal separator. |
|
vSpace(String height) |
HTML |
read |
Retrieve a GWT HTML vertical separator. |
|
isSearchableKey(KeyUpEvent event) |
boolean |
read |
Evaluate whether the key pressed is not a navigation, arrow, or modifier key. Navigation keys: HOME, END, PAGEUP, PAGEDOWN. Modifier keys: SHIFT, ALT, CTRL, DOWN. Arrow keys: LEFT, RIGHT, UP, DOWN. |
Sample
// Call to formatting the document size ( gb, mb etc... )
UtilComunicator.formatSize(15);