OKMDashboard
Basics
On all methods you'll see parameter named "token". When accessing application across SOAP the login process returns a token, what is used to identify the user on all the exposed methods. From default application execution context you must use "null" value what indicates to the application must use the "user session".
On special cases you might be "promoted as Administrator" using the "administrator token".
String systemToken = DbSessionManager.getInstance().getSystemToken();
Methods
getUserCheckedOutDocuments
Description:
Method | Return values | Description |
---|---|---|
getUserCheckedOutDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of documents checkout by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserCheckedOutDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserLastModifiedDocuments
Description:
Method | Return values | Description |
---|---|---|
getUserLastModifiedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the last documents modified by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserLastModifiedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserLockedDocuments
Description:
Method | Return values | Description |
---|---|---|
getUserLockedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the locked documents modified by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserLockedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserSubscribedDocuments
Description:
Method | Return values | Description |
---|---|---|
getUserSubscribedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the subscribed documents by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserSubscribedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserSubscribedFolders
Description:
Method | Return values | Description |
---|---|---|
getUserSubscribedFolders(String token) |
List<DashboardFolderResult> |
Get the list of the subscribed folders by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardFolderResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardFolderResult dashboardFolderResult : OKMDashboard.getInstance().getUserSubscribedFolders(null)) {
System.out.println(dashboardFolderResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserLastUploadedDocuments
Description:
Method | Return values | Description |
---|---|---|
getUserLastUploadedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the last uploaded documents by the user. |
Example:
package com.openkm; import com.openkm.api.OKMDashboard; import com.openkm.bean.DashboardDocumentResult; public class Test { public static void main(String[] args) { try { for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserLastUploadedDocuments(null)) { System.out.println(dashboardDocumentResult); } } catch (Exception e) { e.printStackTrace(); } } }
getUserLastDownloadedDocuments
Description:
Method | Return values | Description |
---|---|---|
getUserLastDownloadedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the last download documents by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserLastDownloadedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserLastImportedMails
Description:
Method | Return values | Description |
---|---|---|
getUserLastImportedMails(String token) |
List<DashboardMailResult> |
Get the list of the last imported mails by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardMailResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardMailResult dashboardMailResult : OKMDashboard.getInstance().getUserLastImportedMails(null)) {
System.out.println(dashboardMailResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserLastImportedMailAttachments
Description:
Method | Return values | Description |
---|---|---|
getUserLastImportedMailAttachments(String token) |
List<DashboardDocumentResult> |
Get the list of the last imported mail attachments by the user. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getUserLastImportedMailAttachments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserDocumentsSize
Description:
Method | Return values | Description |
---|---|---|
getUserDocumentsSize(String token) |
long |
Return the total size in bytes of the user documents. |
When user upload or modify a document, the entire size of the contents - and history versions in case of update - are assigned to the users.
|
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.util.FormatUtil;
public class Test {
public static void main(String[] args) {
try {
long sizeInBytes = OKMDashboard.getInstance().getUserDocumentsSize(null);
System.out.println(FormatUtil.formatSize(sizeInBytes));
} catch (Exception e) {
e.printStackTrace();
}
}
}
getUserSearchs
Description:
Method | Return values | Description |
---|---|---|
getUserSearchs(String token) |
List<QueryParams> |
Get the list of all "user news" saved by the user. |
The "user saved" searches are executed periodically for getting news based on queries from the repository. More information at Working with the dashboard and Working with search views.
|
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.dao.bean.QueryParams;
public class Test {
public static void main(String[] args) {
try {
for (QueryParams qp : OKMDashboard.getInstance().getUserSearchs(null)) {
System.out.println(qp);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
find
Description:
Method | Return values | Description |
---|---|---|
find(String token, int qpId) |
List<DashboardNodeResult> |
Execute a "user news". |
The param qpId is the unique identifier of the "users news" search. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardNodeResult;
import com.openkm.bean.Document;
import com.openkm.bean.Folder;
import com.openkm.bean.Mail;
public class Test {
public static void main(String[] args) {
try {
int qpId = 12;
for (DashboardNodeResult dashboardNodeResult : OKMDashboard.getInstance().find(null, qpId)) {
if (dashboardNodeResult.getNode() instanceof Document ) {
Document doc = (Document) dashboardNodeResult.getNode();
System.out.println(doc);
} else if (dashboardNodeResult.getNode() instanceof Folder ) {
Folder fld = (Folder) dashboardNodeResult.getNode();
System.out.println(fld);
} else if (dashboardNodeResult.getNode() instanceof Mail ) {
Mail mail = (Mail) dashboardNodeResult.getNode();
System.out.println(mail);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getLastWeekTopDownloadedDocuments
Description:
Method | Return values | Description |
---|---|---|
getLastWeekTopDownloadedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the top downloaded documents during the last week by all the users. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getLastWeekTopDownloadedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getLastMonthTopDownloadedDocuments
Description:
Method | Return values | Description |
---|---|---|
getLastMonthTopDownloadedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the top downloaded documents during the last month by all the users. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getLastMonthTopDownloadedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getLastWeekTopModifiedDocuments
Description:
Method | Return values | Description |
---|---|---|
getLastWeekTopModifiedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the top modified documents during the last week by all the users. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getLastWeekTopModifiedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getLastMonthTopModifiedDocuments
Description:
Method | Return values | Description |
---|---|---|
getLastMonthTopModifiedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the top modified documents during the last month by all the users. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getLastMonthTopModifiedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getLastModifiedDocuments
Description:
Method | Return values | Description |
---|---|---|
getLastModifiedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the last modified documents by all the users. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getLastModifiedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
getLastUploadedDocuments
Description:
Method | Return values | Description |
---|---|---|
getLastUploadedDocuments(String token) |
List<DashboardDocumentResult> |
Get the list of the last uploaded documents by all the users. |
Example:
package com.openkm;
import com.openkm.api.OKMDashboard;
import com.openkm.bean.DashboardDocumentResult;
public class Test {
public static void main(String[] args) {
try {
for (DashboardDocumentResult dashboardDocumentResult : OKMDashboard.getInstance().getLastUploadedDocuments(null)) {
System.out.println(dashboardDocumentResult);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
visiteNode
Description:
Method | Return values | Description |
---|---|---|
visiteNode(String token, String source, String node, Calendar date) |
void |
Mark a node as a visited. |
From UI, the nodes are shown strong until are visited by the user. This method mark the node as visited by the user in the database.
|
||
Available sources:
|
Example:
package com.openkm;
import java.util.Calendar;
import com.openkm.api.OKMDashboard;
public class Test {
public static void main(String[] args) {
try {
Calendar cal = Calendar.getInstance();
OKMDashboard.getInstance().visiteNode(null, "LastWeekTopDownloadedDocuments", "/okm:root/sample.pdf", cal);
} catch (Exception e) {
e.printStackTrace();
}
}
}