public void deleteData(int i, int i1) throws DOMException { throw new WebWorkException("Operation not supported"); }
public void setData(String string) throws DOMException { throw new WebWorkException("Operation not supported"); }
public void appendData(String string) throws DOMException { throw new WebWorkException("Operation not supported"); }
public void replaceData(int i, int i1, String string) throws DOMException { throw new WebWorkException("Operation not supported"); }
public Text splitText(int i) throws DOMException { throw new WebWorkException("Operation not supported"); }
protected WebWorkException operationNotSupported() { return new WebWorkException("Operation not supported."); }
protected void unknownCommand(String command, String virtualFolderPath, String type, String filename, String contentType, java.io.File newFile) { throw new WebWorkException("unknown command "+command); }
public void insertData(int i, String string) throws DOMException { throw new WebWorkException("Operation not supported"); }
protected void checkParams() { if (dynamicReport == null) { final String message = "No dynamicReport specified..."; LOG.error(message); throw new WebWorkException(message); } //Some reports may not need specifically a datasource if (dataSource == null) { final String message = "No dataSource specified..."; LOG.debug(message); } }
protected void checkParams() { if (dynamicReport == null) { final String message = "No dynamicReport specified..."; LOG.error(message); throw new WebWorkException(message); } //Some reports may not need specifically a datasource if (dataSource == null) { final String message = "No dataSource specified..."; LOG.debug(message); } }
public Node getChildBeforeOrAfter( Node child, boolean before ) { log.debug( "getChildBeforeOrAfter: " ); List adapters = getChildAdapters(); log.debug( "childAdapters = "+adapters ); log.debug( "child = "+child ); int index = adapters.indexOf( child ); if ( index < 0 ) throw new WebWorkException( child + " is no child of " + this ); int siblingIndex = before ? index - 1 : index + 1; return ( ( 0 < siblingIndex ) && ( siblingIndex < adapters.size() ) ) ? ( (Node)adapters.get( siblingIndex ) ) : null; }
static final void lock(Object o, ActionInvocation invocation) throws Exception { synchronized (o) { int count = 3; Object previous = null; while ((previous = locks.get(o)) != null) { if (previous == invocation) { return; } if (count-- <= 0) { locks.remove(o); o.notify(); throw new WebWorkException("Deadlock in session lock"); } o.wait(10000); } ; locks.put(o, invocation); } }
/** * * @param filePath * @return true if file already exists, false otherwise */ protected boolean makeFileIfNotExists(String filePath) throws IOException, URISyntaxException { java.io.File f = new java.io.File(new URI(filePath)); if (! f.exists()) { if (_log.isDebugEnabled()) { _log.debug("creating file "+filePath); } boolean ok = f.createNewFile(); if (! ok) { throw new WebWorkException("cannot create file "+filePath); } return false; } return true; }
/** * Constructs?a <code>WebWorkException</code> based on the given information. * <p/> * A message is constructed and logged at ERROR level before being returned * as a <code>WebWorkException</code>. * @param field field name used when throwing <code>WebWorkException</code>. * @param errorMsg error message used when throwing <code>WebWorkException</code>. * @param e the caused exception, can be <tt>null</tt>. * @return the constructed <code>WebWorkException</code>. */ protected WebWorkException fieldError(String field, String errorMsg, Exception e) { String msg = "tag '" + getComponentName() + "', field '" + field + ( id != null ?"', id '" + id:"") + ( parameters != null && parameters.containsKey("name")?"', name '" + parameters.get("name"):"") + "': " + errorMsg; if (e == null) { LOG.error(msg); return new WebWorkException(msg); } else { LOG.error(msg, e); return new WebWorkException(msg, e); } }
/** * Callback for the start tag of this component. * Should the body be evaluated again? * <p/> * <b>NOTE:</b> has a parameter to determine to pop the component stack. * @param writer the output writer. * @param body the rendered body. * @param popComponentStack should the component stack be popped? * @return true if the body should be evaluated again */ protected boolean end(Writer writer, String body, boolean popComponentStack) { assert(body != null); try { writer.write(body); } catch (IOException e) { throw new WebWorkException("IOError while writing the body: " + e.getMessage(), e); } if (popComponentStack) { popComponentStack(); } return false; }
/** * @see com.opensymphony.webwork.components.Component#end(java.io.Writer, java.lang.String, boolean) */ protected boolean end(Writer writer, String body, boolean popComponentStack) { try { endAllowingExceptionThrowing(writer, body); } catch(Exception e) { throw new WebWorkException("failed when trying to end the parsing of component ["+this+"]", e); } super.end(writer, body, popComponentStack); return false; }
/** * Prepares the dot generated content and writes out to the provided writer * object. If no writer has been given, that a {@link FileWriter} pointing to "out.dot" * in the specified output directly shall be used. */ public void prepare() { if (writer == null) { try { writer = new FileWriter(output + "/out.dot"); } catch (IOException e) { throw new WebWorkException(e); } } XWorkConfigRetriever.setConfiguration(configDir, views.split("[, ]+")); DOTRenderer renderer = new DOTRenderer(writer); renderer.render(namespace); }
protected Object beforeActionInvocation(HttpServletRequest request, ServletContext servletContext) { objectReference.set(request); ServletRequestContainerLauncher containerLauncher = new ServletRequestContainerLauncher(servletContext, request); try { containerLauncher.startContainer(); } catch (ServletException e) { throw new WebWorkException("Could not start pico container", e); } return containerLauncher; }
public boolean start(Writer writer) { boolean result = super.start(writer); OgnlValueStack stack = getStack(); Iterator iter = stack.getRoot().iterator(); List stackValues = new ArrayList(stack.getRoot().size()); while (iter.hasNext()) { Object o = iter.next(); Map values; try { values = OgnlUtil.getBeanMap(o); } catch (Exception e) { throw new WebWorkException("Caught an exception while getting the property values of " + o, e); } stackValues.add(new DebugMapEntry(o.getClass().getName(), values)); } addParameter("stackValues", stackValues); return result; }
/** * Lazily construct the root element adapter from the value object. */ private Element getRootElement() { if (rootElement != null) return rootElement; Node node = getAdapterFactory().adaptNode( this, getPropertyName(), getPropertyValue()); if (node instanceof Element) rootElement = (Element) node; else throw new WebWorkException( "Document adapter expected to wrap an Element type. Node is not an element:" + node); return rootElement; }