/** * Performs late initialization. Called just before the first use of the service. * * <p>If your class relies on early initialization, and the object it expects was not received, * you can use late initialization to throw an exception and complain. * * @exception InitializationException, if initialization of this class was not successful. */ public synchronized void init() throws InitializationException { super.init(); m_runDataService = (JetspeedRunDataService) TurbineServices.getInstance().getService(RunDataService.SERVICE_NAME); } // init
@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); }
/** * This is the early initialization method called by the Turbine <code>Service</code> framework * * @param conf The <code>ServletConfig</code> * @exception throws a <code>InitializationException</code> if the service fails to initialize */ @Override public synchronized void init(ServletConfig conf) throws InitializationException { if (getInit()) { return; } super.init(conf); this.runDataService = (JetspeedRunDataService) TurbineServices.getInstance().getService(RunDataService.SERVICE_NAME); setInit(true); }
/** * This method returns the Fulcrum secturit service from avalon * * @return @throws InitializationException */ public SecurityService getSecurityService() throws InitializationException { SecurityService securityService; AvalonComponentService acs; acs = (AvalonComponentService) TurbineServices.getInstance().getService(AvalonComponentService.SERVICE_NAME); try { securityService = (SecurityService) acs.lookup(SecurityService.ROLE); } catch (ComponentException ce) { throw new InitializationException( "Could not retrieve Avalon Security Service:" + ce.getMessage(), ce); } return securityService; }
/** * @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); } }
/* * Utility method for accessing the service * implementation * * @return a SecurityCacheService implementation instance */ protected static SecurityCacheService getService() { return (SecurityCacheService) TurbineServices.getInstance().getService(SecurityCacheService.SERVICE_NAME); }
public static ALMailFactoryService getInstance() { return (ALMailFactoryService) TurbineServices.getInstance().getService(ALMailFactoryService.SERVICE_NAME); }