public void parameterize(Parameters parameters) throws ParameterException { global_container_encoding = parameters.getParameter("container-encoding", "ISO-8859-1"); global_form_encoding = parameters.getParameter("form-encoding", null); global_generate_attributes = parameters.getParameterAsBoolean("generate-attributes", false); }
/** * Read sitemap parameters and set properties accordingly. */ private void evaluateParameters() { this.documentFixed = this.parameters.getParameterAsBoolean("fixed", false); this.fixed = this.documentFixed; this.prefix = this.parameters.getParameter("prefix", this.defaultPrefix); this.suffix = this.parameters.getParameter("suffix", this.defaultSuffix); this.inputName = this.parameters.getParameter("input", null); this.decorationSize = this.parameters.getParameterAsInteger("decoration", this.decorationSize); this.stripNumber = this.parameters.getParameterAsBoolean("strip-number", this.stripNumber); }
public String getParameter(String arg0) throws ParameterException { return wrappedParameters.getParameter(arg0); }
public void addBody(Body body) throws WingException, SQLException, AuthorizeException { String role = parameters.getParameter("role", null); int groupID = parameters.getParameterAsInteger("groupID", -1); Group toBeDeleted = Group.find(context, groupID); // DIVISION: main Division main = body.addInteractiveDivision("community-role-delete",contextPath+"/admin/community",Division.METHOD_POST,"primary administrative community"); main.setHead(T_main_head.parameterize(role)); main.addPara(T_main_para.parameterize(toBeDeleted.getName())); Para buttonList = main.addPara(); buttonList.addButton("submit_confirm").setValue(T_submit_confirm); buttonList.addButton("submit_cancel").setValue(T_submit_cancel); main.addHidden("administrative-continue").setValue(knot.getId()); } }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); this.request = ObjectModelHelper.getRequest(objectModel); this.response = ObjectModelHelper.getResponse(objectModel); this.expires = par.getParameterAsLong("expires", this.configuredExpires); this.encoding = par.getParameter("encoding", this.configuredEncoding); try { this.inputSource = resolver.resolveURI(src); } catch (SourceException e) { throw SourceUtil.handle("Error during resolving of '" + src + "'.", e); } setupHeaders(); }
public String getParameter(String arg0, String arg1) { return wrappedParameters.getParameter(arg0, arg1); }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, parameters); container_encoding = parameters.getParameter("container-encoding", global_container_encoding); form_encoding = parameters.getParameter("form-encoding", global_form_encoding); generate_attributes = parameters.getParameterAsBoolean("generate-attributes", global_generate_attributes); }
/** * Generate the unique caching key. * This key must be unique inside the space of this component. */ public Serializable getKey() { String email = parameters.getParameter("email",""); String comments = parameters.getParameter("comments",""); String page = parameters.getParameter("page","unknown"); return HashUtil.hash(email + "-" + comments + "-" + page); }
/** * Configure the component */ public void parameterize(final Parameters params) throws ParameterException { m_useStore = params.getParameterAsBoolean("use-store", this.m_useStore); m_incrementalProcessing = params.getParameterAsBoolean("incremental-processing", this.m_incrementalProcessing); m_transformerFactory = params.getParameter("transformer-factory", null); m_checkIncludes = params.getParameterAsBoolean("check-includes", true); if (!m_useStore) { // release the store, if we don't need it anymore m_manager.release(m_store); m_store = null; } else if (null == m_store) { final String message = "XSLTProcessor: use-store is set to true, " + "but unable to aquire the Store."; throw new ParameterException(message); } }
/** * Setup configuration for this request */ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); this.format = par.getParameter("feedFormat", null); this.handle = par.getParameter("handle",null); }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver,objectModel,src,parameters); try { this.email = parameters.getParameter("email"); this.forgot = parameters.getParameterAsBoolean("forgot"); } catch (ParameterException pe) { throw new ProcessingException(pe); } }
/** * Redirect the user to the login page. */ public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception { String header = parameters.getParameter("header",null); String message = parameters.getParameter("message",null); String characters = parameters.getParameter("characters",null); // Interupt this request AuthenticationUtil.interruptRequest(objectModel,header,message,characters); final HttpServletRequest httpRequest = (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT); final HttpServletResponse httpResponse = (HttpServletResponse) objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT); httpResponse.sendRedirect(httpRequest.getContextPath() + "/login"); return new HashMap(); }
/** Add a set of name-value pairs. */ public void addVariables(Parameters params) { String[] names = params.getNames(); for (int i=0; i<names.length; i++) { String paramVal = params.getParameter(names[i], null); if (paramVal != null) { vars.put(names[i], paramVal); } } }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver,objectModel,src,parameters); this.email = parameters.getParameter("email",""); String errors = parameters.getParameter("errors",""); if (errors.length() > 0) { this.errors = Arrays.asList(errors.split(",")); } else { this.errors = new ArrayList<String>(); } }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver,objectModel,src,parameters); this.email = parameters.getParameter("email","unknown"); String errors = parameters.getParameter("errors",""); if (errors.length() > 0) { this.errors = Arrays.asList(errors.split(",")); } else { this.errors = new ArrayList<String>(); } }
/** * Get the <code>Parameter</code> called "serializer" from the * <code>Transformer</code> invocation. */ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); this.configuredSerializerName = par.getParameter(SERIALIZER_ATTRIBUTE, this.configuredSerializerName); this.state = STATE_OUTSIDE; }
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception { Map<String, String> map = new HashMap<String, String>(); final String[] parameterNames = parameters.getNames(); for (int i = 0; i < parameterNames.length; i++) { final String paramName = parameterNames[i]; map.put(parameters.getParameter(paramName), ConfigurationManager.getProperty(paramName)); } return map; } }
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws Exception { String formSource = parameters.getParameter("form-definition"); String formAttribute = parameters.getParameter("attribute-name"); Source source = null; try { source = resolver.resolveURI(formSource); Form form = formManager.createForm(source); Request request = ObjectModelHelper.getRequest(objectModel); request.setAttribute(formAttribute, form); } finally { resolver.release(source); } return null; }
/** * Callback interface for * {@link I18nUtils#findLocale(Map, String, Parameters, Locale, boolean, boolean, boolean, I18nUtils.LocaleValidator)} * @since 2.1.6 */ public interface LocaleValidator { /** * @param name of the locale (for debugging) * @param locale to test * @return true if locale satisfies validator's criteria */ public boolean test(String name, Locale locale); }
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException { String error = ""; try { error = parameters.getParameter("error"); } catch (ParameterException e) { //Should not happen. assert false; } Division div = body.addDivision("error"); Table table = div.addTable("table0",2,1); table.addRow().addCell().addContent("An error has occured:"); table.addRow().addCell().addContent(error); } }