01: /*
02: * Copyright 2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
07: * BI Platform. The Initial Developer is Pentaho Corporation.
08: *
09: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11: * the license for the specific language governing your rights and limitations.
12: */
13: package org.pentaho.plugin.quartz;
14:
15: import org.pentaho.core.session.IPentahoSession;
16: import org.pentaho.core.solution.IParameterProvider;
17: import org.pentaho.core.subscribe.SubscriptionHelper;
18: import org.pentaho.plugin.quartz.QuartzBackgroundExecutionHelper;
19: import org.quartz.JobDataMap;
20: import org.quartz.JobDetail;
21:
22: public class SecurityAwareBackgroundSubscriptionHelper extends
23: SecurityAwareBackgroundExecutionHelper {
24:
25: public void trackBackgroundExecution(IPentahoSession userSession,
26: String GUID) {
27: // Don't need to track this using hibernate, it is already tracked by subscription admin
28: }
29:
30: // Helper Utility Methods
31: protected JobDetail createDetailFromParameterProvider(
32: IParameterProvider parameterProvider,
33: IPentahoSession userSession, String outputContentGUID,
34: String solutionName, String actionPath, String actionName,
35: String jobGroup) {
36:
37: String subscribeName = parameterProvider.getStringParameter(
38: "subscribe-name", null); //$NON-NLS-1$
39: JobDetail jobDetail = super .createDetailFromParameterProvider(
40: parameterProvider, userSession, subscribeName,
41: solutionName, actionPath, actionName, jobGroup);
42: JobDataMap data = jobDetail.getJobDataMap();
43:
44: data.put(BACKGROUND_CONTENT_LOCATION_STR, SubscriptionHelper
45: .getSubscriptionOutputLocation(solutionName,
46: actionPath, actionName));
47: data
48: .put(
49: QuartzBackgroundExecutionHelper.BACKGROUND_CONTENT_GUID_STR,
50: subscribeName);
51: return jobDetail;
52:
53: }
54:
55: }
|