public void run(UnitAnnouncementBoard board, UnitAnnouncementBoardParameters parameters)
      throws FenixServiceException {

    board.setUnitPermittedReadGroupType(parameters.readersGroupType);
    board.setUnitPermittedWriteGroupType(parameters.writersGroupType);
    board.setUnitPermittedManagementGroupType(parameters.managementGroupType);
    board.setName(new MultiLanguageString(parameters.name));
    board.setMandatory(parameters.mandatory);
    board.setReaders(this.buildGroup(parameters.readersGroupType, board.getParty()));
    board.setWriters(this.buildGroup(parameters.writersGroupType, board.getParty()));
    board.setManagers(this.buildGroup(parameters.managementGroupType, board.getParty()));
  }
Beispiel #2
0
  public Unit getUnit(HttpServletRequest request) {
    String parameter = request.getParameter(getContextParamName());

    if (parameter == null) {
      UnitSite site = SiteMapper.getSite(request);
      if (site != null) {
        return site.getUnit();
      }
      UnitAnnouncementBoard board = getDomainObject(request, "announcementBoardId");
      if (board != null) {
        return board.getUnit();
      }
      Announcement announcement = getDomainObject(request, "announcementId");
      if (announcement != null) {
        return ((UnitAnnouncementBoard) announcement.getAnnouncementBoard()).getUnit();
      }
    }

    try {
      return (Unit) FenixFramework.getDomainObject(parameter);
    } catch (NumberFormatException e) {
      return null;
    }
  }