Package org.apache.slide.projector.value

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


        String result = element.getAttributeValue("result");
        String store = element.getAttributeValue("store");
    int storeId = StoreHelper.getStoreByName(store);
        String key = element.getAttributeValue("key");
        String domain = element.getAttributeValue("domain");
        URI processorUri = ( processor == null ? null : new URIValue(processor) );
        Iterator children = element.getChildren().iterator();
      Value input = null;
        if ( children.hasNext() ) {
          Element childElement = (Element)children.next();
          input = ValueFactoryManager.getInstance().loadValue(childElement);
View Full Code Here


  public Value valueOf(Object value, Context context) throws ValueCastException {
        if ( value instanceof URIValue ) {
            return (URIValue)value;
        } else {
          try {
                return new URIValue(StringValueDescriptor.ANY.valueOf(value, null).toString());
            } catch ( ValueCastException exception ) {
              throw new ValueCastException(new ErrorMessage("uncastableUriValue", new Object[] { value }), exception);
            }
        }
  }
View Full Code Here

    public static ProcessorManager getInstance() {
        return processorManager;
    }

  public void notify(String uri, Map information) {
    URI configurationUri = new URIValue(uri);
    update((URI)configurationToApplication.get(configurationUri), configurationUri);
  }
View Full Code Here

  public String getElementName() {
      return "uri";
    }

  public Value load(Element element) {
    return new URIValue(element.getText());
  }
View Full Code Here

      }
     
      public void startElement(SimplePath path, String name, AttributesImpl attributes, String leadingCDdata) {
            if (path.matches("processor")) {
              boolean modified = false, added = false;
              URI uri = new URIValue(attributes.getValue("uri"));
              removedProcessors.remove(uri);
              String configURI = attributes.getValue("config-uri");
                String processorName = attributes.getValue("name");
                String descriptionKey = attributes.getValue("description");
                String smallIcon = attributes.getValue("small-icon");
                String largeIcon = attributes.getValue("large-icon");
                String clazz = attributes.getValue("class");
                String bookmark = attributes.getValue("bookmark");
                Processor processor = (Processor)processorMap.get(uri);
                ProcessorDescriptor processorDescriptor = (ProcessorDescriptor)processorDescriptors.get(uri);
                try {
                  if ( processor == null ) {
                    processor = (Processor)processorClassLoader.loadClass(clazz).getConstructor(new Class[0]).newInstance(new Object[0]);
                    added = true;
                    modified = true;
                  }
                  if ( processorDescriptor == null ) {
                    processorDescriptor = new ProcessorDescriptor(uri);
                    modified = true;
                  }
                  if ( processorName == null ) processorName = uri.toString();
                  if ( processorDescriptor.getName() == null || !processorDescriptor.getName().equals(processorName) ) {
                    processorDescriptor.setName(processorName);
                    modified = true;
                  }
                  if ( descriptionKey == null ) {
                    descriptionKey = "processorManager/noProcessorDescriptionAvailable";
                  }
                  DefaultMessage description = null;
                  if ( processorDescriptor.getDescription() == null || !processorDescriptor.getDescription().getId().equals(descriptionKey) ) {
                    description = new DefaultMessage(descriptionKey);
                    processorDescriptor.setDescription(description);
                    modified = true;
                  }
                  if ( processorDescriptor.getProcessor() != processor ) {
                    processorDescriptor.setProcessor(processor);
                    modified = true;
                  }
                  URI smallIconUri = SMALL_DEFAULT_ICON, largeIconUri = LARGE_DEFAULT_ICON;
                  if ( smallIcon != null ) smallIconUri = new URIValue(smallIcon);
                  if ( largeIcon != null ) largeIconUri = new URIValue(largeIcon);
                  if ( processorDescriptor.getSmallIcon() == null || !processorDescriptor.getSmallIcon().equals(smallIconUri) ) {
                    processorDescriptor.setSmallIcon(smallIconUri);
                    modified = true;
                  }
                  if ( processorDescriptor.getLargeIcon() == null || !processorDescriptor.getLargeIcon().equals(largeIconUri) ) {
                      processorDescriptor.setLargeIcon(largeIconUri);
                    modified = true;
                  }
                  if ( bookmark != null ) {
                    boolean isBookmark = Boolean.valueOf(bookmark).booleanValue();
                    if ( processorDescriptor.isBookmark() != isBookmark ) {
                      processorDescriptor.setBookmark(isBookmark);
                      modified = true;
                    }
                  }
                  if ( processor instanceof ConfigurableProcessor && configURI != null ) {
                    if ( !configURI.startsWith("/") ) {
                      configURI = applicationUri.toString() + configURI;
                    }
                    URI configurationUri = new URIValue(configURI);
                    if ( processorDescriptor.getConfiguration() == null || !processorDescriptor.getConfiguration().equals(configurationUri) ) {
                      logger.log(Level.FINE, "Configuring processor with config-URI=" + configURI);
                      processorDescriptor.setConfiguration(configurationUri);
                      StreamableValue config = (StreamableValue)Projector.getRepository().getResource(configurationUri, Projector.getCredentials());
                      ((ConfigurableProcessor)processor).configure(config);
View Full Code Here

      }
    }

    class ConfigurationListener implements Subscriber {
      public void notify(String uri, Map information) {
        URI processorUri = new URIValue(uri);
        Processor processor = (Processor)configuredProcessors.get(processorUri);
        logger.log(Level.FINE, "Reloading processor with configuration URI='"+uri+"'");
        try {
          StreamableValue config = (StreamableValue)Projector.getRepository().getResource(processorUri, Projector.getCredentials());
          ((ConfigurableProcessor)processor).configure(config);
View Full Code Here

        }
        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());
          mkcolMethod.setDoAuthentication(true);
            HttpState httpState = new HttpState();
            httpState.setCredentials(null, host, credentials);
            int state = mkcolMethod.execute(httpState, new HttpConnection(host, port, protocol));
            if ( state == HttpStatus.SC_CREATED ) {
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());
          mkcolMethod.setDoAuthentication(true);
            HttpState httpState = new HttpState();
            httpState.setCredentials(null, host, credentials);
            int state = mkcolMethod.execute(httpState, new HttpConnection(host, port, protocol));
            if ( state == HttpStatus.SC_CREATED ) {
View Full Code Here

          String childUrl = (String)propertyEnumeration.nextElement();
          if ( !childUrl.equals(url) ) {
          if ( childUrl.indexOf(domain) != -) {
            childUrl = childUrl.substring(childUrl.indexOf(domain)+domain.length());
          }
            children.add(new URIValue(childUrl));
          }
        }
        return new ArrayValue((Value[])children.toArray(new Value[children.size()]));
    }
View Full Code Here

      boolean sessionCreated = request.getSession(false) == null;
      Context context = new HttpContext(request, response);
        logger.log(Level.FINE, "Request uri=" + request.getRequestURI());
        logger.log(Level.FINE, "Context path=" + request.getContextPath());
        logger.log(Level.FINE, "Servlet path=" + request.getServletPath());
        URI uri = new URIValue(request.getRequestURI().substring(request.getContextPath().length()+request.getServletPath().length()+1));
        try {
            Result result;
            Processor processor;
            try {
                logger.log(Level.FINE, "Processing started with URI=" + uri);
View Full Code Here

TOP

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

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.