예제 #1
0
 /**
  * @param groupName
  * @return
  * @throws DynamicExtensionsApplicationException
  * @throws DynamicExtensionsSystemException
  */
 private List<NameValueBean> getFormNamesForGroup(String groupId)
     throws DynamicExtensionsSystemException, DynamicExtensionsApplicationException {
   ArrayList<NameValueBean> formNames = new ArrayList<NameValueBean>();
   if (groupId != null) {
     EntityManagerInterface entityManager = EntityManager.getInstance();
     Long iGroupId = null;
     try {
       iGroupId = Long.parseLong(groupId);
       Collection<ContainerInterface> containerInterfaceList =
           entityManager.getAllContainersByEntityGroupId(iGroupId);
       if (containerInterfaceList != null) {
         // EntityInterface entity = null;
         NameValueBean formName = null;
         for (ContainerInterface entityContainer : containerInterfaceList) {
           if (entityContainer != null) {
             formName = new NameValueBean(entityContainer.getCaption(), entityContainer.getId());
             formNames.add(formName);
           }
         }
       }
     } catch (NumberFormatException e) {
       Logger.out.error("Group Id is null..Please check");
     }
   }
   return formNames;
 }
예제 #2
0
  /**
   * This method will internally call getIncomingAssociationIds of DE which will return all incoming
   * associations for entities passed.This method will filter out all incoming containment
   * associations and return list of them.
   *
   * @param entity entity
   * @throws DynamicExtensionsSystemException DynamicExtensionsSystemException
   * @return list List of incoming containment associations.
   */
  public static List<AssociationInterface> getIncomingContainmentAssociations(
      EntityInterface entity) throws DynamicExtensionsSystemException {
    EntityManagerInterface entityManager = EntityManager.getInstance();
    ArrayList<Long> allIds = (ArrayList<Long>) entityManager.getIncomingAssociationIds(entity);
    List<AssociationInterface> list = new ArrayList<AssociationInterface>();
    for (Long id : allIds) {
      AssociationInterface associationById = EntityCache.getInstance().getAssociationById(id);

      RoleInterface targetRole = associationById.getTargetRole();
      if (targetRole
          .getAssociationsType()
          .getValue()
          .equals(AQConstants.CONTAINTMENT_ASSOCIATION)) {
        list.add(associationById);
      }
    }
    return list;
  }