rawLoc.getURI(), rawLoc.getLineNumber(), rawLoc.getColumnNumber());
private static void dumpLocation(Location loc, AttributesImpl attr, ContentHandler handler) throws SAXException { attr.addCDATAAttribute("uri", loc.getURI()); attr.addCDATAAttribute("line", Integer.toString(loc.getLineNumber())); attr.addCDATAAttribute("column", Integer.toString(loc.getColumnNumber())); simpleElement("location", attr, loc.getDescription(), handler); }
/** * Lookup an flow {@link org.apache.cocoon.components.flow.Interpreter} * instance to hold the scripts defined within the <code><map:flow></code> * in the sitemap. * * @param manager a <code>ServiceManager</code> value * @exception ServiceException if no flow interpreter could be obtained */ public void service(ServiceManager manager) throws ServiceException { this.manager = manager; try { // Obtain the Interpreter instance for this language this.interpreter = (Interpreter) this.manager.lookup(Interpreter.ROLE + '/' + language); // Set interpreter ID as URI of the flow node (full sitemap file path) this.interpreter.setInterpreterID(this.location.getURI()); } catch (ServiceException e) { throw e; } catch (Exception e) { throw new ServiceException(language, "FlowNode: Couldn't obtain a flow interpreter for '" + language + "' at " + getLocation(), e); } }
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception { String continuationId; if (source == null) { continuationId = ObjectModelHelper.getRequest(objectModel).getParameter("continuation-id"); } else { continuationId = source; } // The interpreter id is the sitemap's URI String interpreterId = SitemapParameters.getLocation(parameters).getURI(); WebContinuation wk = this.contManager.lookupWebContinuation(continuationId, interpreterId); if (wk == null || wk.disposed()) { return null; } else { // Getting the continuation updates the last access time wk.getContinuation(); FlowHelper.setWebContinuation(objectModel, newObjectModel, wk); return Collections.EMPTY_MAP; } }
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, par); Request req = ObjectModelHelper.getRequest(objectModel); String continuationId = par.getParameter("continuation-id", req.getParameter("continuation-id")); String widgetPath = par.getParameter("widget", req.getParameter("widget")).replace('.', '/'); this.filter = par.getParameter("filter", req.getParameter("filter")); // The interpreter id is the sitemap's URI String interpreterId = SitemapParameters.getLocation(parameters).getURI(); wk = this.contManager.lookupWebContinuation(continuationId, interpreterId); if (wk == null || wk.disposed()) { throw new InvalidContinuationException("Cannot get continuation for suggestion list"); } Form form = (Form)wk.getAttribute("form"); if (form == null) { throw new ProcessingException("No form is attached to the continuation"); } this.locale = form.getLocale(); Field field = (Field)form.lookupWidget(widgetPath); list = field.getSuggestionList(); if (list == null) { throw new ProcessingException(field + " has no suggestion list"); } }