Package org.infoglue.cms.applications.databeans

Examples of org.infoglue.cms.applications.databeans.GenericOptionDefinition


    if(options != null)
      optionsPerfectMatchIterator = options.iterator();

    while(optionsPerfectMatchIterator.hasNext())
    {
      GenericOptionDefinition option = optionsPerfectMatchIterator.next();
        try
        {
          if(componentProperty != null && componentProperty.getValue() != null && option != null && option.getValue() != null)
          {
            //The option values
            String optionValue = option.getValue();
            //The saved values
            String[] optionValueArray = optionValue.split(",");
            String[] values = componentProperty.getValue().split(",");
            logger.info("optionValue:" + optionValue);
            logger.info("savedValue:" + componentProperty.getValue());
         
              Set<String> optionValueSet = new HashSet(Arrays.asList(optionValueArray));
            List<String> optionValueList = new ArrayList(Arrays.asList(optionValueSet.toArray()));
            Collections.sort(optionValueList);

            Set<String> valuesSet = new HashSet(Arrays.asList(values));
            List<String> valuesList = new ArrayList(Arrays.asList(valuesSet.toArray()));
            Collections.sort(valuesList);
           
            String newOptionValue = "";
            for(String value : optionValueList)
              newOptionValue += value + ",";

            String newValuesList = "";
            for(String value : valuesList)
              newValuesList += value + ",";
           
            logger.info("newOptionValue:" + newOptionValue);
            logger.info("newValuesList:" + newValuesList);
           
            if(newOptionValue.equals(newValuesList))
              exactMatchOptionName = option.getName();
          }
        }
        catch (Exception e)
        {
          logger.error("Error getting exact match: " + e.getMessage(), e);
View Full Code Here

TOP

Related Classes of org.infoglue.cms.applications.databeans.GenericOptionDefinition

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.