public class OnlyofficeEditorServiceImpl extends Object implements OnlyofficeEditorService, org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<String,ConcurrentHashMap<String,Config>> |
active
Editing documents.
|
protected URI |
baseWebdavUri |
protected Map<String,String> |
config |
static String |
CONFIG_DS_ACCESS_ONLY |
static String |
CONFIG_DS_HOST |
static String |
CONFIG_DS_SCHEMA |
static String |
CONFIG_HOST |
static String |
CONFIG_SCHEMA |
protected boolean |
documentserverAccessOnly |
protected String |
documentserverHost |
protected String |
documentserverUrl |
protected Map<String,String> |
fileTypes |
protected NodeFinder |
finder |
protected org.exoplatform.services.security.IdentityRegistry |
identityRegistry |
protected org.exoplatform.services.jcr.RepositoryService |
jcrService |
protected ConcurrentLinkedQueue<OnlyofficeEditorListener> |
listeners |
protected static int |
LOCK_WAIT_ATTEMTS |
protected static long |
LOCK_WAIT_TIMEOUT |
protected static org.exoplatform.services.log.Log |
LOG |
protected org.exoplatform.services.organization.OrganizationService |
organization |
protected String |
platformUrl |
protected static Random |
RANDOM |
protected org.exoplatform.services.jcr.ext.app.SessionProviderService |
sessionProviders |
protected static String |
TYPE_PRESENTATION |
protected static String |
TYPE_SPREADSHEET |
protected static String |
TYPE_TEXT |
protected MessageFormat |
uploadParams |
protected String |
uploadUrl |
| Constructor and Description |
|---|
OnlyofficeEditorServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
NodeFinder finder,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.container.xml.InitParams params)
Cloud Drive service with storage in JCR and with managed features.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(OnlyofficeEditorListener listener)
Add listener to the service.
|
boolean |
canDownloadBy(String hostName)
Check does given host can download document content by this service.
|
protected javax.jcr.version.Version |
checkin(javax.jcr.Node node)
Deprecated.
|
protected boolean |
checkout(javax.jcr.Node node) |
Config |
createEditor(String userId,
String workspace,
String path)
Create an editor config for given config node.
|
protected javax.jcr.Property |
data(javax.jcr.Node content) |
protected String |
documentType(String fileType) |
protected void |
download(Config config,
DocumentStatus status) |
protected void |
downloadChange(Config config)
Deprecated.
|
protected String |
fileType(javax.jcr.Node node) |
protected void |
fireCreated(Config config) |
protected void |
fireError(Config config) |
protected void |
fireGet(Config config) |
protected void |
fireJoined(Config config) |
protected void |
fireLeaved(Config config) |
protected void |
fireSaved(Config config) |
protected UUID |
generateId(String workspace,
String path) |
DocumentContent |
getContent(String userId,
String key)
Get file content.
|
protected String[] |
getCurrentUsers(ConcurrentHashMap<String,Config> configs) |
protected Config |
getEditor(String userId,
String nodePath) |
Config |
getEditor(String userId,
String workspace,
String path)
Return existing editor for given user and node.
|
ChangeState |
getState(String userId,
String key)
Local state of editing document.
|
protected org.exoplatform.services.organization.User |
getUser(String username) |
protected String |
getUserLang(String userId) |
protected javax.jcr.lock.Lock |
lock(javax.jcr.Node node,
Config config)
Lock by current user of the node.
|
protected String |
mimeType(javax.jcr.Node content) |
protected javax.jcr.Node |
node(String workspace,
String path) |
protected javax.jcr.Node |
nodeContent(javax.jcr.Node node) |
protected Calendar |
nodeCreated(javax.jcr.Node node) |
protected String |
nodePath(Config config) |
protected String |
nodePath(String workspace,
String path) |
protected String |
nodeTitle(javax.jcr.Node node) |
void |
removeListener(OnlyofficeEditorListener listener)
Remove listener from the service.
|
void |
start()
On-start initializer.
|
void |
stop()
On-stop finalizer.
|
protected void |
syncUsers(ConcurrentHashMap<String,Config> configs,
String[] users) |
protected javax.jcr.Node |
systemNode(String workspace,
String path) |
protected void |
trackChange(Config config,
DocumentStatus status)
Deprecated.
|
protected boolean |
unlock(javax.jcr.Node node,
Config config)
Deprecated.
|
void |
updateDocument(String userId,
DocumentStatus status)
Update a config associated with given editor
Config instance. |
protected String |
uploadContent(InputStream localContent,
String fileKey,
String mimeType,
long length)
Deprecated.
|
protected void |
validateUser(String userId,
Config config) |
protected String |
webdavUrl(String workspace,
String path) |
protected static final org.exoplatform.services.log.Log LOG
protected static final Random RANDOM
public static final String CONFIG_HOST
public static final String CONFIG_SCHEMA
public static final String CONFIG_DS_HOST
public static final String CONFIG_DS_SCHEMA
public static final String CONFIG_DS_ACCESS_ONLY
protected static final String TYPE_TEXT
protected static final String TYPE_SPREADSHEET
protected static final String TYPE_PRESENTATION
protected static final int LOCK_WAIT_ATTEMTS
protected static final long LOCK_WAIT_TIMEOUT
protected final org.exoplatform.services.jcr.RepositoryService jcrService
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected final org.exoplatform.services.security.IdentityRegistry identityRegistry
protected final NodeFinder finder
protected final org.exoplatform.services.organization.OrganizationService organization
protected final ConcurrentHashMap<String,ConcurrentHashMap<String,Config>> active
protected final String platformUrl
protected final String uploadUrl
protected final String documentserverHost
protected final String documentserverUrl
protected final boolean documentserverAccessOnly
protected final URI baseWebdavUri
protected final MessageFormat uploadParams
protected final ConcurrentLinkedQueue<OnlyofficeEditorListener> listeners
public OnlyofficeEditorServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
NodeFinder finder,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.container.xml.InitParams params)
throws org.exoplatform.container.configuration.ConfigurationException
jcrService - RepositoryServicesessionProviders - SessionProviderServicefeatures - CloudDriveFeaturesorg.exoplatform.container.configuration.ConfigurationExceptionpublic void addListener(OnlyofficeEditorListener listener)
addListener in interface OnlyofficeEditorServicepublic void removeListener(OnlyofficeEditorListener listener)
removeListener in interface OnlyofficeEditorServicepublic Config getEditor(String userId, String workspace, String path) throws OnlyofficeEditorException, javax.jcr.RepositoryException
null will be returned.getEditor in interface OnlyofficeEditorServiceuserId - Stringworkspace - Stringpath - StringConfig or nullOnlyofficeEditorExceptionjavax.jcr.RepositoryExceptionprotected Config getEditor(String userId, String nodePath) throws OnlyofficeEditorException, javax.jcr.RepositoryException
OnlyofficeEditorExceptionjavax.jcr.RepositoryExceptionpublic Config createEditor(String userId, String workspace, String path) throws OnlyofficeEditorException, javax.jcr.RepositoryException
createEditor in interface OnlyofficeEditorServiceuserId - Stringworkspace - Stringpath - StringConfig instance in case of successful creation or null if local file type
not supported.OnlyofficeEditorException - if editor exception happenedjavax.jcr.RepositoryException - if storage exception happenedpublic DocumentContent getContent(String userId, String key) throws OnlyofficeEditorException, javax.jcr.RepositoryException
getContent in interface OnlyofficeEditorServiceuserId - Stringkey - StringDocumentContentOnlyofficeEditorExceptionjavax.jcr.RepositoryExceptionpublic boolean canDownloadBy(String hostName)
canDownloadBy in interface OnlyofficeEditorServicehostName - Stringtrue if client host with given name can download document content,
false otherwise.public ChangeState getState(String userId, String key) throws OnlyofficeEditorException
getState in interface OnlyofficeEditorServiceuserId - Stringkey - StringChangeStateOnlyofficeEditorExceptionpublic void updateDocument(String userId, DocumentStatus status) throws OnlyofficeEditorException, javax.jcr.RepositoryException
Config instance. A Node from that the
config was created will be updated. This operation will close the editor and it will not be usable
after that.updateDocument in interface OnlyofficeEditorServiceuserId - Stringstatus - DocumentStatusOnlyofficeEditorException - if editor exception happenedjavax.jcr.RepositoryException - if storage exception happenedpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startableprotected String nodeTitle(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String fileType(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected javax.jcr.Node nodeContent(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected Calendar nodeCreated(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String mimeType(javax.jcr.Node content) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected javax.jcr.Property data(javax.jcr.Node content)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected org.exoplatform.services.organization.User getUser(String username) throws OnlyofficeEditorException
OnlyofficeEditorExceptionprotected String webdavUrl(String workspace, String path) throws OnlyofficeEditorException, javax.jcr.RepositoryException
OnlyofficeEditorExceptionjavax.jcr.RepositoryException@Deprecated protected String uploadContent(InputStream localContent, String fileKey, String mimeType, long length) throws IOException, OnlyofficeEditorException
IOExceptionOnlyofficeEditorExceptionprotected void syncUsers(ConcurrentHashMap<String,Config> configs, String[] users)
protected String[] getCurrentUsers(ConcurrentHashMap<String,Config> configs)
protected void download(Config config, DocumentStatus status) throws OnlyofficeEditorException, javax.jcr.RepositoryException
OnlyofficeEditorExceptionjavax.jcr.RepositoryException@Deprecated protected void downloadChange(Config config) throws OnlyofficeEditorException, javax.jcr.RepositoryException
OnlyofficeEditorExceptionjavax.jcr.RepositoryException@Deprecated protected void trackChange(Config config, DocumentStatus status) throws BadParameterException, OnlyofficeEditorException, javax.jcr.RepositoryException
BadParameterExceptionOnlyofficeEditorExceptionjavax.jcr.RepositoryExceptionprotected javax.jcr.Node node(String workspace, String path) throws BadParameterException, javax.jcr.RepositoryException
BadParameterExceptionjavax.jcr.RepositoryExceptionprotected javax.jcr.Node systemNode(String workspace, String path) throws BadParameterException, javax.jcr.RepositoryException
BadParameterExceptionjavax.jcr.RepositoryExceptionprotected boolean checkout(javax.jcr.Node node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException@Deprecated protected javax.jcr.version.Version checkin(javax.jcr.Node node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected javax.jcr.lock.Lock lock(javax.jcr.Node node,
Config config)
throws OnlyofficeEditorException,
javax.jcr.RepositoryException
OnlyofficeEditorException. If node isn't mix:versionable it will be added first and node saved.node - Nodeconfig - ConfigLock acquired by current user.OnlyofficeEditorExceptionjavax.jcr.RepositoryException@Deprecated protected boolean unlock(javax.jcr.Node node, Config config) throws OnlyofficeEditorException, javax.jcr.RepositoryException
OnlyofficeEditorExceptionjavax.jcr.RepositoryExceptionprotected void validateUser(String userId, Config config) throws OnlyofficeEditorException
OnlyofficeEditorExceptionprotected String getUserLang(String userId) throws OnlyofficeEditorException
OnlyofficeEditorExceptionprotected void fireCreated(Config config)
protected void fireGet(Config config)
protected void fireJoined(Config config)
protected void fireLeaved(Config config)
protected void fireSaved(Config config)
protected void fireError(Config config)
Copyright © 2003–2016 eXo Platform SAS. All rights reserved.