Examples of PropertyDefinition


Examples of at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.PropertyDefinition

    return "not documented!";
  }

  protected String getDocHeadForProperty(String propertyName) {
    Assert.isNotNull(propertyName);
    PropertyDefinition property = findPropertyByName(propertyName);
    if (property != null) {
      return getDocHeadForProperty(property);
    }
    return "<b>"+propertyName+"</b>";
  }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

    }

    @SuppressWarnings("deprecation")
    private void setValidationString(String validationString) {
        PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(RealmProperties.NAME);
        PropertyDefinition usernameProperty = propertyClass.getDefinition("activeDirectory.serviceAccountUsername");
        usernameProperty.setValidationString(validationString);
    }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     */
    public static int getUsersProfilePropertyIntOrDefault(HttpSession session, String propertyName, User user) {
        try {
            return Property.getPropertyInt(getPropertyProfileKey(session, propertyName, user));
        } catch (Exception expt) {
            PropertyDefinition definition = Property.getDefinition(getPropertyProfileKey(session, propertyName, null));
            return Integer.valueOf(definition.getDefaultValue());
        }
    }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * @throws JDOMException
     * @throws CodedException
     */
    @Test
    public void validPortWithNoMetaData() throws IOException, JDOMException, CodedException {
        PropertyDefinition definition = getWebServerPortDefinition();
        definition.setTypeMeta("");
        PortValidator validator = new PortValidator();
        validator.validate(definition, "69", null);
    }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * @throws JDOMException
     * @throws CodedException
     */
    @Test(expected = CoreException.class)
    public void invalidPortWithNoMetaData() throws IOException, JDOMException, CodedException {
        PropertyDefinition definition = getWebServerPortDefinition();
        definition.setTypeMeta("");
        PortValidator validator = new PortValidator();
        validator.validate(definition, "99999999", null);
    }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * @throws IOException
     * @throws JDOMException
     */
    @Test
    public void validPortSocketNotInUse() throws CodedException, IOException, JDOMException {
        PropertyDefinition definition = getWebServerPortDefinition();
        assertPortNotInUse(69);
        PortValidator validator = new PortValidator();
        validator.validate(definition, "69", null);
    }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

     * @throws IOException
     * @throws JDOMException
     */
    @Test(expected = CoreException.class)
    public void validPortSocketInUse() throws CodedException, IOException, JDOMException {
        PropertyDefinition definition = getWebServerPortDefinition();
        assertPortNotInUse(69);

        ServerSocket socket = new ServerSocket(69);
        try {
            PortValidator validator = new PortValidator();
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        if (isCommiting()) {
            ActionErrors errs = null;
            PropertyItem[] items = getPropertyItems();
            for (int i = 0; i < items.length; i++) {
                PropertyDefinition def = items[i].getDefinition();
                try {
                    def.validate(String.valueOf(items[i].getPropertyValue()), getClass().getClassLoader());
                } catch (CoreException ce) {
                    if (errs == null) {
                        errs = new ActionErrors();
                    }
                    ce.getBundleActionMessage().setArg3(
                        CoreUtil.getMessageResources(request.getSession(), def.getMessageResourcesKey()).getMessage(
                            (Locale) request.getSession().getAttribute(Globals.LOCALE_KEY), def.getName() + ".name"));
                    errs.add(Globals.ERROR_KEY, ce.getBundleActionMessage());
                } catch (Exception e) {
                    errs.add(Globals.ERROR_KEY, new ActionMessage("properties.error.failedToValidate", e.getMessage()));
                }
            }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errs = super.validate(mapping, request);
        if (isCommiting()) {
            try {
                for (AttributeValueItem item : attributeValueItems) {
                    PropertyDefinition def = item.getDefinition();
                    try {
                        def.validate(item.getValue().toString(), getClass().getClassLoader());
                    } catch (CoreException ce) {
                        ce.getBundleActionMessage().setArg3(item.getLabel());
                        errs.add(Globals.ERROR_KEY, ce.getBundleActionMessage());
                    }
                }
View Full Code Here

Examples of com.adito.boot.PropertyDefinition

            }
            PropertyClass propertyClass = PropertyClassManager.getInstance().getPropertyClass(propertyClassName);
            if(propertyClass == null) {
                throw new Exception("Invalid property class.");
            }
            PropertyDefinition def = propertyClass.getDefinition(name);
            if(def == null) {
                throw new Exception("No property definition with name of " + name);
            }
            else{
                // set the label and description from the messages resources if they have any.
                // If there are Application resources for the definition then set the label and description
                String label = CoreUtil.getMessage(request, def.getMessageResourcesKey(), def.getNameMessageResourceKey());
                if (label != null){
                    def.setLabel(label);
                }
//                String description = messageResources == null ? null : messageResources.getMessage(def.getDescriptionMessageResourceKey());
                String description = CoreUtil.getMessage(request, def.getMessageResourcesKey(), def.getDescriptionMessageResourceKey());
                if (description != null){
                    def.setDescription(description);
                }
            }
            request.setAttribute(Constants.REQ_ATTR_PROPERTY_DEFINITION, def);
            return mapping.findForward("property");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.