@Override public void acceptRepresentation(Representation entity) throws ResourceException { Form form = getRequest().getEntityAsForm(); chosenEngine = form.getFirstValue("engine"); String script = form.getFirstValue("script"); if(StringUtils.isBlank(script)) { script=""; } ScriptEngine eng = MANAGER.getEngineByName(chosenEngine); scriptingConsole.bind("scriptResource", this); scriptingConsole.execute(eng, script); scriptingConsole.unbind("scriptResource"); //TODO: log script, results somewhere; job log INFO? getResponse().setEntity(represent()); }
public void acceptRepresentation(Representation entity) throws ResourceException { if (appCtx == null) { throw new ResourceException(404); } // copy op? Form form = getRequest().getEntityAsForm(); beanPath = form.getFirstValue("beanPath"); String newVal = form.getFirstValue("newVal"); if(newVal!=null) { int i = beanPath.indexOf("."); String beanName = i<0?beanPath:beanPath.substring(0,i); Object namedBean = appCtx.getBean(beanName); BeanWrapperImpl bwrap = new BeanWrapperImpl(namedBean); String propPath = beanPath.substring(i+1); Object coercedVal = bwrap.convertIfNecessary(newVal, bwrap.getPropertyValue(propPath).getClass()); bwrap.setPropertyValue(propPath, coercedVal); } Reference ref = getRequest().getResourceRef(); ref.setPath(getBeansRefPath()); ref.addSegment(beanPath); getResponse().redirectSeeOther(ref); }
throws ResourceException { Form form = getRequest().getEntityAsForm(); String newContents = form.getFirstValue("contents"); EditRepresentation er;
form = getRequest().getEntityAsForm(); String copyTo = form.getFirstValue("copyTo"); if (copyTo != null) {
@Override public void acceptRepresentation(Representation entity) throws ResourceException { Form form = getRequest().getEntityAsForm(); String action = form.getFirstValue("action"); if("rescan".equals(action)) {
/** * Returns the entity as a DOM representation.<br> * Note that this triggers the parsing of the entity into a reusable DOM * document stored in memory.<br> * This method and the related getEntity*() methods can only be invoked * once. * * @return The entity as a DOM representation. */ @Override public Form getEntityAsForm() { return getWrappedRequest().getEntityAsForm(); }
public void doPost(Request req, Response resp) throws RestletException { Form form = req.getEntityAsForm();
@Override public void acceptRepresentation(Representation entity) throws ResourceException { Form form = getRequest().getEntityAsForm(); chosenEngine = form.getFirstValue("engine"); String script = form.getFirstValue("script"); if(StringUtils.isBlank(script)) { script=""; } ScriptEngine eng = MANAGER.getEngineByName(chosenEngine); scriptingConsole.bind("scriptResource", this); scriptingConsole.execute(eng, script); scriptingConsole.unbind("scriptResource"); //TODO: log script, results somewhere; job log INFO? getResponse().setEntity(represent()); }
public void acceptRepresentation(Representation entity) throws ResourceException { if (appCtx == null) { throw new ResourceException(404); } // copy op? Form form = getRequest().getEntityAsForm(); beanPath = form.getFirstValue("beanPath"); String newVal = form.getFirstValue("newVal"); if(newVal!=null) { int i = beanPath.indexOf("."); String beanName = i<0?beanPath:beanPath.substring(0,i); Object namedBean = appCtx.getBean(beanName); BeanWrapperImpl bwrap = new BeanWrapperImpl(namedBean); String propPath = beanPath.substring(i+1); Object coercedVal = bwrap.convertIfNecessary(newVal, bwrap.getPropertyValue(propPath).getClass()); bwrap.setPropertyValue(propPath, coercedVal); } Reference ref = getRequest().getResourceRef(); ref.setPath(getBeansRefPath()); ref.addSegment(beanPath); getResponse().redirectSeeOther(ref); }
final Form form = request.getEntityAsForm();
throws ResourceException { Form form = getRequest().getEntityAsForm(); String newContents = form.getFirstValue("contents"); EditRepresentation er;
form = getRequest().getEntityAsForm(); String copyTo = form.getFirstValue("copyTo"); if (copyTo != null) {
@Override public void acceptRepresentation(Representation entity) throws ResourceException { Form form = getRequest().getEntityAsForm(); String action = form.getFirstValue("action"); if("rescan".equals(action)) {
Form form = req.getEntityAsForm();