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.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)
Add a user
void cleanup()
Cleanup all local cache
void deleteAnnotation(String annotId)
From remote: delete annotation
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 setCollabManagerListener(CollabManager.CollabManagerListener listener)
void setCurrentDocument(DocumentEntity entity)
Set the current document
void setCurrentDocument(String documentId)
Set the current document
void setCurrentUser(String userId, String userName)
Set the current user
void setCustomConnection(CustomService connection)
Use a custom CustomService instead of the default one
[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)

Add 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 (String annotId)

From remote: delete annotation

Parameters
annotId the unique identification of the annotation

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 setCollabManagerListener (CollabManager.CollabManagerListener listener)

public void setCurrentDocument (DocumentEntity entity)

Set the current document

Parameters
entity the DocumentEntity

public void setCurrentDocument (String documentId)

Set the current document

Parameters
documentId the unique identifier of the document

public void setCurrentUser (String userId, String userName)

Set the current user

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

public void setCustomConnection (CustomService connection)

Use 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