public class OutlookServiceImpl extends Object implements OutlookService, org.picocontainer.Startable
| Modifier and Type | Class and Description |
|---|---|
protected class |
OutlookServiceImpl.OutlookSpaceImpl |
protected class |
OutlookServiceImpl.PersonalDocumentsFolder |
protected class |
OutlookServiceImpl.UserFile |
protected class |
OutlookServiceImpl.UserFolder |
protected class |
OutlookServiceImpl.UserImpl |
| Modifier and Type | Field and Description |
|---|---|
protected static com.ibm.icu.text.Transliterator |
accentsConverter |
protected org.owasp.html.PolicyFactory |
activityPolicy
Custom policy to allow supported elements in activity text as described in
Platform User Guide
|
protected ConcurrentHashMap<String,OutlookUser> |
authenticated
Authenticated users.
|
protected org.exoplatform.services.cms.drives.ManageDriveService |
driveService |
protected static String |
EXO_PRIVILEGEABLE |
protected NodeFinder |
finder |
protected org.exoplatform.forum.service.ForumService |
forumService |
protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator |
hierarchyCreator |
protected org.owasp.html.PolicyFactory |
htmlPolicy |
protected org.exoplatform.services.jcr.RepositoryService |
jcrService |
protected Pattern |
linkWithoutTarget |
protected Pattern |
linkWithTarget |
protected org.exoplatform.services.listener.ListenerService |
listenerService |
protected static org.exoplatform.services.log.Log |
LOG |
static String |
MAILSERVER_URL |
protected MailAPI |
mailserverApi |
protected static String[] |
MANAGER_PERMISSION |
protected org.exoplatform.services.organization.OrganizationService |
organization |
protected static String |
OUTLOOK_MESSAGES_NAME |
protected static String |
OUTLOOK_MESSAGES_TITLE |
protected static String |
PERSONAL_DOCUMENTS |
protected static Random |
RANDOM |
protected static String[] |
READER_PERMISSION |
protected org.exoplatform.services.resources.ResourceBundleService |
resourceBundleService |
protected org.exoplatform.services.jcr.ext.app.SessionProviderService |
sessionProviders |
protected ConcurrentHashMap<String,OutlookServiceImpl.OutlookSpaceImpl> |
spaces
Spaces cache.
|
protected static String |
SPACES_HOME |
protected org.owasp.html.PolicyFactory |
textPolicy |
protected String |
trashHomePath |
protected org.exoplatform.services.cms.documents.TrashService |
trashService |
protected static String |
UPLAODS_FOLDER_TITLE |
protected static String |
WIKI_PERMISSION_ANY |
protected org.exoplatform.wiki.rendering.RenderingService |
wikiRenderingService |
protected org.exoplatform.wiki.service.WikiService |
wikiService |
GROUP_DRIVE_PARRTEN, MESSAGE_NODETYPE, PERSONAL_DRIVE_PARRTEN| Constructor and Description |
|---|
OutlookServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
NodeFinder finder,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.services.cms.drives.ManageDriveService driveService,
org.exoplatform.services.cms.documents.TrashService trashService,
org.exoplatform.wiki.service.WikiService wikiService,
org.exoplatform.forum.service.ForumService forumService,
org.exoplatform.wiki.rendering.RenderingService wikiRenderingService,
org.exoplatform.services.resources.ResourceBundleService resourceBundleService,
org.exoplatform.container.xml.InitParams params)
Outlook service with storage in JCR and with managed features.
|
| Modifier and Type | Method and Description |
|---|---|
protected javax.jcr.Node |
addFile(javax.jcr.Node parent,
String title,
String contentType,
InputStream content)
Add nt:file node for given content stream and title.
|
protected javax.jcr.Node |
addFolder(javax.jcr.Node parent,
String title,
boolean forceNew)
Add nt:folder node with given title.
|
protected javax.jcr.Node |
addMessageFile(javax.jcr.Node parent,
OutlookMessage message) |
OutlookMessage |
buildMessage(String id,
OutlookUser user,
OutlookEmail from,
List<OutlookEmail> to,
Calendar created,
Calendar modified,
String subject,
String body)
Build Outlook message object.
|
protected boolean |
checkForumHasAddTopic(org.exoplatform.forum.service.UserProfile userProfile,
String categoryId,
String forumId) |
protected boolean |
checkout(javax.jcr.Node node) |
static String |
cleanName(String name)
Make JCR compatible item name.
|
protected org.exoplatform.forum.service.Topic |
createForumTopic(String categoryId,
String forumId,
String creator,
String title,
String summary,
String content)
Method inspired by code of UIPostForm.
|
protected org.exoplatform.wiki.mow.api.Page |
createWikiPage(String wikiType,
String wikiOwner,
String creator,
String title,
String summary,
String content,
List<String> users)
Method adapted from eXo Chat's WikiService.createOrEditPage().
|
protected String |
currentUserId() |
protected Locale |
currentUserLocale() |
protected javax.jcr.Property |
data(javax.jcr.Node content) |
protected void |
fetchQuery(javax.jcr.query.QueryResult qr,
int limit,
Set<File> res) |
protected UUID |
generateId(String workspace,
String path) |
OutlookEmail |
getAddress(String email,
String displayName)
Build Outlook Email address object.
|
protected org.exoplatform.services.organization.User |
getExoUser(String userName) |
Folder |
getFolder(Folder parent,
String path)
Deprecated.
|
Folder |
getFolder(String path)
Deprecated.
|
OutlookMessage |
getMessage(OutlookUser user,
String messageId,
String messageToken)
Read Outlook message from server.
|
OutlookSpace |
getSpace(String groupId)
Return Office space handler.
|
OutlookUser |
getUser(String email,
String displayName,
String ewsUrl)
Build Outlook user object and associate it with current user in eXo portal.
|
UserDocuments |
getUserDocuments() |
List<OutlookSpace> |
getUserSpaces() |
protected String |
groupDocsPath(String groupId)
Generate the group documents (as /Groups/spaces/$SPACE_GROUP_ID/Documents).
|
protected String |
groupPath(String groupId)
Generate the group node path (as /Groups/spaces/$SPACE_GROUP_ID).
|
protected void |
initDocumentLink(OutlookServiceImpl.PersonalDocumentsFolder personalDocuments,
HierarchyNode file) |
protected void |
initDocumentLink(OutlookSpace space,
HierarchyNode file) |
protected void |
initDocumentLink(org.exoplatform.portal.mop.SiteType siteType,
String driveName,
String portalName,
String nodeURI,
HierarchyNode node) |
protected void |
initWebDAVLink(HierarchyNode node) |
protected boolean |
isHTML(String content)
Try detect is it a HTML content in the string.
|
protected boolean |
isNotNull(org.exoplatform.ws.frameworks.json.value.JsonValue json) |
protected boolean |
isNull(org.exoplatform.ws.frameworks.json.value.JsonValue json) |
protected String |
makeLinksOpenNewWindow(String text) |
protected javax.jcr.Node |
messagesFolder(javax.jcr.Node parent,
String... identity) |
protected String |
messageSummary(OutlookMessage message)
Generate message summary text.
|
protected String |
mimeType(javax.jcr.Node content) |
protected javax.jcr.Node |
node(String nodePath) |
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 |
nodeTitle(javax.jcr.Node node) |
protected org.exoplatform.social.core.activity.model.ExoSocialActivity |
postAttachmentActivity(Folder destFolder,
List<File> files,
OutlookUser user,
String comment) |
protected OutlookEmail |
readEmail(org.exoplatform.ws.frameworks.json.value.JsonValue vElem) |
protected String |
safeActivityMessage(String text)
Allow only activity tags as described in
https://www.exoplatform.com/docs/PLF43/PLFUserGuide.GettingStarted.ActivitiesInActivityStream.HTMLTags.
|
protected String |
safeHtml(String content)
Allow full rage of HTML text and structures.
|
protected String |
safeText(String content)
Allow only plain text.
|
List<File> |
saveAttachment(Folder destFolder,
OutlookUser user,
String comment,
String messageId,
String attachmentToken,
String... attachmentIds) |
List<File> |
saveAttachment(OutlookSpace space,
Folder destFolder,
OutlookUser user,
String comment,
String messageId,
String attachmentToken,
String... attachmentIds) |
protected void |
setPermissionForWikiPage(List<String> users,
org.exoplatform.wiki.mow.api.Page page,
org.exoplatform.wiki.mow.api.Page parentPage)
Method adapted from eXo Chat's WikiService.setPermissionForReportAsWiki().
|
protected void |
setPermissions(javax.jcr.Node node,
boolean deep,
boolean forcePrivilegeable,
String... identities)
Set read permissions on the target node to all given identities (e.g.
|
protected void |
setPermissions(javax.jcr.Node node,
String... identities)
Set read permissions on the target node to all given identities (e.g.
|
protected org.exoplatform.social.core.manager.ActivityManager |
socialActivityManager() |
protected org.exoplatform.social.core.manager.IdentityManager |
socialIdentityManager() |
protected javax.jcr.Node |
spaceDocumentsNode(String groupId)
Find given group Documents folder using current user session.
|
protected org.exoplatform.social.core.space.spi.SpaceService |
spaceService() |
void |
start()
On-start initializer.
|
void |
stop()
On-stop finalizer.
|
protected javax.jcr.Node |
systemNode(String workspace,
String path) |
protected String |
userDocsPath(String userId)
Generate the user documents (as /Users/${userId}/Private/Documents).
|
protected javax.jcr.Node |
userDocumentsNode(String userName)
Find given user Personal Documents folder using user session.
|
protected List<OutlookSpace> |
userSpaces(String userId) |
public static final String MAILSERVER_URL
protected static final String EXO_PRIVILEGEABLE
protected static final String OUTLOOK_MESSAGES_TITLE
protected static final String OUTLOOK_MESSAGES_NAME
protected static final String WIKI_PERMISSION_ANY
protected static final String UPLAODS_FOLDER_TITLE
protected static final String SPACES_HOME
protected static final String PERSONAL_DOCUMENTS
protected static final String[] READER_PERMISSION
protected static final String[] MANAGER_PERMISSION
protected static final org.exoplatform.services.log.Log LOG
protected static final Random RANDOM
protected static final com.ibm.icu.text.Transliterator accentsConverter
protected final org.exoplatform.services.jcr.RepositoryService jcrService
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected final NodeFinder finder
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator
protected final org.exoplatform.services.organization.OrganizationService organization
protected final org.exoplatform.services.cms.drives.ManageDriveService driveService
protected final org.exoplatform.services.listener.ListenerService listenerService
protected final org.exoplatform.wiki.service.WikiService wikiService
protected final org.exoplatform.forum.service.ForumService forumService
protected final org.exoplatform.services.cms.documents.TrashService trashService
protected final org.exoplatform.wiki.rendering.RenderingService wikiRenderingService
protected final org.exoplatform.services.resources.ResourceBundleService resourceBundleService
protected final org.owasp.html.PolicyFactory htmlPolicy
protected final org.owasp.html.PolicyFactory textPolicy
protected final org.owasp.html.PolicyFactory activityPolicy
protected final Pattern linkWithTarget
protected final Pattern linkWithoutTarget
protected final ConcurrentHashMap<String,OutlookUser> authenticated
protected final ConcurrentHashMap<String,OutlookServiceImpl.OutlookSpaceImpl> spaces
protected MailAPI mailserverApi
protected String trashHomePath
public OutlookServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
NodeFinder finder,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.services.cms.drives.ManageDriveService driveService,
org.exoplatform.services.cms.documents.TrashService trashService,
org.exoplatform.wiki.service.WikiService wikiService,
org.exoplatform.forum.service.ForumService forumService,
org.exoplatform.wiki.rendering.RenderingService wikiRenderingService,
org.exoplatform.services.resources.ResourceBundleService resourceBundleService,
org.exoplatform.container.xml.InitParams params)
throws org.exoplatform.container.configuration.ConfigurationException,
MailServerException
jcrService - RepositoryServicesessionProviders - SessionProviderServicehierarchyCreator - NodeHierarchyCreatorfinder - NodeFinderorganization - OrganizationServicedriveService - ManageDriveServicelistenerService - ListenerServicewikiService - WikiServiceforumService - ForumServicetrashService - TrashServicewikiRenderingService - RenderingServiceresourceBundleService - ResourceBundleServiceparams - InitParamsorg.exoplatform.container.configuration.ConfigurationException - when parameters configuration errorMailServerException - when Mail server API error@Deprecated public Folder getFolder(String path) throws OutlookException, javax.jcr.RepositoryException
getFolder in interface OutlookServiceOutlookExceptionjavax.jcr.RepositoryException@Deprecated public Folder getFolder(Folder parent, String path) throws OutlookException, javax.jcr.RepositoryException
getFolder in interface OutlookServiceOutlookExceptionjavax.jcr.RepositoryExceptionpublic List<File> saveAttachment(OutlookSpace space, Folder destFolder, OutlookUser user, String comment, String messageId, String attachmentToken, String... attachmentIds) throws OutlookException, javax.jcr.RepositoryException
saveAttachment in interface OutlookServiceOutlookExceptionjavax.jcr.RepositoryExceptionpublic List<File> saveAttachment(Folder destFolder, OutlookUser user, String comment, String messageId, String attachmentToken, String... attachmentIds) throws OutlookException, javax.jcr.RepositoryException
saveAttachment in interface OutlookServiceOutlookExceptionjavax.jcr.RepositoryExceptionpublic OutlookEmail getAddress(String email, String displayName) throws OutlookException
getAddress in interface OutlookServiceemail - emaildisplayName - user display nameOutlookException - when errorpublic OutlookUser getUser(String email, String displayName, String ewsUrl) throws OutlookException, javax.jcr.RepositoryException
getUser in interface OutlookServiceemail - emaildisplayName - user nameewsUrl - Exchange web-service URLOutlookUser object to access Outlook Mail APIOutlookException - Outlook exceptionjavax.jcr.RepositoryException - storage exceptionpublic OutlookMessage buildMessage(String id, OutlookUser user, OutlookEmail from, List<OutlookEmail> to, Calendar created, Calendar modified, String subject, String body) throws OutlookException
buildMessage in interface OutlookServiceid - String email message IDuser - OutlookUserfrom - OutlookEmailto - OutlookEmailcreated - Calendarmodified - Calendarsubject - String message subjectbody - String message bodyOutlookMessageOutlookException - when errorpublic OutlookMessage getMessage(OutlookUser user, String messageId, String messageToken) throws OutlookException
getMessage in interface OutlookServiceuser - OutlookUsermessageId - String email message IDmessageToken - String secure token to access message on Exchange serverOutlookMessageOutlookException - when errorpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic OutlookSpace getSpace(String groupId) throws OutlookSpaceException, javax.jcr.RepositoryException, OutlookException
getSpace in interface OutlookServicegroupId - String email message IDOutlookSpaceOutlookSpaceException - when space access error happenjavax.jcr.RepositoryException - when storage errorOutlookException - when errorpublic List<OutlookSpace> getUserSpaces() throws OutlookSpaceException
getUserSpaces in interface OutlookServiceOutlookSpaceExceptionpublic UserDocuments getUserDocuments() throws javax.jcr.RepositoryException, OutlookException
getUserDocuments in interface OutlookServicejavax.jcr.RepositoryExceptionOutlookExceptionprotected String nodeTitle(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 getExoUser(String userName) throws OutlookException
OutlookExceptionprotected javax.jcr.Node node(String nodePath) throws BadParameterException, javax.jcr.RepositoryException
BadParameterExceptionjavax.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.RepositoryExceptionprotected boolean isNull(org.exoplatform.ws.frameworks.json.value.JsonValue json)
protected boolean isNotNull(org.exoplatform.ws.frameworks.json.value.JsonValue json)
protected Locale currentUserLocale()
protected javax.jcr.Node addFile(javax.jcr.Node parent,
String title,
String contentType,
InputStream content)
throws javax.jcr.RepositoryException
parent - Nodetitle - StringcontentType - Stringcontent - InputStreamNodejavax.jcr.RepositoryException - when storage errorprotected javax.jcr.Node addFolder(javax.jcr.Node parent,
String title,
boolean forceNew)
throws javax.jcr.RepositoryException
forceNew is
true a new name will be generated by adding a numerical index to the end, otherwise existing
node will be returned.parent - Nodetitle - StringforceNew - if true then a new folder will be created with index in suffix, if
false then existing folder will be returnedNodejavax.jcr.RepositoryException - when storage errorprotected String currentUserId()
protected org.exoplatform.social.core.space.spi.SpaceService spaceService()
protected org.exoplatform.social.core.manager.IdentityManager socialIdentityManager()
protected org.exoplatform.social.core.manager.ActivityManager socialActivityManager()
protected List<OutlookSpace> userSpaces(String userId) throws OutlookSpaceException
OutlookSpaceExceptionprotected String groupDocsPath(String groupId)
protected String userDocsPath(String userId)
protected String groupPath(String groupId) throws Exception
protected void initWebDAVLink(HierarchyNode node) throws OutlookException
OutlookExceptionprotected void initDocumentLink(org.exoplatform.portal.mop.SiteType siteType,
String driveName,
String portalName,
String nodeURI,
HierarchyNode node)
throws OutlookException
OutlookExceptionprotected void initDocumentLink(OutlookSpace space, HierarchyNode file) throws OutlookException
OutlookExceptionprotected void initDocumentLink(OutlookServiceImpl.PersonalDocumentsFolder personalDocuments, HierarchyNode file) throws OutlookException
OutlookExceptionprotected javax.jcr.Node userDocumentsNode(String userName) throws Exception
protected javax.jcr.Node spaceDocumentsNode(String groupId) throws Exception
protected void setPermissions(javax.jcr.Node node,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
exo:privilegeable it will add such mixin to allow set the permissions first. Requested
permissions will not be set to the children nodes.node - Node link target nodeidentities - array of String with user identifiers (names or memberships)AccessControlException - when access errorjavax.jcr.RepositoryException - when storage errorprotected void setPermissions(javax.jcr.Node node,
boolean deep,
boolean forcePrivilegeable,
String... identities)
throws AccessControlException,
javax.jcr.RepositoryException
exo:privilegeable and forcePrivilegeable is
false. If deep is true the target children nodes will be checked
also for a need to set the requested permissions. node - Node link target nodedeep - Boolean if true then also children nodes will be set to the requested
permissionsforcePrivilegeable - Boolean if true and node not yet
exo:privilegeable it will add such mixin to allow set the permissions.identities - array of String with user identifiers (names or memberships)AccessControlException - when access errorjavax.jcr.RepositoryException - when storage errorprotected javax.jcr.Node messagesFolder(javax.jcr.Node parent,
String... identity)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected javax.jcr.Node addMessageFile(javax.jcr.Node parent,
OutlookMessage message)
throws javax.jcr.RepositoryException,
UnsupportedEncodingException,
IOException
javax.jcr.RepositoryExceptionUnsupportedEncodingExceptionIOExceptionprotected org.exoplatform.social.core.activity.model.ExoSocialActivity postAttachmentActivity(Folder destFolder, List<File> files, OutlookUser user, String comment) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected OutlookEmail readEmail(org.exoplatform.ws.frameworks.json.value.JsonValue vElem) throws OutlookException
OutlookExceptionprotected void fetchQuery(javax.jcr.query.QueryResult qr,
int limit,
Set<File> res)
throws javax.jcr.RepositoryException,
OutlookException
javax.jcr.RepositoryExceptionOutlookExceptionprotected org.exoplatform.wiki.mow.api.Page createWikiPage(String wikiType, String wikiOwner, String creator, String title, String summary, String content, List<String> users) throws Exception
protected String messageSummary(OutlookMessage message)
protected boolean isHTML(String content)
content - Stringprotected String safeActivityMessage(String text)
protected void setPermissionForWikiPage(List<String> users, org.exoplatform.wiki.mow.api.Page page, org.exoplatform.wiki.mow.api.Page parentPage)
users - list of Stringpage - PageparentPage - Pageprotected org.exoplatform.forum.service.Topic createForumTopic(String categoryId, String forumId, String creator, String title, String summary, String content) throws Exception
protected boolean checkForumHasAddTopic(org.exoplatform.forum.service.UserProfile userProfile,
String categoryId,
String forumId)
throws Exception
ExceptionCopyright © 2003–2016 eXo Platform SAS. All rights reserved.