@Name(value="restHelper") @Scope(value=EVENT) public class RestHelper extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
baseURL |
protected DocumentView |
docView |
protected org.jboss.seam.international.LocaleSelector |
localeSelector |
protected NavigationContext |
navigationContext |
static Pattern |
VALID_LOCALE |
protected WebActions |
webActions |
Constructor and Description |
---|
RestHelper() |
Modifier and Type | Method and Description |
---|---|
protected static String |
addConversationRequestParameters(String url,
org.jboss.seam.core.Manager conversationManager,
String conversationId) |
static String |
addCurrentConversationParameters(String url)
Adds current conversation request parameters to the given url.
|
static String |
addMainConversationParameters(String url)
Adds main conversation request parameters to the given url.
|
String |
doPrint(DocumentModel doc,
String defaultTheme) |
String |
doPrint(String defaultTheme) |
String |
getBaseURL() |
String |
getContextPath() |
static org.jboss.seam.core.Manager |
getConversationManager() |
String |
getDocumentUrl(DocumentModel doc) |
String |
getDocumentUrl(DocumentModel doc,
String viewId,
boolean newConversation) |
String |
getDocumentUrl(String patternName,
DocumentModel doc,
String viewId,
Map<String,String> parameters,
boolean newConversation) |
DocumentView |
getDocumentView() |
static javax.servlet.http.HttpServletRequest |
getHttpServletRequest() |
static javax.servlet.http.HttpServletResponse |
getHttpServletResponse() |
String |
getLocaleString()
Returns the locale string.
|
DocumentView |
getNewDocumentView() |
DocumentView |
getNewDocumentView(String mainTabId) |
String |
getPrintUrl(DocumentModel doc,
String defaultTheme) |
String |
getPrintUrl(String defaultTheme) |
static void |
handleRedirect(javax.servlet.http.HttpServletResponse response,
String url) |
String |
initContextFromRestRequest(DocumentView docView)
Sets current server location (core repository) and core document as provided by the document view.
|
void |
setDocumentView(DocumentView docView) |
void |
setLocaleString(String localeString)
Sets the locale string if given string is not null and not empty, as well as on faces context view root in case
it was already created so that it holds the new locale for future lookups by JSF components.
|
@In(create=true) protected transient NavigationContext navigationContext
@In(create=true) protected transient WebActions webActions
protected DocumentView docView
@In(create=true) protected transient org.jboss.seam.international.LocaleSelector localeSelector
public static final Pattern VALID_LOCALE
public RestHelper()
@Begin(id="#{conversationIdGenerator.currentOrNewMainConversationId}", join=true) public String initContextFromRestRequest(DocumentView docView)
Only sets current server location if the document reference is null.
public void setDocumentView(DocumentView docView)
public DocumentView getNewDocumentView(String mainTabId)
public DocumentView getNewDocumentView()
public DocumentView getDocumentView()
public static org.jboss.seam.core.Manager getConversationManager()
protected static String addConversationRequestParameters(String url, org.jboss.seam.core.Manager conversationManager, String conversationId)
public static String addCurrentConversationParameters(String url)
url
- public static String addMainConversationParameters(String url)
url
- public String getDocumentUrl(DocumentModel doc)
public String getDocumentUrl(DocumentModel doc, String viewId, boolean newConversation)
public String getDocumentUrl(String patternName, DocumentModel doc, String viewId, Map<String,String> parameters, boolean newConversation)
@Factory(value="baseURL", scope=CONVERSATION) public String getBaseURL()
@Factory(value="contextPath", scope=CONVERSATION) public String getContextPath()
public String doPrint(String defaultTheme) throws IOException
IOException
public String doPrint(DocumentModel doc, String defaultTheme) throws IOException
IOException
public String getPrintUrl(String defaultTheme)
public String getPrintUrl(DocumentModel doc, String defaultTheme)
public static javax.servlet.http.HttpServletResponse getHttpServletResponse()
public static javax.servlet.http.HttpServletRequest getHttpServletRequest()
public static void handleRedirect(javax.servlet.http.HttpServletResponse response, String url) throws IOException
IOException
public String getLocaleString()
Useful for url pattern bindings.
public void setLocaleString(String localeString)
Useful for url pattern bindings.
Copyright © 2015 Nuxeo SA. All rights reserved.