org.exoplatform.clouddrive.sharepoint
Class SharepointAPI

java.lang.Object
  extended by org.exoplatform.clouddrive.cmis.CMISAPI
      extended by org.exoplatform.clouddrive.sharepoint.SharepointAPI

public class SharepointAPI
extends org.exoplatform.clouddrive.cmis.CMISAPI

All calls to Sharepoint API here.


Nested Class Summary
protected  class SharepointAPI.ChangesIterator
           
protected  class SharepointAPI.RESTClient
           
protected  class SharepointAPI.SPChangeToken
           
 class SharepointAPI.User
          SharePoint user data.
 
Nested classes/interfaces inherited from class org.exoplatform.clouddrive.cmis.CMISAPI
org.exoplatform.clouddrive.cmis.CMISAPI.ChangeToken, org.exoplatform.clouddrive.cmis.CMISAPI.ChildrenIterator, org.exoplatform.clouddrive.cmis.CMISAPI.Context, org.exoplatform.clouddrive.cmis.CMISAPI.TimeChangeToken
 
Field Summary
protected static org.exoplatform.services.log.Log LOG
           
protected static String MAJOR_VERSION_ID_SUFFIX
           
protected  SharepointAPI.RESTClient nativeClient
          HTTP client to native SP APIes.
protected  String password
          Access parameter for HTTP client to native SP APIes.
protected static String REST_CONTEXTINFO
           
protected static String REST_CURRENTUSER
           
protected static String REST_SITETITLE
           
protected  org.apache.http.HttpHost siteHost
           
protected  String siteTitle
          SharePoint site title.
protected  String siteURL
          Access parameter for HTTP client to native SP APIes.
protected  SharepointAPI.User siteUser
          Current SharePoint user.
protected  String userName
          Access parameter for HTTP client to native SP APIes.
 
Fields inherited from class org.exoplatform.clouddrive.cmis.CMISAPI
customDomain, EMPTY_TOKEN, emptyToken, enterpriseId, enterpriseName, FILE_PROPERTY_SET, fileContext, FOLDER_PAGE_SIZE, FOLDER_PROPERTY_SET, folderContext, NO_STATE, OBJECT_PAGE_SIZE, parameters, productName, productVersion, repositoryId, repositoryName, session, TOKEN_DATATIME_FORMAT, vendorName
 
Constructor Summary
protected SharepointAPI(String serviceURL, String userName, String password)
          Create API from user credentials.
 
Method Summary
protected  String documentId(String id)
          Deprecated. 
protected  SharepointAPI.ChangesIterator getChanges(org.exoplatform.clouddrive.cmis.CMISAPI.ChangeToken changeToken)
          
protected  String getPassword()
          
 String getRepositoryId()
          
protected  String getServiceURL()
          
 String getSiteTitle()
           
 String getSiteURL()
           
 SharepointAPI.User getSiteUser()
           
protected  String getUser()
          
 String getUserTitle()
          
protected  String readError(org.exoplatform.ws.frameworks.json.value.JsonValue json)
           
protected  org.exoplatform.ws.frameworks.json.value.JsonValue readJson(org.apache.http.HttpResponse resp)
           
protected  String readSiteTitle()
          Read site name from ShapePoint API.
protected  SharepointAPI.User readSiteUser()
          Read current user name from ShapePoint API.
protected  String readText(org.apache.http.HttpResponse resp)
           
protected  org.exoplatform.clouddrive.cmis.CMISAPI.ChangeToken readToken(String tokenString)
          
protected  org.apache.chemistry.opencmis.client.api.CmisObject rename(String newName, org.apache.chemistry.opencmis.client.api.CmisObject obj, org.apache.chemistry.opencmis.client.api.Session session)
          
protected  String simpleId(String id)
          Deprecated. 
 
Methods inherited from class org.exoplatform.clouddrive.cmis.CMISAPI
binding, copyDocument, copyDocument, copyFolder, copyFolder, createDocument, createFolder, deleteDocument, deleteFolder, emptyToken, formatTokenTime, getAllVersion, getFolderItems, getLatestDocumentVersionOrPWC, getLink, getLink, getObject, getParamaters, getParents, getProductName, getProductVersion, getRepositories, getRepositoryInfo, getRepositoryName, getRootFolder, getVendorName, initRepository, isDocument, isFileable, isFolder, isRelationship, isSyncableChange, isVersionable, readDocumentVersionOrPWC, readObject, readToken, repositories, session, session, shouldCheckinRename, updateContent, updateObject, updateUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.exoplatform.services.log.Log LOG

MAJOR_VERSION_ID_SUFFIX

protected static final String MAJOR_VERSION_ID_SUFFIX
See Also:
Constant Field Values

REST_CONTEXTINFO

protected static final String REST_CONTEXTINFO
See Also:
Constant Field Values

REST_CURRENTUSER

protected static final String REST_CURRENTUSER
See Also:
Constant Field Values

REST_SITETITLE

protected static final String REST_SITETITLE
See Also:
Constant Field Values

siteURL

protected final String siteURL
Access parameter for HTTP client to native SP APIes.


userName

protected final String userName
Access parameter for HTTP client to native SP APIes.


password

protected final String password
Access parameter for HTTP client to native SP APIes.


siteHost

protected final org.apache.http.HttpHost siteHost

nativeClient

protected final SharepointAPI.RESTClient nativeClient
HTTP client to native SP APIes.


siteUser

protected final SharepointAPI.User siteUser
Current SharePoint user.


siteTitle

protected final String siteTitle
SharePoint site title.

Constructor Detail

SharepointAPI

protected SharepointAPI(String serviceURL,
                        String userName,
                        String password)
                 throws org.exoplatform.clouddrive.cmis.CMISException,
                        org.exoplatform.clouddrive.CloudDriveException
Create API from user credentials.

Parameters:
serviceURL - String
userName - String
password - String
Throws:
org.exoplatform.clouddrive.cmis.CMISException
org.exoplatform.clouddrive.CloudDriveException
Method Detail

getChanges

protected SharepointAPI.ChangesIterator getChanges(org.exoplatform.clouddrive.cmis.CMISAPI.ChangeToken changeToken)
                                            throws org.exoplatform.clouddrive.cmis.CMISException,
                                                   org.exoplatform.clouddrive.CloudDriveAccessException

Overrides:
getChanges in class org.exoplatform.clouddrive.cmis.CMISAPI
Throws:
org.exoplatform.clouddrive.cmis.CMISException
org.exoplatform.clouddrive.CloudDriveAccessException

getUserTitle

public String getUserTitle()

Overrides:
getUserTitle in class org.exoplatform.clouddrive.cmis.CMISAPI

getUser

protected String getUser()

Overrides:
getUser in class org.exoplatform.clouddrive.cmis.CMISAPI

getPassword

protected String getPassword()

Overrides:
getPassword in class org.exoplatform.clouddrive.cmis.CMISAPI

getServiceURL

protected String getServiceURL()

Overrides:
getServiceURL in class org.exoplatform.clouddrive.cmis.CMISAPI

getRepositoryId

public String getRepositoryId()

Overrides:
getRepositoryId in class org.exoplatform.clouddrive.cmis.CMISAPI

getSiteUser

public SharepointAPI.User getSiteUser()
Returns:
the siteUser

getSiteTitle

public String getSiteTitle()
Returns:
the siteTitle

getSiteURL

public String getSiteURL()
Returns:
the siteURL

readSiteTitle

protected String readSiteTitle()
                        throws SharepointServiceNotFound,
                               SharepointException,
                               org.exoplatform.clouddrive.CloudDriveAccessException
Read site name from ShapePoint API.

Returns:
Throws:
SharepointException
SharepointServiceNotFound
org.exoplatform.clouddrive.CloudDriveAccessException

readSiteUser

protected SharepointAPI.User readSiteUser()
                                   throws SharepointException,
                                          SharepointServiceNotFound,
                                          org.exoplatform.clouddrive.CloudDriveAccessException
Read current user name from ShapePoint API.

Returns:
Throws:
SharepointException
SharepointServiceNotFound
org.exoplatform.clouddrive.CloudDriveAccessException

readJson

protected org.exoplatform.ws.frameworks.json.value.JsonValue readJson(org.apache.http.HttpResponse resp)
                                                               throws org.exoplatform.ws.frameworks.json.impl.JsonException,
                                                                      IllegalStateException,
                                                                      IOException,
                                                                      SharepointException
Throws:
org.exoplatform.ws.frameworks.json.impl.JsonException
IllegalStateException
IOException
SharepointException

readText

protected String readText(org.apache.http.HttpResponse resp)
                   throws IllegalStateException,
                          IOException
Throws:
IllegalStateException
IOException

readError

protected String readError(org.exoplatform.ws.frameworks.json.value.JsonValue json)

readToken

protected org.exoplatform.clouddrive.cmis.CMISAPI.ChangeToken readToken(String tokenString)
                                                                 throws org.exoplatform.clouddrive.cmis.CMISException

Overrides:
readToken in class org.exoplatform.clouddrive.cmis.CMISAPI
Throws:
org.exoplatform.clouddrive.cmis.CMISException

rename

protected org.apache.chemistry.opencmis.client.api.CmisObject rename(String newName,
                                                                     org.apache.chemistry.opencmis.client.api.CmisObject obj,
                                                                     org.apache.chemistry.opencmis.client.api.Session session)

Overrides:
rename in class org.exoplatform.clouddrive.cmis.CMISAPI

documentId

@Deprecated
protected String documentId(String id)
Deprecated. 

Add SP document's major version suffix '-512' to given object ID if it doesn't end with it already.

Parameters:
id - String original ID
Returns:
object ID with SP suffix for CMIS document type

simpleId

@Deprecated
protected String simpleId(String id)
Deprecated. 

Remove SP document suffix '-512' in given object ID if it ends with it.
NOTE: it is not documented SP feature.

Parameters:
id - String object ID
Returns:
object ID without SP suffix for CMIS document type


Copyright © 2003–2015 eXo Platform SAS. All rights reserved.