Package org.jibeframework.core

Examples of org.jibeframework.core.JibeRuntimeException


  }

  private void moveNode(NodeRef targetRef, List<String> targetPath, List<String> childrenNames, NodeRef nodeRefToMove)
      throws FileNotFoundException {
    if (targetPath.contains(nodeRefToMove.toString())) {
      throw new JibeRuntimeException(ClipboardSupport.class, "circularRef");
    }
    Serializable name = serviceRegistry.getNodeService().getProperty(nodeRefToMove, ContentModel.PROP_NAME);
    if (childrenNames.contains(name)) {
      throw new JibeRuntimeException(ClipboardSupport.class, "allreadyExists", name);
    }
    serviceRegistry.getFileFolderService().move(nodeRefToMove, targetRef, null);
  }
View Full Code Here


    if (!nodeRef.equals(companyHome)) {
      List<FileInfo> fis = null;
      try {
        fis = serviceRegistry.getFileFolderService().getNamePath(companyHome, nodeRef);
      } catch (Exception e) {
        throw new JibeRuntimeException(e);
      }
      for (FileInfo fi : fis) {
        String v = property != null ? (String) serviceRegistry.getNodeService().getProperty(fi.getNodeRef(),
            property) : fi.getNodeRef().toString();
        l.add(v);
View Full Code Here

            Object val = data.get(paramName);
            if (val == null) {
              if (defaultValue != null) {
                val = defaultValue;
              } else if (required) {
                throw new JibeRuntimeException(paramName
                    + " parameter has to be present in the request");
              }
            }
            if (conversionService.canConvert(val.getClass(), parameters[i].getParameterType())) {
              args[i] = conversionService.convert(val, parameters[i].getParameterType());
View Full Code Here

    }
    XMLConfiguration xmlConfig = new XMLConfiguration();
    try {
      xmlConfig.load(new StringReader(w.toString()));
    } catch (ConfigurationException e) {
      throw new JibeRuntimeException(e);
    }
    xmlConfig.setExpressionEngine(new XPathExpressionEngine());
    cc.setConfiguration(xmlConfig);
    return cc;
  }
View Full Code Here

      Expression expr = parser.parseExpression(condition);
      Object value = expr.getValue(evalContext);
      if (value instanceof Boolean) {
        return (Boolean) value;
      }
      throw new JibeRuntimeException("Wrong value returned:" + condition);
    }
    return true;

  }
View Full Code Here

        org.jibeframework.core.annotation.ConditionFunction.class, evalMethod, arguments);
    if (obj instanceof Boolean) {
      Boolean result = (Boolean) obj;
      return result ? BooleanTypedValue.TRUE : BooleanTypedValue.FALSE;
    }
    throw new JibeRuntimeException("Condition evaluation methods has to have Boolean return value: "
        + evalMethod);
  }
View Full Code Here

    Object obj = CoreServices.getMethodService().invoke(methodReference, arguments);
    if (obj instanceof Boolean) {
      Boolean result = (Boolean) obj;
      return result ? BooleanTypedValue.TRUE : BooleanTypedValue.FALSE;
    }
    throw new JibeRuntimeException("Condition evaluation methods has to have Boolean return value: "
        + methodReference);
  }
View Full Code Here

        this.actualArguments = new Class<?>[actualTypeArguments.length];
        for (int i = 0; i < actualTypeArguments.length; i++) {
          if (actualTypeArguments[i] instanceof Class<?>) {
            this.actualArguments[i] = (Class<?>) actualTypeArguments[i];
          } else {
            throw new JibeRuntimeException("Nested generics are not supported");
          }
        }
      }
      this.object = object;
    }
View Full Code Here

    TemplateHashModel staticModels = wrapper.getStaticModels();
    Object servicesStatic = null;
    try {
      servicesStatic = staticModels.get(CoreServices.class.getName());
    } catch (TemplateModelException e) {
      throw new JibeRuntimeException("Services class can not be inserted into template model", e);
    }
    model.put("CoreServices", servicesStatic);
    Context currentContext = Context.getCurrentContext();
    if (currentContext != null) {
      model.put("CurrentContext", currentContext);
    }
    Template t = null;
    try {
      t = getConfig().getTemplate(
          new StringBuilder("/").append(templateId.replace('.', '/')).append(".ftl").toString());
    } catch (IOException e) {
      throw new TemplateNotFoundException();
    }
    Writer out = new StringWriter(1024);
    try {
      t.process(model, out);
    } catch (Exception e) {
      throw new JibeRuntimeException("There was an error processing template:" + templateId, e);
    }
    return out.toString();
  }
View Full Code Here

        }

      }
    }
    if (object == null) {
      throw new JibeRuntimeException("Matching constructor was not found:" + clazz.getName());
    }
    return object;
  }
View Full Code Here

TOP

Related Classes of org.jibeframework.core.JibeRuntimeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.