Package it.eng.spagobi.commons.metadata

Examples of it.eng.spagobi.commons.metadata.SbiUserFunctionality


      throw new Exception("No predefined user functionalities found!!!");
    }
    Iterator it = userFunctionalitiesList.iterator();
    while (it.hasNext()) {
      SourceBean aUSerFunctionalitySB = (SourceBean) it.next();
      SbiUserFunctionality aUserFunctionality = new SbiUserFunctionality();
      String userFunctionality = (String) aUSerFunctionalitySB.getAttribute("name");
      aUserFunctionality.setName(userFunctionality);
      aUserFunctionality.setDescription((String) aUSerFunctionalitySB.getAttribute("description"));
      Object roleTypesObject = roleTypeUserFunctionalitiesSB.getFilteredSourceBeanAttribute("ROLE_TYPE_USER_FUNCTIONALITY", "userFunctionality", userFunctionality);
      if (roleTypesObject == null) {
        throw new Exception("No role type found for user functionality [" + userFunctionality + "]!!!");
      }
      StringBuffer roleTypesStrBuffer = new StringBuffer();
      Set roleTypes = new HashSet();
      if (roleTypesObject instanceof SourceBean) {
        SourceBean roleTypeSB = (SourceBean) roleTypesObject;
        String roleTypeCd = (String) roleTypeSB.getAttribute("roleType");
        roleTypesStrBuffer.append(roleTypeCd);
        SbiDomains domainRoleType = findDomain(aSession, roleTypeCd, "ROLE_TYPE");
        roleTypes.add(domainRoleType);
      } else if (roleTypesObject instanceof List) {
        List roleTypesSB = (List) roleTypesObject;
        Iterator roleTypesIt = roleTypesSB.iterator();
        while (roleTypesIt.hasNext()) {
          SourceBean roleTypeSB = (SourceBean) roleTypesIt.next();
          String roleTypeCd = (String) roleTypeSB.getAttribute("roleType");
          roleTypesStrBuffer.append(roleTypeCd);
          if (roleTypesIt.hasNext()) {
            roleTypesStrBuffer.append(";");
          }
          SbiDomains domainRoleType = findDomain(aSession, roleTypeCd, "ROLE_TYPE");
          roleTypes.add(domainRoleType);
        }
      }
      aUserFunctionality.setRoleType(roleTypes);

      logger.debug("Inserting UserFunctionality with name = [" + aUSerFunctionalitySB.getAttribute("name") + "] associated to role types [" + roleTypesStrBuffer.toString() + "]...");

      aSession.save(aUserFunctionality);
    }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.metadata.SbiUserFunctionality

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.