public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPARE_REVISION |
static String |
DOT |
static String |
PAGE |
static String |
SLASH |
static String |
SPACE |
static String |
SPLIT_TEXT_OF_DRAFT_FOR_NEW_PAGE |
static String |
VER_NAME |
static String |
WIKI_RESOUCE_BUNDLE_NAME |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static long |
countSearchResult(WikiSearchData data) |
static org.exoplatform.services.jcr.ext.common.SessionProvider |
createSystemProvider() |
static String |
escapeIllegalCharacterInQuery(String query) |
static HashMap<String,IDType> |
getACLForAdmins() |
static Wiki[] |
getAllWikiSpace() |
static List<NTVersion> |
getCurrentPageRevisions(Page wikipage) |
static String |
getCurrentRepositoryWebDavUri() |
static String |
getCurrentUser() |
static String |
getDefaultRestBaseURI() |
static String |
getDocumentURL(WikiContext wikiContext) |
static String |
getEmailUser(String userName) |
static String |
getGroupIdByJcrPath(String jcrPath) |
static NTVersion |
getLastRevisionOfPage(Page wikipage) |
static List<String> |
getListOfUserEditingPage(String pageId)
Get the list of user that're editing the wiki page
|
static Map<String,WikiPageHistory> |
getLogOfPage(String pageId)
Get the editting log of wiki page
|
static String |
getNodeTypeCssClass(AttachmentImpl attachment,
String append) |
static Object |
getObject(String path,
String type) |
static Object |
getObjectFromParams(WikiPageParams param) |
static String |
getPageNameForAddingPage() |
static String |
getPermanlink(WikiPageParams params,
boolean hasDowmainUrl)
Get the permalink of current wiki page
With the current page param: type = "group" owner = "spaces/test_space" pageId = "test_page" The permalink will be: http://int.exoplatform.org/portal/intranet/wiki/group/spaces/test_space/test_page |
static String |
getPortalIdByJcrPath(String jcrPath) |
static String |
getPortalName() |
static String |
getPortalWikisPath() |
static String |
getRestContextName()
gets rest context name
|
static String |
getSpaceIdByJcrPath(String jcrPath) |
static Stack<WikiPageParams> |
getStackParams(PageImpl page) |
static String |
getURL(String url,
String verName) |
static String |
getUserIdByJcrPath(String jcrPath) |
static Wiki |
getWiki(WikiPageParams params) |
static WikiPageParams |
getWikiPageParams(Page page) |
static String |
getWikiResourceBundle(String key,
ClassLoader cl)
Get resource bundle from given resource file
|
static Collection<Wiki> |
getWikisByType(WikiType wikiType) |
static String |
getWikiType(String jcrPath) |
static boolean |
hasPermission(org.exoplatform.services.jcr.access.AccessControlList acl,
String[] permission,
org.exoplatform.services.security.Identity user)
Has permission.
|
static boolean |
isDescendantPage(PageImpl page,
PageImpl parentPage) |
static boolean |
isWikiAvailable(String wikiType,
String wikiOwner) |
static void |
logEditPageTime(WikiPageParams pageParams,
String username,
long updateTime,
String draftName,
boolean isNewPage)
Log the edit page action of user
|
static void |
removeLogEditPage(WikiPageParams pageParams,
String user)
removes the log of user editing page.
|
static void |
sendMailOnChangeContent(AttachmentImpl content) |
static String |
validateWikiOwner(String wikiType,
String wikiOwner)
Validate
wikiOwner depending on wikiType. |
public static final String SLASH
public static final String DOT
public static final String SPACE
public static final String PAGE
public static final String COMPARE_REVISION
public static final String VER_NAME
public static final String WIKI_RESOUCE_BUNDLE_NAME
public static final String SPLIT_TEXT_OF_DRAFT_FOR_NEW_PAGE
public static String getPortalName()
public static String getWikiResourceBundle(String key, ClassLoader cl)
key - keycl - ClassLoader to load resource filepublic static void logEditPageTime(WikiPageParams pageParams, String username, long updateTime, String draftName, boolean isNewPage)
pageParams - The page that has been editingusername - The name of user that editing wiki pageupdateTime - The time that this page is editeddraftName - The name of draft for this editisNewPage - Is the wiki page a draft or notpublic static void removeLogEditPage(WikiPageParams pageParams, String user)
pageParams - user - public static List<String> getListOfUserEditingPage(String pageId)
pageId - The id of wiki pagepublic static String getPermanlink(WikiPageParams params, boolean hasDowmainUrl) throws Exception
Exceptionpublic static String getPageNameForAddingPage()
public static Map<String,WikiPageHistory> getLogOfPage(String pageId)
pageId - The id of wiki page to get logpublic static String getPortalWikisPath()
public static String getSpaceIdByJcrPath(String jcrPath) throws IllegalArgumentException
IllegalArgumentException - if jcr path is not of a wiki page node.public static String getGroupIdByJcrPath(String jcrPath) throws IllegalArgumentException
jcrPath - follows the format /Groups/$GROUP/ApplicationData/eXoWiki/[wikipage]IllegalArgumentException - if jcrPath is not as expected.public static List<NTVersion> getCurrentPageRevisions(Page wikipage) throws Exception
Exceptionpublic static String getUserIdByJcrPath(String jcrPath) throws IllegalArgumentException
jcrPath - follows the format /Users/$USERNAME/ApplicationData/eXoWiki/...IllegalArgumentException - if jcrPath is not as expected.public static String getPortalIdByJcrPath(String jcrPath) throws IllegalArgumentException
jcrPath - follows the format /exo:applications/eXoWiki/wikis/$PORTAL/...IllegalArgumentException - if jcrPath is not as expected.public static String getWikiType(String jcrPath) throws IllegalArgumentException
jcrPath - absolute jcr path of page node.IllegalArgumentExceptionpublic static String validateWikiOwner(String wikiType, String wikiOwner)
wikiOwner depending on wikiType. PortalConfig.GROUP_TYPE, wikiOwner is checked to removed slashes at the begin and the end point of it.wikiType - wikiOwner - public static String getDefaultRestBaseURI()
public static String getCurrentRepositoryWebDavUri()
public static String getDocumentURL(WikiContext wikiContext)
public static String getCurrentUser()
public static Collection<Wiki> getWikisByType(WikiType wikiType)
public static Wiki getWiki(WikiPageParams params)
public static Wiki[] getAllWikiSpace()
public static boolean isDescendantPage(PageImpl page, PageImpl parentPage) throws Exception
Exceptionpublic static Object getObject(String path, String type) throws Exception
Exceptionpublic static NTVersion getLastRevisionOfPage(Page wikipage) throws Exception
Exceptionpublic static Object getObjectFromParams(WikiPageParams param) throws Exception
Exceptionpublic static Stack<WikiPageParams> getStackParams(PageImpl page) throws Exception
Exceptionpublic static WikiPageParams getWikiPageParams(Page page)
public static void sendMailOnChangeContent(AttachmentImpl content) throws Exception
Exceptionpublic static boolean hasPermission(org.exoplatform.services.jcr.access.AccessControlList acl,
String[] permission,
org.exoplatform.services.security.Identity user)
acl - access control listpermission - permissions arrayuser - user Identitypublic static org.exoplatform.services.jcr.ext.common.SessionProvider createSystemProvider()
public static long countSearchResult(WikiSearchData data) throws Exception
Exceptionpublic static String getNodeTypeCssClass(AttachmentImpl attachment, String append) throws Exception
Exceptionpublic static String getRestContextName()
Copyright © 2003–2015 eXo Platform SAS. All rights reserved.