Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

DocuShare jQuery - A jQuery-like wrapper for the DocuShare Java API

License

NotificationsYou must be signed in to change notification settings

cityssm/dsJQuery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An attempt to simplify theXerox DocuShare API by modeling after the familiarjQuery API.

Need to talk to DocuShare from a NodeJS application?

Check outthe related node-docushare project.

Basic Usage

Be sure to include adsapi.jar that corresponds to your DocuShare installation,available on theDocuShare Developer Network website.

Developed and tested against DocuShare 6.6.1.

try {// Initialize the DSJQuery Session Handler with connection informationDSJQuerySessionHandler.serverSetup(ds_serverName);DSJQuerySessionHandler.sessionSetup(ds_domain,ds_userName,ds_password);// Create a new DSJquery object and retrieve the root collectionDSJQuerydsjQuery_rootCollection =newDSJQuery("#Collection-111");// Retrieve all documents under the root collectionDSJQuerydsjQuery_documents =dsjQuery_rootCollection.find(".Document");dsjQuery_documents        .print()        .sortAsc_byAttribute("title")        .print();}catch (Exceptione) {e.printStackTrace();}finally {// Close open DocuShare sessionsDSJQuerySessionHandler.closeOpenSessions();}

Key Methods

See the JavaDocs

DSJQuerySessionHandler.serverSetup(String serverName, int serverPort);

DSJQuerySessionHandler.serverSetup(String serverName);

  • Initializes the DSJQuery Session Handler with the DocuShare server details that should be used.
  • REQUIRED BEFORE USE.
  • Uses default port number 1099 if the shorthand method is used.

DSJQuerySessionHandler.sessionSetup(String userDomain, String userName, String password);

DSJQuerySessionHandler.sessionSetup(String userName, String password);

  • Initializes the DSJQuery Session Handler with the DocuShare session details that should be used.
  • REQUIRED BEFORE USE.
  • Uses default domain name "DocuShare" if the shorthand method is used.

dsjQuery.find(String selector);

Searches beneath all collections for objects that match the given selector.

  • Use* to select all child objects.
  • Use. to select by class.
    • i.e..Collection,.Document
  • Use# to select a specific object by handle.
    • i.e.#Collection-111

dsjQuery.filter(String selector);

Reduces the set of matched objects to those that match the selector.

  • Use. to filter by class. i.e..Collection,.Document
  • Use[name='value'] to filter those objects with attributes equal to a given value.
    • i.e.[locale='en']
  • Use[name^='value'] to filter those objects with attributes starting with a given value.
    • i.e.[content_type^='image/']
  • Use[name$='value'] to filter those objects with attributes ending with a given value.
    • i.e.[original_file_name$='.docx']
  • Use[name~='value'] to filter those objects with attributes containing a given value.
    • i.e.[keywords~='logo']

Samples Selectors

Retrieve all documents under known collection.

DSJQuerydsjQuery_documents =newDSJQuery("#Collection-111").find(".Document");

Retrieve all PNG documents with the word 'Logo' in the title sorted with the newer files first.

DSJQuerydsjQuery_documents =newDSJQuery(".Document")    .filter("[title~='Logo']")    .filter("[content_type='image/png']")    .sortAsc_byAttribute("create_date")    .reverse();

Troubleshooting "Couldn't get a stream to remote file" and "Connection refused to host"

If you are using dsJQuery to upload files, you may run into an exception similar to the one below.

com.xerox.docushare.content.ContentStoreException: Couldn't get a stream to remote file: C:\file.txt; nested exception is:java.rmi.ConnectException: Connection refused to host: 192.168.56.1; nested exception is:java.net.ConnectException: Connection refused: connect; nested exception is:com.xerox.docushare.DSContentElementException: Couldn't get a stream to remote file: C:\file.txt; nested exception is:java.rmi.ConnectException: Connection refused to host: 192.168.56.1; nested exception is:java.net.ConnectException: Connection refused: connect...

This happens when the remote method gets bound to an incorrect IP address.In my case, the IP address in the exception is associated with Virtualbox.

There are many ways to solve this.See this question on Stack Overflow.

Theanswer I chose explicitly sets thejava.rmi.server.hostname property,before initializing the Session Handler.

System.setProperty("java.rmi.server.hostname",properNetworkIpAddress);try {DSJQuerySessionHandler.serverSetup(ds_serverName);DSJQuerySessionHandler.sessionSetup(ds_domain,ds_userName,ds_password);// ...}// ...

About

DocuShare jQuery - A jQuery-like wrapper for the DocuShare Java API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp