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
Exception
public static DocumentModel getFirstWebSiteParent(CoreSession session, DocumentModel doc) throws Exception
Exception
public static int getNumberCommentsForPage(CoreSession session, DocumentModel page) throws Exception
Exception
public static String getUserDetails(String username) throws Exception
Exception
public 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
Exception
public static ArrayList<String> getUsersWithPermission(CoreSession session, DocumentModel doc, Set<String> permissions) throws Exception
Exception
public static boolean isCurrentModerated(CoreSession session, DocumentModel doc) throws Exception
Exception
public static boolean isModeratedByCurrentUser(CoreSession session, DocumentModel doc) throws Exception
Exception
public static CommentManager getCommentManager() throws Exception
Exception
public static UserManager getUserManager() throws Exception
Exception
public static DocumentModel getPageForComment(DocumentModel comment) throws Exception
comment
- Exception
public static ArrayList<String> getModerators(CoreSession session, DocumentModel doc) throws Exception
Exception
public static String getModerationType(CoreSession session, DocumentModel doc) throws Exception
Exception
public static String getString(DocumentModel d, String xpath, String defaultValue)
public static String getString(DocumentModel d, String xpath) throws ClientException
ClientException
public static GregorianCalendar getGregorianCalendar(DocumentModel d, String xpath) throws ClientException
ClientException
public static Long getNumber(DocumentModel d, String xpath) throws ClientException
ClientException
public static Long getNumber(DocumentModel d, String xpath, Long defaultValue)
public static Blob getBlob(DocumentModel d, String xpath) throws ClientException
ClientException
public static boolean getBoolean(DocumentModel d, String xpath, boolean defaultValue)
public static boolean getBoolean(DocumentModel d, String xpath) throws ClientException
ClientException
public static Map<String,Object> getRssFeedArguments(WebContext ctx, String key)
Copyright © 2011 Nuxeo SA. All Rights Reserved.