public class SiteUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static DocumentModel |
createDocument(HttpServletRequest request,
CoreSession session,
String parentPath,
String documentType)
Creates a document type that is received as parameter, as document model.
|
static Blob |
getBlob(DocumentModel d,
String xpath) |
static boolean |
getBoolean(DocumentModel d,
String xpath) |
static boolean |
getBoolean(DocumentModel d,
String xpath,
boolean defaultValue) |
static CommentManager |
getCommentManager() |
static DocumentModel |
getFirstWebSiteParent(CoreSession session,
DocumentModel doc)
Gets the first mini-site parent.
|
static String |
getFistNWordsFromString(String string,
int n) |
static GregorianCalendar |
getGregorianCalendar(DocumentModel d,
String xpath) |
static Response |
getLogoResponse(DocumentModel document) |
static String |
getModerationType(CoreSession session,
DocumentModel doc) |
static ArrayList<String> |
getModerators(CoreSession session,
DocumentModel doc) |
static Long |
getNumber(DocumentModel d,
String xpath) |
static Long |
getNumber(DocumentModel d,
String xpath,
Long defaultValue) |
static int |
getNumberCommentsForPage(CoreSession session,
DocumentModel page)
Gets the number of comments added on a page (published actually, if the
moderation is on).
|
static DocumentModel |
getPageForComment(DocumentModel comment)
Retrieves the WebPage where this WebComment was published.
|
static String |
getPagePath(DocumentModel ws,
DocumentModel documentModel)
Returns the path for a webPage from a webSite.
|
static Map<String,Object> |
getRssFeedArguments(WebContext ctx,
String key)
Computes the arguments for rss feed.
|
static String |
getString(DocumentModel d,
String xpath) |
static String |
getString(DocumentModel d,
String xpath,
String defaultValue) |
static String |
getUserDetails(String username)
Retrieves user details for a certain username.
|
static UserManager |
getUserManager() |
static ArrayList<String> |
getUsersWithPermission(CoreSession session,
DocumentModel doc,
Set<String> permissions) |
static StringBuilder |
getWebContainersPath()
Returns the path to all the existing web containers.
|
static boolean |
isCurrentModerated(CoreSession session,
DocumentModel doc) |
static boolean |
isModeratedByCurrentUser(CoreSession session,
DocumentModel doc) |
public static Response getLogoResponse(DocumentModel document) throws Exception
Exceptionpublic static DocumentModel getFirstWebSiteParent(CoreSession session, DocumentModel doc) throws Exception
Exceptionpublic static int getNumberCommentsForPage(CoreSession session, DocumentModel page) throws Exception
Exceptionpublic static String getUserDetails(String username) throws Exception
Exceptionpublic static StringBuilder getWebContainersPath()
public static String getPagePath(DocumentModel ws, DocumentModel documentModel)
ws - the web sitedocumentModel - the webPagepublic static DocumentModel createDocument(HttpServletRequest request, CoreSession session, String parentPath, String documentType) throws Exception
Exceptionpublic static ArrayList<String> getUsersWithPermission(CoreSession session, DocumentModel doc, Set<String> permissions) throws Exception
Exceptionpublic static boolean isCurrentModerated(CoreSession session, DocumentModel doc) throws Exception
Exceptionpublic static boolean isModeratedByCurrentUser(CoreSession session, DocumentModel doc) throws Exception
Exceptionpublic static CommentManager getCommentManager() throws Exception
Exceptionpublic static UserManager getUserManager() throws Exception
Exceptionpublic static DocumentModel getPageForComment(DocumentModel comment) throws Exception
comment - Exceptionpublic static ArrayList<String> getModerators(CoreSession session, DocumentModel doc) throws Exception
Exceptionpublic static String getModerationType(CoreSession session, DocumentModel doc) throws Exception
Exceptionpublic static String getString(DocumentModel d, String xpath, String defaultValue)
public static String getString(DocumentModel d, String xpath) throws ClientException
ClientExceptionpublic static GregorianCalendar getGregorianCalendar(DocumentModel d, String xpath) throws ClientException
ClientExceptionpublic static Long getNumber(DocumentModel d, String xpath) throws ClientException
ClientExceptionpublic static Long getNumber(DocumentModel d, String xpath, Long defaultValue)
public static Blob getBlob(DocumentModel d, String xpath) throws ClientException
ClientExceptionpublic static boolean getBoolean(DocumentModel d, String xpath, boolean defaultValue)
public static boolean getBoolean(DocumentModel d, String xpath) throws ClientException
ClientExceptionpublic static Map<String,Object> getRssFeedArguments(WebContext ctx, String key)
Copyright © 2011 Nuxeo SA. All Rights Reserved.