Package com.adito.boot

Examples of com.adito.boot.PropertyClass


            } else if (getDescription().trim().equals("")) {
                errs.add(Globals.ERROR_KEY, new ActionMessage(getResourcePrefix() + ".error.noDescription"));
            } else {
                if (!getEditing()) {
                    try {
                        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(getAttributeClass());
                        AttributeDefinition def = (AttributeDefinition) propertyClass.getDefinition(getName());
                        if (def != null) {
                            errs.add(Globals.ERROR_KEY, new ActionMessage(getResourcePrefix() + ".error.duplicateName", getName()));
                        }
                    } catch (Exception e) {
                        log.error("Failed to test if attribute exists.", e);
View Full Code Here


        log.info("Requesting " + getRequestingProtocol() + " proxy authentication for " + getRequestingSite() + " ("
                        + getRequestingHost() + ":" + getRequestingPort() + "), prompt = " + getRequestingPrompt());
        String user = null;
        String pass = null;
        try {
            PropertyClass contextConfiguration = ContextHolder.getContext().getConfig();
            if (getRequestingProtocol().startsWith("SOCKS")) {
                user = contextConfiguration.retrieveProperty(new ContextKey("proxies.socksProxyUser"));
                pass = contextConfiguration.retrieveProperty(new ContextKey("proxies.socksProxyPassword"));
            } else {
                user = contextConfiguration.retrieveProperty(new ContextKey("proxies.http.proxyUser"));
                pass = contextConfiguration.retrieveProperty(new ContextKey("proxies.http.proxyPassword"));
            }
        } catch (Exception e) {
            log.error("Failed to get proxy authentication details.");
            return null;
        }
View Full Code Here

          for (Iterator ci = propertyDefinitionsElement.getChildren()
              .iterator(); ci.hasNext();) {
            Element c = (Element) ci.next();
            PropertyClassManager pcm = PropertyClassManager
                .getInstance();
            PropertyClass pc = pcm.getPropertyClass(c.getName());
            if (pc == null) {
              throw new ExtensionException(
                  ExtensionException.INTERNAL_ERROR,
                  "No property definition class named "
                      + c.getName());
            }
            for (Iterator ei = c.getChildren().iterator(); ei
                .hasNext();) {
              Element ec = (Element) ei.next();
              if (ec.getName().equals("definition")) {
                PropertyDefinition def;
                if (pc instanceof AttributesPropertyClass) {
                  def = new XMLAttributeDefinition(ec);
                } else {
                  def = new XMLPropertyDefinition(ec);
                }
                propertyDefinitions.put(def.getName(), def);
                pc.registerPropertyDefinition(def);
              } else if (ec.getName().equals("category")) {
                PropertyDefinitionCategory cat = new DefaultPropertyDefinitionCategory(
                    ec.getAttribute("id").getIntValue(), ec
                        .getAttributeValue("bundle"),
                    ec.getAttributeValue("image"));
                cat.setPropertyClass(pc);
                if (ec.getAttributeValue("parent") == null) {
                  pc.addPropertyDefinitionCategory(-1, cat);
                } else {
                  PropertyDefinitionCategory parentCat = pc
                      .getPropertyDefinitionCategory(ec
                          .getAttribute("parent")
                          .getIntValue());
                  if (parentCat == null) {
                    throw new ExtensionException(
                        ExtensionException.INTERNAL_ERROR,
                        "No parent category for "
                            + cat.getId()
                            + " of "
                            + ec
                                .getAttributeValue("parent"));
                  }
                  pc.addPropertyDefinitionCategory(parentCat
                      .getId(), cat);
                }
                propertyDefinitionCategories.put(cat.getId(),
                    cat);
              } else {
View Full Code Here

            } else if(getDescription().trim().equals("")) {
                errs.add(Globals.ERROR_KEY, new ActionMessage("editAttributeDefinition.error.noDescription"));
            } else {
                if(!getEditing()) {
                    try {
                        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
                        AttributeDefinition def = (AttributeDefinition)propertyClass.getDefinition(getName());
                        if(def != null) {
                            errs.add(Globals.ERROR_KEY, new ActionMessage("editAttributeDefinition.error.duplicateName", getName()));                       
                        }
                    }
                    catch(Exception e) {
View Full Code Here

     */
    public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                    HttpServletResponse response) throws Exception {
        List<AttributeValueItem> a = new ArrayList<AttributeValueItem>();
        SessionInfo sessionInfo = getSessionInfo(request);
        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(UserAttributes.NAME);
        for(PropertyDefinition d : propertyClass.getDefinitions()) {
            AttributeDefinition def = (AttributeDefinition)d;
            if(def.isHidden())
              continue;
            if(def.getVisibility() == AttributeDefinition.USER_OVERRIDABLE_ATTRIBUTE ||
                            def.getVisibility() == AttributeDefinition.USER_VIEWABLE_ATTRIBUTE
View Full Code Here

     * @param key key
     * @return definition or <code>null</codE> if no definition could be found
     */
    public static PropertyDefinition getDefinition(AbstractPropertyKey key) {
        PropertyClassManager mgr = PropertyClassManager.getInstance();
        PropertyClass propertyClass = mgr.getPropertyClass(key.getPropertyClassName());
        if (propertyClass == null) {
            throw new IllegalArgumentException("Invalid property class " + key.getPropertyClassName() + ".");
        }
        return propertyClass.getDefinition(key.getName());
    }
View Full Code Here

    public static String setProperty(AbstractPropertyKey key, String newValue, SessionInfo sessionInfo) {

        PropertyDefinition def = getDefinition(key);
        PropertyProfile p = null;
        try {
            PropertyClass t = def.getPropertyClass();
            String oldVal = t.storeProperty(key, newValue);
            if ( ( oldVal == null && newValue != null ) || !oldVal.equals(newValue)) {
                if (key instanceof ProfilePropertyKey) {
                    p = ProfilesFactory.getInstance().getPropertyProfile(((ProfilePropertyKey) key).getProfile());
                }
                CoreServlet.getServlet().fireCoreEvent(new PropertyChangeEvent(def,
View Full Code Here

    public static String getProperty(AbstractPropertyKey key) throws IllegalArgumentException {
        PropertyDefinition def = getDefinition(key);
        if (def == null) {
            throw new IllegalArgumentException("Invalid key. " + key);
        }
        PropertyClass t = def.getPropertyClass();
        return t.retrieveProperty(key);
    }
View Full Code Here

TOP

Related Classes of com.adito.boot.PropertyClass

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.