public class ProcessJsonModelDirective extends JavaScriptDependencyDirective
The purpose of this widget is to allow "New Share" pages to be created via a single WebScript. This directive processes the contents of the model defined by the JavaScript controller into the client-side JavaScript required to define a new page.
AbstractDependencyExtensibilityDirective.ProcessedDependency| Modifier and Type | Field and Description |
|---|---|
static String |
DIRECTIVE_NAME |
static String |
GROUP_MEMBERSHIPS_KEY |
static String |
MODEL_KEY |
static Pattern |
pattern
This is a custom token matching pattern to use to override the default one defined in
UriUtils. |
static String |
PUB_SUB_SCOPE_KEY |
static String |
TARGET_DOM_ID_KEY |
FORCE_AGGREGATED_OUTPUT_PARAMdependencyAggregator, dependencyHandler| Constructor and Description |
|---|
ProcessJsonModelDirective(String directiveName,
org.springframework.extensions.surf.extensibility.ExtensibilityModel model) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildConstantsForPage()
Builds a Dojo cache JavaScript object containing the output from the /constants/Default WebScript
that includes the context specific data (such as user information).
|
protected String |
buildI18nForPage(Map<String,DojoDependencies> dependenciesForCurrentRequest,
freemarker.template.TemplateHashModel model)
Constructs the i18n properties JavaScript content for the page.
|
protected String |
buildJavaScriptForPage(String checksum,
String servicesJSONStr,
String widgetsJSONStr,
String publishOnLoadJSONStr,
String rootDomId,
String pubSubScope,
String groupMemberships,
Map<String,DojoDependencies> dependenciesForCurrentRequest,
freemarker.template.TemplateHashModel model)
Constructs the JavaScript required to create a page object.
|
org.springframework.extensions.surf.extensibility.ExtensibilityDirectiveData |
createExtensibilityDirectiveData(String id,
String action,
String target,
Map params,
freemarker.template.TemplateDirectiveBody body,
freemarker.core.Environment env)
Looks up the object from the model defined by the WebScript controller and processes all the dependencies that it declares.
|
protected void |
runWebScript(String uri,
Writer writer)
Run a WebScript against the supplied
Writer. |
void |
setConfigService(org.springframework.extensions.config.ConfigService configService) |
void |
setDojoDependencyHandler(DojoDependencyHandler dojoDependencyHandler) |
void |
setI18nDependencyHandler(I18nDependencyHandler i18nDependencyHandler) |
void |
setWebScriptsContainer(LocalWebScriptRuntimeContainer webScriptsContainer) |
addLegacyDependencyRequest, createDependencyDirectiveData, execute, getDependencySource, getTargetElementgetModelObject, getRequestContext, getResourceControllerMapping, getToInsert, getUpdatedSrc, getWebFrameworkConfig, processDependency, setDependencyAggregator, setDependencyHandler, setModelObject, setRequestContext, setWebFrameworkConfigafter, before, getId, getModel, merge, remove, replacepublic static final String DIRECTIVE_NAME
public static final String MODEL_KEY
public static final String TARGET_DOM_ID_KEY
public static final String PUB_SUB_SCOPE_KEY
public static final String GROUP_MEMBERSHIPS_KEY
public ProcessJsonModelDirective(String directiveName, org.springframework.extensions.surf.extensibility.ExtensibilityModel model)
public void setDojoDependencyHandler(DojoDependencyHandler dojoDependencyHandler)
public void setI18nDependencyHandler(I18nDependencyHandler i18nDependencyHandler)
public void setWebScriptsContainer(LocalWebScriptRuntimeContainer webScriptsContainer)
public void setConfigService(org.springframework.extensions.config.ConfigService configService)
public org.springframework.extensions.surf.extensibility.ExtensibilityDirectiveData createExtensibilityDirectiveData(String id, String action, String target, Map params, freemarker.template.TemplateDirectiveBody body, freemarker.core.Environment env) throws freemarker.template.TemplateException
Looks up the object from the model defined by the WebScript controller and processes all the dependencies that it declares. When running in aggregation mode (which should be used for production) it generates the JavaScript source that simulates a Dojo build layer and creates the JavaScript code to create the root Dojo page object (defined in the Surf Dojo configuration) and places a requirement on that generated build layer.
createExtensibilityDirectiveData in class JavaScriptDependencyDirectivefreemarker.template.TemplateExceptionprotected String buildI18nForPage(Map<String,DojoDependencies> dependenciesForCurrentRequest, freemarker.template.TemplateHashModel model)
dependenciesForCurrentRequest - Mapmodel - TemplateHashModelprotected String buildJavaScriptForPage(String checksum, String servicesJSONStr, String widgetsJSONStr, String publishOnLoadJSONStr, String rootDomId, String pubSubScope, String groupMemberships, Map<String,DojoDependencies> dependenciesForCurrentRequest, freemarker.template.TemplateHashModel model)
Constructs the JavaScript required to create a page object.
servicesJSONStr - A JSON string containing all the services required on the page.widgetsJSONStr - A JSON string containing all the widgets required on the page.rootDomId - The ID of the DOM node to bind the page widget topubSubScope - A pubSubScope to apply to the page widgetgroupMemberships - The group membership data for the current user (to set on the page object)dependenciesForCurrentRequest - The dependencies for this pagemodel - The Freemarker modelCopyright © 2005–2016 Alfresco Software. All rights reserved.