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 String |
escapeIllegalCharacterInName(String name) |
static String |
escapeIllegalCharacterInQuery(String query) |
static HashMap<String,IDType> |
getACLForAdmins() |
static String |
getAttachmentCssClass(Attachment attachment,
String append) |
static String |
getCurrentUser() |
static String |
getDefaultRestBaseURI() |
static String |
getDocumentURL(WikiContext wikiContext) |
static String |
getEmailUser(String userName) |
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 Object |
getObjectFromParams(WikiPageParams param) |
static String |
getPageNameForAddingPage() |
static String |
getPageNameForAddingPage(String sessionId) |
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 |
getPortalName() |
static String |
getRestContextName()
gets rest context name
|
static Stack<WikiPageParams> |
getStackParams(Page page) |
static String |
getURL(String url,
String verName) |
static WikiPageParams |
getWikiPageParams(Page page) |
static String |
getWikiResourceBundle(String key,
ClassLoader cl)
Get resource bundle from given resource file
|
static boolean |
isDescendantPage(Page page,
Page parentPage) |
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(Page page) |
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 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 getDocumentURL(WikiContext wikiContext)
public static String getCurrentUser()
public static boolean isDescendantPage(Page page, Page parentPage) throws WikiException
WikiExceptionpublic static Object getObjectFromParams(WikiPageParams param) throws WikiException
WikiExceptionpublic static Stack<WikiPageParams> getStackParams(Page page) throws WikiException
WikiExceptionpublic static WikiPageParams getWikiPageParams(Page page)
public static void sendMailOnChangeContent(Page page) throws WikiException, org.suigeneris.jrcs.diff.DifferentiationFailedException, org.xwiki.component.manager.ComponentLookupException, org.xwiki.rendering.converter.ConversionException
WikiExceptionorg.suigeneris.jrcs.diff.DifferentiationFailedExceptionorg.xwiki.component.manager.ComponentLookupExceptionorg.xwiki.rendering.converter.ConversionExceptionpublic static String getEmailUser(String userName) throws WikiException
WikiExceptionpublic static long countSearchResult(WikiSearchData data) throws Exception
Exceptionpublic static String getAttachmentCssClass(Attachment attachment, String append) throws Exception
Exceptionpublic static String getRestContextName()
Copyright © 2003–2018 eXo Platform SAS. All rights reserved.