Difference between revisions of "Java SDK"

From OpenKM Documentation
Jump to: navigation, search
Line 45: Line 45:
 
}
 
}
 
</source>
 
</source>
 +
 +
=== Object classes ===
 +
* AppVersion
 +
* CheckBox
 +
* Document
 +
* DocumentList
 +
* Folder
 +
* FolderList
 +
* FormElement
 +
* FormElementComplex
 +
* FormElementComplexList
 +
* GrantedRole
 +
* GrantedRoleList
 +
* GrantedUser
 +
* GrantedUserList
 +
* Input
 +
* KeywordMap
 +
* KeywordMapList
 +
* LanguageList
 +
* LockInfo
 +
* Node
 +
* Note
 +
* NoteList
 +
* Option
 +
* PropertyGroup
 +
* PropertyGroupList
 +
* ProposedQueryReceived
 +
* ProposedQuerySent
 +
* QueryParamsList
 +
* QueryResult
 +
* QueryResultList
 +
* QueryParams
 +
* ResultSet
 +
* RoleList
 +
* Select
 +
* Separator
 +
* SimplePropertyGroup
 +
* SuggestBox
 +
* TextArea
 +
* UserList
 +
* Validator
 +
* Version
 +
* VersionList
  
 
[[Category: Extension Guide]]
 
[[Category: Extension Guide]]

Revision as of 19:40, 26 November 2013


Nota advertencia.png Unders construction

Supported OpenKM Versions:

  • OpenKM Professional 6.4.5+
  • OpenKM Professional 6.2.23+
  • OpenKM Community ( expected release time to february 2014 )

Advantage of use

We recommend to use OKMWebservices from jar because it implements an extra layer between webservices and logic -factory- which allow transparently change between webservices versions without major effors. Simply instance other webservices version from factory in your source code.

Example

String host = "http://localhost:8080/OpenKM";
String user = "okmAdmin";
String password = "admin";
OKMWebservices ws= OKMWebservicesFactory.newInstance(OKMWebservicesFactory.PROFESSIONAL_6_4, host, user, password);
try {
	System.out.println(ws.getName("okmAdmin"));
	System.out.println(ws.getRoles());
	System.out.println(ws.getRolesByUser("okmAdmin"));
	System.out.println(ws.getGrantedRoles("/okm:root"));
	System.out.println(ws.getGrantedUsers("/okm:root"));
	System.out.println(ws.getMail("okmAdmin"));
	System.out.println(ws.getName("okmAdmin"));
	System.out.println(ws.getUsers());
	System.out.println(ws.getUsersByRole("ROLE_ADMIN"));
	ws.revokeRole("/okm:root", "ROLE_ADMIN", Permission.ALL_GRANTS, false);
	ws.revokeUser("/okm:root", "okmAdmin", Permission.ALL_GRANTS, false);
	ws.grantRole("/okm:root", "ROLE_ADMIN", Permission.ALL_GRANTS, false);
	ws.grantUser("/okm:root", "okmAdmin", Permission.ALL_GRANTS, false);
} catch (DatabaseException e) {
	e.printStackTrace();
} catch (RepositoryException e) {
	e.printStackTrace();
} catch (PrincipalAdapterException e) {
	e.printStackTrace();
} catch (AccessDeniedException e) {
	e.printStackTrace();
} catch (WebserviceException e) {
	e.printStackTrace();
} catch (PathNotFoundException e) {			
	e.printStackTrace();
} catch (UnknowException e) {
	e.printStackTrace();
}

Object classes

  • AppVersion
  • CheckBox
  • Document
  • DocumentList
  • Folder
  • FolderList
  • FormElement
  • FormElementComplex
  • FormElementComplexList
  • GrantedRole
  • GrantedRoleList
  • GrantedUser
  • GrantedUserList
  • Input
  • KeywordMap
  • KeywordMapList
  • LanguageList
  • LockInfo
  • Node
  • Note
  • NoteList
  • Option
  • PropertyGroup
  • PropertyGroupList
  • ProposedQueryReceived
  • ProposedQuerySent
  • QueryParamsList
  • QueryResult
  • QueryResultList
  • QueryParams
  • ResultSet
  • RoleList
  • Select
  • Separator
  • SimplePropertyGroup
  • SuggestBox
  • TextArea
  • UserList
  • Validator
  • Version
  • VersionList