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); } }
/** * * @param path * @return true if file already exists, false otherwise. */ protected boolean makeDirIfNotExists(String path) throws URISyntaxException { java.io.File dir = new java.io.File(new URI(path)); if (! dir.exists()) { if (_log.isDebugEnabled()) { _log.debug("make directory "+dir); } boolean ok = dir.mkdirs(); if (! ok) { throw new WebWorkException("cannot make directory "+dir); } return false; } return true; }
/** * Creates a new properties config given the name of a properties file. The name is expected to NOT have * the ".properties" file extension. So when <tt>new PropertiesConfiguration("foo")</tt> is called * this class will look in the classpath for the <tt>foo.properties</tt> file. * * @param name the name of the properties file, excluding the ".properties" extension. */ public PropertiesConfiguration(String name) { settings = new Properties(); URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(name + ".properties"); if (settingsUrl == null) { throw new IllegalStateException(name + ".properties missing"); } // Load settings try { settings.load(settingsUrl.openStream()); } catch (IOException e) { throw new WebWorkException("Could not load " + name + ".properties:" + 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; }
private ComponentConfiguration loadConfiguration() { ComponentConfiguration config = new ComponentConfiguration(); InputStream configXml = Thread.currentThread().getContextClassLoader().getResourceAsStream("components.xml"); if (configXml == null) { final String message = "Unable to find the file components.xml in the classpath, XWork IoC *not* initialized."; log.warn(message); return null; } try { config.loadFromXml(configXml); } catch (IOException ioe) { log.error(ioe); throw new WebWorkException("Unable to load component configuration"); } catch (SAXException sae) { log.error(sae); throw new WebWorkException("Unable to load component configuration"); } return config; } }
/** * Caching facade method to Introspector.getBeanInfo(Class, Class).getPropertyDescriptors(); */ private synchronized PropertyDescriptor[] getPropertyDescriptors(Object bean) { try { if (propertyDescriptorCache == null) { propertyDescriptorCache = new HashMap(); } PropertyDescriptor[] props = (PropertyDescriptor[]) propertyDescriptorCache.get(bean.getClass()); if (props == null) { log.debug("Caching property descriptor for " + bean.getClass().getName()); props = Introspector.getBeanInfo(bean.getClass(), Object.class).getPropertyDescriptors(); propertyDescriptorCache.put(bean.getClass(), props); } return props; } catch (IntrospectionException e) { e.printStackTrace(); throw new WebWorkException("Error getting property descriptors for " + bean + " : " + e.getMessage()); } } }
/** * @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; }