Class RelationsListServiceImpl

java.lang.Object
ch.tocco.nice2.netui.impl.bind.entity.RelationsListServiceImpl
All Implemented Interfaces:
RelationsListService

public class RelationsListServiceImpl extends Object implements RelationsListService
Impl notes: code based on GetRelationTypesAction. I just made it work, did not beautify code to be more dwr-like.
  • Constructor Details

    • RelationsListServiceImpl

      public RelationsListServiceImpl(Context context, DataModel dataModel, org.slf4j.Logger log)
  • Method Details

    • getRelations

      public Map<String,String[]> getRelations(String entityName, String pk, boolean onlyToMany, boolean withCount) throws PersistException
      Description copied from interface: RelationsListService

      Which relations are returned depends on config, param and convention: If configuration exists then it dictates. From the entity xml file, section visualisation, tag relation-list. Otherwise all to-n relations are taken (param 'onlyToMany' has a default of true), and related entities of type "standard" come before those of type "lookup" because they are usually more important.

      The action returns (for historical reasons) a map with the relation name as key (eg 'relMembership') and an String[] with the 3 entries - 'label' (as localized text, eg 'Mitgliedschaft'), - entity name (eg 'Membership), - number of relations 0-n, -1 if the getting the amount threw an ex.

      Specified by:
      getRelations in interface RelationsListService
      Throws:
      PersistException