Package org.apache.slide.projector.value

Examples of org.apache.slide.projector.value.Value


        }
        return null;
    }
   
    public URI createUser(String username, String password, Credentials credentials) throws UserExistsException, IOException {
      Value userExists = getResource(new URIValue(users+username), credentials);
      if ( userExists == NullValue.NULL || userExists != null ) {
            throw new UserExistsException(new ErrorMessage("userExists", new String[] { username }));
        } else {
          URI userUri = new URIValue(users+username);
          MkcolMethod mkcolMethod = new MkcolMethod(domain+userUri.toString());
View Full Code Here


            ArrayValue.CONTENT_TYPE, false)  });
 
  public Result process(Map parameter, Context context) throws Exception {
    Value []values = ((ArrayValue)parameter.get(SimpleProcessor.INPUT)).getArray();
    boolean includeContent = ((BooleanValue)parameter.get(INCLUDE_CONTENT)).booleanValue();
    Value instructions = (Value)parameter.get(INSTRUCTIONS);
    List arrayEntries = new ArrayList();
    for ( int i = 0; i < values.length; i++ ) {
      Map map = ((MapValue)values[i]).getMap();
      Map resultMap = new HashMap();
      resultMap.putAll(map);
      URI uri = (URI)map.get(URI_ENTRY);
      Value content = Projector.getRepository().getResource(uri, context.getCredentials());
      if ( content != null ) {
        if ( instructions instanceof MapValue ) {
          if ( includeContent ) {
            content = new MultipleStreamableValue((StreamableValue) content);
          }
View Full Code Here

            return null;
        }
    }
   
    public URI createRole(String rolename, Credentials credentials) throws RoleExistsException, IOException {
      Value userExists = getResource(new URIValue(domain+roles+rolename), credentials);
      if ( userExists == NullValue.NULL || userExists != null ) {
            throw new RoleExistsException(new ErrorMessage("roleExists", new String[] { rolename }));
        } else {
          URI roleUri = new URIValue(roles+rolename);
          MkcolMethod mkcolMethod = new MkcolMethod(domain+roleUri.toString());
View Full Code Here

                processor = ProcessorManager.getInstance().getProcessor(DEFAULT_EXCEPTION_PROCESSOR);
                Map exceptionParameters = new HashMap();
                exceptionParameters.put(ExceptionRenderer.EXCEPTION, new ObjectValue(exception));
                result = ProcessorManager.process(processor, exceptionParameters, context);
            }
            Value presentableResource = ((HttpContext)context).getPresentableResource();
            if (presentableResource == null) {
                // check for 'output' resource in processor result
                presentableResource = (Value)result.getResultEntries().get(SimpleProcessor.OUTPUT);
            }
            if ( presentableResource != null ) {
View Full Code Here

 
  public Result process(Map parameter, Context context) throws Exception {
    URI uri = (URI)parameter.get(PROCESSOR);
    boolean continueProcess = ((BooleanValue)parameter.get(CONTINUE)).booleanValue();
    MapValue parameterMap = (MapValue)parameter.get(PARAMETERS);
    Value step = (Value)parameter.get(Process.STEP);
    StringBuffer linkBuffer = new StringBuffer(128);
    if ( context instanceof HttpContext ) {
            linkBuffer.append(((HttpContext)context).getContextPath()).append(uri);
            boolean first = true;
            if ( continueProcess ) {
View Full Code Here

        if ( context instanceof HttpContext ) {
            url = ((HttpContext)context).getContextPath()+"/"+ProcessorManager.getInstance().getURI(this)+"?input="+uri;
        }
        // check for cached result
        Map resultEntries = new HashMap();
        Value output = (Value)context.getStore(Store.CACHE).get(uri.toString());
        if ( output == null ) {
            output = Projector.getRepository().getResource(uri, context.getCredentials());
            if ( output instanceof InputStreamValue ) {
                output = new MultipleStreamableValue((StreamableValue)output);
            }
View Full Code Here

    private final static ResultDescriptor resultDescriptor = new ResultDescriptor(new StateDescriptor[] { StateDescriptor.OK_DESCRIPTOR });

    public Result process(Map parameter, Context context) throws Exception {
      String storeName = parameter.get(STORE).toString();
      String key = parameter.get(KEY).toString();
      Value value = (Value)parameter.get(VALUE);
      Value timeoutValue = (Value)parameter.get(TIMEOUT);
      Store store = context.getStore(StoreHelper.getStoreByName(storeName));
      if ( timeoutValue == NullValue.NULL ) {
        store.put(key, value);
      } else {
        long timeout = ((NumberValue)timeoutValue).getNumber().longValue();
View Full Code Here

            ParameterDescriptor parameterDescriptor = (ParameterDescriptor)i.next();
            ValueDescriptor entryDescriptor = parameterDescriptor.getValueDescriptor();
            String key = parameterDescriptor.getName();
            if ( key.equals(ALL) ) {
              for ( Iterator j = map.values().iterator(); j.hasNext(); ) {
                Value entryValue = (Value)j.next();
                if ( !(entryValue instanceof NullValue) ) {
                  entryDescriptor.validate(entryValue, context);
                }
              }
            } else {
              if ( !map.containsKey(key) ) {
                if ( parameterDescriptor.isRequired() ) {
                  throw new ValidationException(new ErrorMessage("mapEntryMissing", new String[] { key }));
                }
              } else {
                Value entryValue = (Value)map.get(key);
                if ( !(entryValue instanceof NullValue) ) {
                  entryDescriptor.validate(entryValue, context);
                }
              }
            }
View Full Code Here

  public Result process(Map parameters, Context context) throws Exception {
      Map jobParameters = ((MapValue)parameters.get(PARAMETERS)).getMap();
      URI jobUri = (URIValue)parameters.get(PROCESSOR);
      XMLValue initialCondition = (XMLValue)parameters.get(CONDITION);
      boolean repeatJob = ((BooleanValue)parameters.get(REPEAT)).booleanValue();
      Value remainingConditionValue = (Value)parameters.get(REMAINING_CONDITION);
      XMLValue remainingCondition = null;
      if ( remainingConditionValue == NullValue.NULL ) {
        remainingCondition = initialCondition;
      } else {
        remainingCondition = (XMLValue)remainingConditionValue;
View Full Code Here

TOP

Related Classes of org.apache.slide.projector.value.Value

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.