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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

MethodReturn valuesDescription

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:

  • LastWeekTopDownloadedDocuments
  • LastMonthTopDownloadedDocuments
  • LastWeekTopModifiedDocuments
  • LastMonthTopModifiedDocuments
  • LastModifiedDocuments
  • LastUploadedDocuments
  • UserLockedDocuments
  • UserCheckedOutDocuments
  • UserLastModifiedDocuments
  • UserLastDownloadedDocuments
  • UserSubscribedDocuments
  • UserSubscribedFolders
  • UserLastUploadedDocuments
  • UserLastImportedMails
  • UserLastImportedMailAttachments
  • In case "user new", the source name is the name of the query.

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();
        }
    }
}