public int getParameterAsInteger(String arg0) throws ParameterException { return wrappedParameters.getParameterAsInteger(arg0); }
public int getParameterAsInteger(String arg0, int arg1) { return wrappedParameters.getParameterAsInteger(arg0, arg1); }
/** BEGIN SitemapComponent methods **/ public void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws ProcessingException, SAXException, IOException { this.counter=0; this.currentBlocknr=0; this.skip=false; this.foundIt=false; this.parentName=null; this.elementName = parameters.getParameter(ELEMENT, ""); this.count = parameters.getParameterAsInteger(COUNT, DEFAULT_COUNT); this.blocknr = parameters.getParameterAsInteger(BLOCKNR, DEFAULT_BLOCK); if (this.elementName == null || this.elementName.equals("") || this.count == 0) { throw new ProcessingException("FilterTransformer: both "+ ELEMENT + " and " + COUNT + " parameters need to be specified"); } }
/** * Set the component up, pulling any configuration values from the sitemap * parameters. */ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, parameters); depth = parameters.getParameterAsInteger("depth", DEFAULT_DEPTH); excludeCollections = parameters.getParameterAsBoolean( "exclude-collections", false); }
/** * <p>Setup this {@link CSVGenerator} instance.</p> */ public void setup(SourceResolver resolver, Map object_model, String source, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver, object_model, source, parameters); boolean header = parameters.getParameterAsBoolean("process-headers", false); this.encoding = parameters.getParameter("encoding", DEFAULT_ENCODING); this.separator = parameters.getParameter("separator", DEFAULT_SEPARATOR).charAt(0); this.escape = parameters.getParameter("escape", DEFAULT_ESCAPE).charAt(0); this.buffersize = parameters.getParameterAsInteger("buffer-size", DEFAULT_BUFFER_SIZE); this.maxrecords = parameters.getParameterAsInteger("max-records", UNLIMITED_MAXRECORDS); this.buffer = new CharArrayWriter(); this.columns = (header ? new HashMap() : null); this.recordnumber = (header ? 0 : 1); this.fieldnumber = 1; this.openrecord = false; }
/** * <p>Setup this {@link CSVGeneratorBean} instance.</p> */ public void setup(SourceResolver resolver, Map object_model, String source, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver, object_model, source, parameters); boolean header = parameters.getParameterAsBoolean("process-headers", false); this.encoding = parameters.getParameter("encoding", DEFAULT_ENCODING); this.separator = parameters.getParameter("separator", DEFAULT_SEPARATOR).charAt(0); this.escape = parameters.getParameter("escape", DEFAULT_ESCAPE).charAt(0); this.buffersize = parameters.getParameterAsInteger("buffer-size", DEFAULT_BUFFER_SIZE); this.maxrecords = parameters.getParameterAsInteger("max-records", UNLIMITED_MAXRECORDS); this.buffer = new CharArrayWriter(); this.columns = (header ? new HashMap() : null); this.recordnumber = (header ? 0 : 1); this.fieldnumber = 1; this.openrecord = false; }
@Override public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, parameters); int id = parameters.getParameterAsInteger("workflowID", -1); try { workflowItem = XmlWorkflowItem.find(context, id); } catch (SQLException e) { log.error(LogManager.getHeader(context, "Error while retrieving workflowitem", "workflowitemid: " + id), e); throw new ProcessingException("Error while retrieving workflowitem", e); } catch (AuthorizeException e) { log.error(LogManager.getHeader(context, "You are not authorized for this action", "workflowitemid: " + id), e); throw new ProcessingException("You are not authorized for this action", e); } }
/** * 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); }
/** * Parameterizes this {@link HTTPClientSource} instance. * * @param params a {@link Parameters} instance. * @exception ParameterException if an error occurs */ public void parameterize( final Parameters params ) throws ParameterException { this.m_proxyHost = params.getParameter( PROXY_HOST, null ); this.m_proxyPort = params.getParameterAsInteger( PROXY_PORT, -1 ); if ( this.getLogger().isDebugEnabled() ) { final String message = this.m_proxyHost == null || this.m_proxyPort == -1 ? "No proxy configured" : "Configured with proxy host " + this.m_proxyHost + " port " + this.m_proxyPort; this.getLogger().debug( message ); } }
public void addPageMeta(PageMeta pageMeta) throws WingException, SQLException { Item item = Item.find(context, parameters.getParameterAsInteger("itemID",-1)); Collection owner = item.getOwningCollection(); int collectionID = (owner == null) ? -1 : owner.getID(); pageMeta.addMetadata("choice", "collection").addContent(String.valueOf(collectionID)); pageMeta.addMetadata("title").addContent(T_title); pageMeta.addTrailLink(contextPath + "/", T_dspace_home); pageMeta.addTrailLink(contextPath + "/admin/item", T_item_trail); pageMeta.addTrail().addContent(T_trail); }
/** * Setup the reader. * The resource is opened to get an <code>InputStream</code>, * the length and the last modification date */ 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.quickTest = par.getParameterAsBoolean("quick-modified-test", this.configuredQuickTest); this.bufferSize = par.getParameterAsInteger("buffer-size", this.configuredBufferSize); this.byteRanges = par.getParameterAsBoolean("byte-ranges", this.configuredByteRanges); try { this.inputSource = resolver.resolveURI(src); } catch (SourceException e) { throw SourceUtil.handle("Error during resolving of '" + src + "'.", e); } setupHeaders(); }
@Override public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, parameters); authorized = true; try { String stepID = parameters.getParameter("stepID"); String actionID = parameters.getParameter("actionID"); int workflowID = parameters.getParameterAsInteger("workflowID"); XmlWorkflowItem wfi = XmlWorkflowItem.find(context, workflowID); Workflow wf = WorkflowFactory.getWorkflow(wfi.getCollection()); Step step = wf.getStep(stepID); xmluiActionUI = (AbstractXMLUIAction) WorkflowXMLUIFactory.getActionInterface(actionID); authorized = step.getActionConfig(actionID).getProcessingAction().isAuthorized(context, ObjectModelHelper.getRequest(objectModel), wfi); if(xmluiActionUI != null) xmluiActionUI.setup(resolver, objectModel, src, parameters); // else // throw new ProcessingException("Step class is null! We do not have a valid AbstractStep in " + this.transformerClassName + ". "); } catch (Exception e) { log.error(LogManager.getHeader(context, "error while setting up workflowtransformer", ""), e); throw new ProcessingException("Something went wrong while setting up the workflow"); } }
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("collection-role-delete",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection"); main.setHead(T_main_head.parameterize(role)); // Different help message for the default read group to enforce its non-retroactive nature if ("DEFAULT_READ".equals(role)) { main.addPara(T_main_para_read.parameterize(toBeDeleted.getName())); } else { 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 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 addBody(Body body) throws WingException, SQLException, AuthorizeException { int collectionID = parameters.getParameterAsInteger("collectionID", -1); Collection thisCollection = Collection.find(context, collectionID); // DIVISION: main Division main = body.addInteractiveDivision("collection-confirm-delete",contextPath+"/admin/collection",Division.METHOD_POST,"primary administrative collection"); main.setHead(T_main_head.parameterize(collectionID)); main.addPara(T_main_para.parameterize(thisCollection.getMetadata("name"))); List deleteConfirmHelp = main.addList("consequences",List.TYPE_BULLETED); deleteConfirmHelp.addItem(T_confirm_item1); deleteConfirmHelp.addItem(T_confirm_item2); deleteConfirmHelp.addItem(T_confirm_item3); 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 addBody(Body body) throws WingException, SQLException, AuthorizeException { int communityID = parameters.getParameterAsInteger("communityID", -1); Community thisCommunity = Community.find(context, communityID); // DIVISION: main Division main = body.addInteractiveDivision("community-confirm-delete",contextPath+"/admin/community",Division.METHOD_POST,"primary administrative community"); main.setHead(T_main_head.parameterize(communityID)); main.addPara(T_main_para.parameterize(thisCommunity.getMetadata("name"))); List deleteConfirmHelp = main.addList("consequences",List.TYPE_BULLETED); deleteConfirmHelp.addItem(T_confirm_item1); deleteConfirmHelp.addItem(T_confirm_item2); deleteConfirmHelp.addItem(T_confirm_item3); deleteConfirmHelp.addItem(T_confirm_item4); 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 addBody(Body body) throws WingException, SQLException int itemID = parameters.getParameterAsInteger("itemID",-1); Item item = Item.find(context, itemID);
/** * Read reader configuration * * @deprecated use property injection instead */ public void configure(Configuration configuration) throws ConfigurationException { // VG Parameters are deprecated as of 2.2.0-Dev/2.1.6-Dev final Parameters parameters = Parameters.fromConfiguration(configuration); this.setExpires(parameters.getParameterAsLong("expires", CONFIGURED_EXPIRES_DEFAULT)); this.setQuickTest(parameters.getParameterAsBoolean("quick-modified-test", CONFIGURED_QUICK_TEST_DEFAULT)); this.setBufferSize(parameters.getParameterAsInteger("buffer-size", CONFIGURED_BUFFER_SIZE_DEFAULT)); this.setByteRanges(parameters.getParameterAsBoolean("byte-ranges", CONFIGURED_BYTE_RANGES_DEFAULT)); // Configuration has precedence over parameters. setExpires(configuration.getChild("expires").getValueAsLong(configuredExpires)); setQuickTest(configuration.getChild("quick-modified-test").getValueAsBoolean(configuredQuickTest)); setBufferSize(configuration.getChild("buffer-size").getValueAsInteger(configuredBufferSize)); setByteRanges(configuration.getChild("byte-ranges").getValueAsBoolean(configuredByteRanges)); }
public void addBody(Body body) throws WingException, SQLException, AuthorizeException int collectionID = parameters.getParameterAsInteger("collectionID", -1); Collection thisCollection = Collection.find(context, collectionID);
public void addBody(Body body) throws SAXException, WingException, SQLException int collectionID = parameters.getParameterAsInteger("collectionID",-1); Collection collection = Collection.find(context,collectionID);