Project

General

Profile

metacat / lib / style / skins / sanparks / scheduleWorkflowRun.jsp @ 6737

1
<%@ page language="java" %>
2
<%@ page import="java.util.TimeZone" %>
3
<%@ page import="edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface" %>
4
<%@ page import="edu.ucsb.nceas.metacat.PermissionController" %>
5
<%@ page import="edu.ucsb.nceas.utilities.LSIDUtil" %>
6
<%
7
/*
8
*  '$RCSfile$'
9
*    Copyright: 2009 Regents of the University of California and the
10
*               National Center for Ecological Analysis and Synthesis
11
*
12
*   '$Author: daigle $'
13
*     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
14
* '$Revision: 4080 $'
15
*
16
* This program is free software; you can redistribute it and/or modify
17
* it under the terms of the GNU General Public License as published by
18
* the Free Software Foundation; either version 2 of the License, or
19
* (at your option) any later version.
20
*
21
* This program is distributed in the hope that it will be useful,
22
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
* GNU General Public License for more details.
25
*
26
* You should have received a copy of the GNU General Public License
27
* along with this program; if not, write to the Free Software
28
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
*/
30

    
31
String karLsid = request.getParameter("karid");
32
String karId = LSIDUtil.getDocId(karLsid, false);
33
PermissionController permissionController = new PermissionController(karId);
34
boolean hasSchedulePermissions = 
35
	permissionController.hasPermission(request.getSession().getId(), AccessControlInterface.READSTRING);
36

    
37
%>
38
<%@ include file="settings.jsp"%>
39

    
40
<html>
41
    <head>
42
        <title>Sanparks TPC Report Search</title>
43
        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks.css"/>
44
        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks-tpc.css"/>
45
        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks-scheduled-jobs.css"/>
46
        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/header2.css"/>
47
        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/left-nav2.css"/>
48
        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/footer2.css"/>
49
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_SKINS_URL%>/sanparks/sanparks.js"></script>
50
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/style/skins/sanparks/searchWorkflowPathQuery.js"></script>
51
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/branding.js"></script>
52
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/widgets/form-fields-widget.js"></script>
53
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js"></script>
54
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/ajax-utils.js"></script>
55
        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/scheduleWorkflow.js"></script>
56
    </head>
57
    <body onload="getWorkflowRunSection('<%=SERVLET_URL%>','<%=request.getParameter("workflowid")%>','<%=request.getParameter("workflowname")%>','<%=request.getParameter("karid")%>','<%=request.getSession().getId()%>','<%=authenticationServiceURL%>','<%=authorizationServiceURL%>','workflow-run-content')">
58
		<table class="page-section" cellpadding="0" cellspacing="0" border="0">
59
			<tr>
60
				<td>
61
        			<table class="center-content-section" cellpadding="0" cellspacing="0" border="0">
62
        				<tr>
63

    
64
           
65
    						<td class="schedule-section">  
66
    	    					<div class="content-subsection" id="workflow-summary-section"> 
67
<%
68
    	    						if (! hasSchedulePermissions) {
69
%>
70
									<div class="warning-header">You have view permissions only for this workflow</div>
71
<%
72
    	    						} 
73
%>		
74
									<div class="content-subsection-header">Workflow Summary</div> 
75
    								<div class="form-input-row" id="form-base-row">
76
    									<div class="summary-field" id='workflow-name-label' >Name: </div>  
77
<%
78
										if (request.getParameter("workflowname") != null) {
79
%>
80
										<div class="summary-value" id='workflow-name-value' ><%=request.getParameter("workflowname")%></div>
81
<%
82
										}
83
%>	  
84
										<br>
85
										<div class="summary-field" id='workflow-lsid-label' >LSID: </div>  
86
<%
87
										if (request.getParameter("karid") != null) {
88
%>
89
										<div class="summary-value" id='workflow-lsid-value' ><%=request.getParameter("workflowid")%></div>
90
<%
91
    	    								if (hasSchedulePermissions) {
92
%>
93
											(<jsp:text><![CDATA[<a href=]]></jsp:text><%=STYLE_SKINS_URL%><jsp:text><![CDATA[/sanparks/workflowAccessMain.jsp?karfilelsid=]]></jsp:text><jsp:expression>request.getParameter("karid")</jsp:expression><jsp:text><![CDATA[&workflowname=]]></jsp:text><jsp:expression>request.getParameter("workflowname")</jsp:expression><jsp:text><![CDATA[>Change Access Permissions</a>]]></jsp:text>)						
94
<%
95
    	    								}
96
										}
97
%>	  
98
									</div>
99
								</div>
100
								<div class="content-subsection" id="schedule-section">   
101
    								<div class="content-subsection-header">Schedule Workflow </div> 
102
        							<form action="<%=SERVLET_URL%>" name="workflowScheduler" id="workflowScheduler">
103
										<input name="qformat" value="sanparks" type="hidden" />
104
										<input name="action" value="scheduleWorkflow" type="hidden" />  
105
										<input name="forwardto" value="scheduleWorkflowRunMain.jsp" type="hidden" /> 
106
<%
107
										if (request.getParameter("workflowid") != null) {
108
%>
109
										<input name='workflowid' value='<%=request.getParameter("workflowid")%>' type='hidden' />
110
<%
111
										}
112
										if (request.getParameter("karid") != null) {
113
%>
114
										<input name='karid' value='<%=request.getParameter("karid")%>' type='hidden' />
115
<%
116
										}
117
										if (request.getParameter("workflowname") != null) {
118
%>
119
										<input name='workflowname' value='<%=request.getParameter("workflowname")%>' type='hidden' />
120
<%
121
										}
122
%>	  		 
123
          
124
 <%
125
                    if(CONTEXT_URL !=null){
126
 %>
127
                     <input name='sourceRepositoryBaseURL' value='<%=CONTEXT_URL%>' type='hidden' />
128
 <%
129
                    }
130
 %>        
131
 
132
 <%
133
                    if( authorizationPath !=null){
134
 %>
135
                     <input name='sourceAuthorPath' value='<%=authorizationPath%>' type='hidden' />
136
 <%
137
                    }
138
 %>                          
139
  
140
<%
141
                    if( queryPath !=null){
142
 %>
143
                     <input name='sourceQueryPath' value='<%=queryPath%>' type='hidden' />
144
<%
145
                    }
146
 %>                  
147
 
148
 <%
149
                    if(  workflowRunEngineName!=null){
150
 %>
151
                     <input name='workflowRunEngineName' value='<%=workflowRunEngineName%>' type='hidden' />
152
<%
153
                    }
154
 %>                      
155
  
156
<%
157
                    if( workflowRunEngineURL !=null){
158
 %> 
159
                    <input name='workflowRunEngineURL' value='<%=workflowRunEngineURL%>' type='hidden' />
160
<%
161
                    }
162
 %>         
163
 
164
 <%
165
                    if( request.getSession().getId() !=null){
166
 %>                   
167
                    <input name='sessionid' value='<%=request.getSession().getId()%>' type='hidden' />
168
 <%
169
                    }
170
 %>      
171
  
172
 <%
173
                    if( authenticationServiceURL !=null){
174
 %>                   
175
                    <input name='authServiceURL' value='<%=authenticationServiceURL%>' type='hidden' />
176
 <%
177
                    }
178
 %>                          
179
										<div class="form-input-row">
180
											<div class="field-label" id='start-time-label' >Start Time: </div>  
181
											<input class="date-input" name='starttime' id='starttime' /> 
182
											<div class="field-suffix"><%= TimeZone.getDefault().getDisplayName(true, TimeZone.SHORT) %> &nbsp;&nbsp;(mm/dd/yyyy hh:mm:ss)</div>
183
										</div>
184
										<div class="form-input-row">
185
											<div class="field-label" id='start-time-label' >End Time: </div>  
186
											<input class="date-input" name='endtime' id='endtime' /> 
187
											<div class="field-suffix"><%= TimeZone.getDefault().getDisplayName(true, TimeZone.SHORT) %> &nbsp;&nbsp;(mm/dd/yyyy hh:mm:ss)</div>
188
										</div>
189
										<div class="form-input-row">
190
											<div class="field-label" id='interval-label' >Interval: </div>  
191
											<input class="int-input" name='intervalvalue' id='intervalvalue' /> 
192
											<select class="dropdown-input" name='intervalunit'>
193
												<!-- option name="seconds" value="sec">seconds</option -->
194
												<!-- option name="minutes" value="min">minutes</option -->
195
												<option name="hours" value="hour">hours</option>
196
												<option name="days" value="day">days</option>
197
												<option name="weeks" value="week">weeks</option>
198
												<option name="months" value="mon">months</option>
199
											</select>
200
										</div>
201
										<div class="form-input-row">
202
                      <div class="field-label" id=resultDestination-label' >Result Destination: </div>  
203
                      <select class="dropdown-long-input" name='destinationRepositoryName'>
204
                        <%
205
                          for( int i = 0; i < repositoryList.size(); i++ )
206
                           {
207
                        %>
208
                            <option name='<%= repositoryList.elementAt( i ).toString() %>' value='<%= repositoryList.elementAt( i ).toString() %>' > 
209
                            <%=repositoryList.elementAt( i ).toString() %> </option>
210
                        <%
211
                          }
212
                        %>
213
                      </select>
214
                    </div>
215
										<br> <br>     		
216
					        			<input class="submit-button" value="Schedule" type="submit"
217
<%
218
					    	    		if (! hasSchedulePermissions) {
219
%>
220
											disabled="disabled"
221
<%
222
					    	    		}
223
%>      			
224
					        			> 
225
        							</form>
226
								</div>		
227
								<div class="content-subsection" id="workflow-run-section"> 
228
									<div class="content-subsection-header">Workflow Run Schedule</div> 
229
					    			<div class="workflow-run-content" id="workflow-run-content"></div>
230
								</div>
231
        					</td>
232
        				</tr>
233
        			</table>
234
        		</td>
235
        	</tr>
236
        </table>
237
    </body>
238
</html>