public class

CollabManager

extends Object
implements CustomService
java.lang.Object
   ↳ com.pdftron.collab.ui.viewer.CollabManager

Class Overview

The class responsible for import/export XFDF and/or XFDF command string.

Summary

Nested Classes
interface CollabManager.AnnotationCompletionListener  
interface CollabManager.CollabManagerListener  
Public Methods
void addAnnotation(AnnotationEntity annotation)
From remote: add annotation
void addAnnotations(HashMap<String, AnnotationEntity> annotations)
From remote: add annotations, commonly used for syncing initial annotations
void addUser(String userId, String userName)
Adds a user
void cleanup()
Cleanup all local cache
void deleteAnnotation(AnnotationEntity annotation)
From remote: delete annotation
void deleteAnnotation(String annotId)
From remote: delete annotation
CollabManager.AnnotationCompletionListener getAnnotationCompletionListener()
List<AnnotationEntity> getAnnotations()
String getCurrentDocument()
Gets the current document
String getLastXfdf()
Gets the last XFDF command string
DocumentViewModel getViewModel()
void importAnnotationCommand(String xfdfCommand)
Imports the XFDF command string to the document, commonly used for syncing initial annotations
void importAnnotationCommand(String xfdfCommand, boolean isInitialLoad)
Imports the XFDF command string to the document
void importAnnotations(String xfdf, boolean isInitialLoad)
Imports the XFDF string to the document
boolean isStarted()
Returns whether the collaboration session has a user registered If true, it is safe to start to subscribe events, false otherwise
void modifyAnnotation(AnnotationEntity annotation)
From remote: modify annotation
void sendAnnotation(String action, String xfdfCommand, ArrayList<AnnotationEntity> annotations, String documentId, String userName)
Send local change
void setAnnotationCompletionListener(CollabManager.AnnotationCompletionListener listener)
void setCollabManagerListener(CollabManager.CollabManagerListener listener)
void setCurrentDocument(DocumentEntity entity)
Sets the current document
void setCurrentDocument(String documentId)
Sets the current document
void setCurrentUser(String userId, String userName)
Sets the current user
void setCustomConnection(CustomService connection)
Uses a custom CustomService instead of the default one
void updateAnnotationServerId(String annotId, String serverId)
Updates annotation entry with the server database Id if different from annotation Id
void updateAnnotationServerIdSync(String annotId, String serverId)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pdftron.collab.service.CustomService

Public Methods

public void addAnnotation (AnnotationEntity annotation)

From remote: add annotation

Parameters
annotation the AnnotationEntity

public void addAnnotations (HashMap<String, AnnotationEntity> annotations)

From remote: add annotations, commonly used for syncing initial annotations

Parameters
annotations map of key=id, value=AnnotationEntity

public void addUser (String userId, String userName)

Adds a user

Parameters
userId the unique identifier of the user
userName the name of the user

public void cleanup ()

Cleanup all local cache

public void deleteAnnotation (AnnotationEntity annotation)

From remote: delete annotation

Parameters
annotation the AnnotationEntity

public void deleteAnnotation (String annotId)

From remote: delete annotation

Parameters
annotId the unique identification of the annotation

public List<AnnotationEntity> getAnnotations ()

public String getCurrentDocument ()

Gets the current document

Returns
  • the document ID

public String getLastXfdf ()

Gets the last XFDF command string

public DocumentViewModel getViewModel ()

public void importAnnotationCommand (String xfdfCommand)

Imports the XFDF command string to the document, commonly used for syncing initial annotations

Parameters
xfdfCommand the XFDF command string

public void importAnnotationCommand (String xfdfCommand, boolean isInitialLoad)

Imports the XFDF command string to the document

Parameters
xfdfCommand the XFDF command string
isInitialLoad whether this is the initial load XFDF string

public void importAnnotations (String xfdf, boolean isInitialLoad)

Imports the XFDF string to the document

Parameters
xfdf the XFDF string
isInitialLoad whether this is the initial load XFDF string

public boolean isStarted ()

Returns whether the collaboration session has a user registered If true, it is safe to start to subscribe events, false otherwise

public void modifyAnnotation (AnnotationEntity annotation)

From remote: modify annotation

Parameters
annotation the AnnotationEntity

public void sendAnnotation (String action, String xfdfCommand, ArrayList<AnnotationEntity> annotations, String documentId, String userName)

Send local change

Parameters
action one of add/modify/delete
xfdfCommand the annotation XFDF command string
annotations the annotation XFDF information
documentId the document identifier
userName optional user name, user unique identifier should be part of the XFDF command instead

public void setAnnotationCompletionListener (CollabManager.AnnotationCompletionListener listener)

public void setCollabManagerListener (CollabManager.CollabManagerListener listener)

public void setCurrentDocument (DocumentEntity entity)

Sets the current document

Parameters
entity the DocumentEntity

public void setCurrentDocument (String documentId)

Sets the current document

Parameters
documentId the unique identifier of the document

public void setCurrentUser (String userId, String userName)

Sets the current user

Parameters
userId the unique identifier of the user
userName the name of the user

public void setCustomConnection (CustomService connection)

Uses a custom CustomService instead of the default one

Parameters
connection the custom CustomService

Note: CollabTabHostListener.onSendAnnotation will not be raised if a custom service is used

public void updateAnnotationServerId (String annotId, String serverId)

Updates annotation entry with the server database Id if different from annotation Id

Parameters
annotId the annotation Id
serverId the server database Id if different from annotation Id

public void updateAnnotationServerIdSync (String annotId, String serverId)