@Override public void init(ALAction action, RunData rundata, Context context) throws ALPageNotFoundException, ALDBErrorException { super.init(action, rundata, context); loginuserid = ALEipUtils.getUserId(rundata); viewtype = "detail"; if (ALEipUtils.isMatch(rundata, context)) { if (rundata.getParameters().containsKey("view_date")) { view_date = new ALDateTimeField("yyyy-MM-dd"); String tmpViewDate = rundata.getParameters().getString("view_date"); view_date.setValue(tmpViewDate); if (!view_date.validate(new ArrayList<String>())) { view_date = null; } } } if (rundata.getParameters().containsKey("userid")) { String tmpid = rundata.getParameters().getString("userid"); if (tmpid != null && tmpid.startsWith(ScheduleUtils.TARGET_FACILITY_ID)) { userid = Integer.parseInt( tmpid.substring(ScheduleUtils.TARGET_FACILITY_ID.length(), tmpid.length())); type = ScheduleUtils.SCHEDULEMAP_TYPE_FACILITY; } else { userid = rundata.getParameters().getInt("userid"); type = ScheduleUtils.SCHEDULEMAP_TYPE_USER; } } else if (rundata.getParameters().containsKey("facilityid")) { userid = Integer.parseInt(rundata.getParameters().getString("facilityid")); type = ScheduleUtils.SCHEDULEMAP_TYPE_FACILITY; } // アクセス権限 ALAccessControlFactoryService aclservice = (ALAccessControlFactoryService) ((TurbineServices) TurbineServices.getInstance()) .getService(ALAccessControlFactoryService.SERVICE_NAME); ALAccessControlHandler aclhandler = aclservice.getAccessControlHandler(); hasAclviewOther = aclhandler.hasAuthority( loginuserid, ALAccessControlConstants.POERTLET_FEATURE_SCHEDULE_OTHER, ALAccessControlConstants.VALUE_ACL_LIST); con = new ScheduleOnedayContainer(); con.initField(); con.initHour(0, 24); }
/** * @param action * @param rundata * @param context * @throws ALPageNotFoundException * @throws ALDBErrorException */ @Override public void init(ALAction action, RunData rundata, Context context) throws ALPageNotFoundException, ALDBErrorException { super.init(action, rundata, context); if (rundata.getParameters().containsKey(ALEipConstants.LIST_FILTER)) { ALEipUtils.setTemp( rundata, context, ScheduleUtils.FILTER_NAMESPACE, rundata.getParameters().getString(ALEipConstants.LIST_FILTER)); } if (rundata.getParameters().containsKey(ALEipConstants.LIST_FILTER_TYPE)) { ALEipUtils.setTemp( rundata, context, ScheduleUtils.FILTER_NAMESPACE_TYPE, rundata.getParameters().getString(ALEipConstants.LIST_FILTER_TYPE)); } viewtype = "oneday-group"; try { termmap = new LinkedHashMap<Integer, List<ScheduleOnedayResultData>>(); map = new LinkedHashMap<Integer, ScheduleOnedayContainer>(); todomap = new LinkedHashMap<Integer, List<ScheduleToDoResultData>>(); facilitymap = new LinkedHashMap<Integer, ScheduleOnedayContainer>(); groups = ALEipUtils.getMyGroups(rundata); facilitiyGroups = ALEipUtils.getALEipGroups(); userid = ALEipUtils.getUserId(rundata); rows = new int[(endHour - startHour) * 12 + 1]; int size = rows.length; for (int i = 0; i < size; i++) { rows[i] = 1; } String filter = ALEipUtils.getTemp(rundata, context, ScheduleUtils.FILTER_NAMESPACE); target_group_name = getGroup(filter); if (filter == null) { VelocityPortlet portlet = ALEipUtils.getPortlet(rundata, context); String groupName = portlet.getPortletConfig().getInitParameter("p3a-group"); if (groupName != null) { ALEipUtils.setTemp(rundata, context, ScheduleUtils.FILTER_NAMESPACE, groupName); ALEipUtils.setTemp(rundata, context, ScheduleUtils.FILTER_NAMESPACE_TYPE, "group"); } } // ポートレット MyGroup のへのリンクを取得する. myGroupURI = ScheduleUtils.getPortletURIinPersonalConfigPane(rundata, "MyGroup"); // アクセス権限 ALAccessControlFactoryService aclservice = (ALAccessControlFactoryService) ((TurbineServices) TurbineServices.getInstance()) .getService(ALAccessControlFactoryService.SERVICE_NAME); ALAccessControlHandler aclhandler = aclservice.getAccessControlHandler(); hasAclviewOther = aclhandler.hasAuthority( userid, ALAccessControlConstants.POERTLET_FEATURE_SCHEDULE_OTHER, ALAccessControlConstants.VALUE_ACL_LIST); hasAuthoritySelfInsert = aclhandler.hasAuthority( userid, ALAccessControlConstants.POERTLET_FEATURE_SCHEDULE_SELF, ALAccessControlConstants.VALUE_ACL_INSERT); hasAuthorityFacilityInsert = aclhandler.hasAuthority( userid, ALAccessControlConstants.POERTLET_FEATURE_SCHEDULE_FACILITY, ALAccessControlConstants.VALUE_ACL_INSERT); } catch (Exception ex) { logger.error("[ScheduleOnedayGroupSelectData]", ex); } }