SlideShare una empresa de Scribd logo
1 de 28
Job Management Portlet
A portlet example to access job
managment service
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Generic Porlets Life Cycle

YES

NO
End of
Services?

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Generic Porltlets Interface Method
Class GenericPortlets {
init (PortletConfig);
processAction (ActionRequest,
ActionResponse);
render (RenderRequest, RenderResponse);
destroy();
doView (Request, Response);
doEdit (Reuqest, Response);
doHelp (Request, Response);
}

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Portlet Mode
 A porltet works in three
different states.
 View Mode: generate a
markup ( a portion of a
web page);
 Edit Mode: allow portlet
customisation and
setting preferences.
 Help Mode: explains
portlet functionalities.
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Action/Render Request
Action
Request

view.jsp

Render
Request

processAction()

Action
Request

edit.jsp

doView()

edit.jsp

doEdit()

view.jsp

Render
Request

processAction()

Render
Request

view.jsp

doView()

view2.jsp

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Portlet workflow
init

doView

JSP page

ACTION/VIEW Architecture
Hostname code provides two
Enum types:
Actions and
Views

ProcessAction

init
doView

default

JSP page
JSP page

For each Action a different View
can be selected and easily managed by
switch statements
The two enumerated types used to
manage the portlet behavior
Between portlet methods:
‘doView and ProcessAction’.

Jsp/Java Variable: ‘PortletStatus’

ProcessAction
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Portlet Session data
init
doView

Two objecst:
JSP page

ProcessAction

actionRequest
processAction()

renderRequest
doView()
doHelp()
doEdit()

ProcessAction sends parameters to the other methods with a RenderRequest
through:
ActionResponse (2nd parameter of ProcessAction)
response.setRenderParameter("param_name_y", param_value_y);
doView/doHelp/doEdit (1st parameter) RenderRequest
param_name_w=request.getParameter("param_name_w");
Parameters to jsp and select it:
request.setAttribute("JobId", inputJobId);
getPortletContext().getRequestDispatcher(”/<view_page>.jsp");

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Parameters exchange (JSP->Java)
<form action=action="<portlet:actionURL
portletMode="view">
<portlet:param
name="param_name_1" value="param value 1"/>
…
<portlet:param
name="param_name_n" value="param value n"/>
…
<input … />
<input … />
<input type="submit" … />
</form>

 Portlet modes:
 VIEW – Userd for normal portlet operations -> calls processAction()
 EDIT – Userd to configure portlet parameters -> calls doEdit()
 HELP – Userd to show help information -> calls doHelp()
•
•

processAction(ActionRequest request,…
doView/doHelp/doEdit(RenderRequest
request,…
// To obtain the parameter just set …
String param_i = request.getParameter("param_name_i");

Tutorial on Science Gateways, Roma, 04.06.2013
Parameters exchange (Java->JSP)

doView/doHelp/doEdit(RenderRequest request,…
// To send the parameter just call …
request.setAttribute("param_name_j", param_name_j);

<%
// To load variables from Portlet Class …
%>
<jsp:useBean id="param_name_k" class="<variable type k>" scope="request"/>
<%
// To reference a param value
%>
<%=param_name_k%>

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
hostname-portlet example
input.jsp

 Portlet to send a test job into a
distributed infrastructure
 Input:
 Input file or a text
 A human readable job identifier

 Ouput
 Hostname of running machine
 File containing information about the
running machine

 Portlet statuses
submit.jsp

 INPUT
(Shows the input fields)
 SUBMIT
(Shows the job submission feedback)
 Jsp/Java variable ‘PortletStatus’
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Hostname Action/View enums

 Actions
 ACTION_INPUT
 ACTION_SUBMIT

Default Action
• Simply forward portlet status to
the doView() in:
RenderParameter

 Views (Possible portlet views)
 VIEW_INPUT
 VIEW_SUBMIT

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Hostname Action/View

 Actions
 ACTION_INPUT
 ACTION_SUBMIT

 Views
 VIEW_INPUT
 VIEW_SUBMIT

View
• Select the INPUT form view
input.jsp (default view mode)

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Hostname Action/View
 Actions
 ACTION_INPUT
 ACTION_SUBMIT

This action will submit the
hostname job into the distributed
infrastructure

 Views
 VIEW_INPUT
 VIEW_SUBMIT
<form enctype="multipart/form-data" action="<portlet:actionURL
portletMode="view">
<portlet:param name="PortletStatus" value="ACTION_SUBMIT"/>
</portlet:actionURL>"
method="post”>

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Hostname Action/View

 Actions
 ACTION_INPUT
 ACTION_SUBMIT

 Views
 VIEW_INPUT
 VIEW_SUBMIT

Select the proper view showing
the
Information page that shows the
job has been submitted

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Portlet Initialization
 portlet.xlm contains portlet initialization parameters
<init-param>
<name>init parameter name</name>
<value>init parameter value</value>
</init-param>
public void init() throws PortletException {
// Load default values from portlet.xml
init_PortletVersion = getInitParameter(“init parameter name");
…

 The init() method uses <init-param>s to load Portlet’
default parameter values
 Some of the default parameters values will be used to load
portlet default preferences
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
hostname’ <init-param>
 To make parameter management easier all values are threated as
String type














init_PortletVersion - Portlet version number
init_bdiiHost - Information system service (ldap://...:2170)

init_wmsHost - Infrastructure resource manager (wms://...:7443/glite_wms_wmproxy_server)
init_pxServerHost - Hostname of Robot proxy server (myproxy.ct.infn.it not used yet)
init_pxRobotId - Id of the robot certificate
init_pxRobotVO - Infrastructure virtual organization
init_pxRobotRole - Role of generated proxy
init_pxUserProxy - Standard proxy file (instead of Robots)
init_pxRobotRenewalFlag - Allows automatic job renewal mechanism
init_SciGwyAppId - Science Gateway application identifier '9' for GILDA VM tester application

GridEngine' User tracking database (UTDB) access credentials








init_SciGwyUserTrackingDB_Hostname
init_SciGwyUserTrackingDB_Username
init_SciGwyUserTrackingDB_Password
init_SciGwyUserTrackingDB_Database – Users should not use Direct DB access to
UTDB
init_JobRequirements - Application job requirements
init_pilotScript - Application pilot script

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Hostname Portlet preferences



private void getPreferences( ActionRequest actionRequest
,RenderRequest renderRequest) {
PortletPreferences prefs=null;
if(null!=actionRequest)
prefs = actionRequest.getPreferences();
getPreferences
else if(null != renderRequest)
 doView andrenderRequest.getPreferences();
prefs = processAction

method called by both:

if (null != prefs) {
// The second parameter assigns a default value
pref_value=prefs.getValue("<pref_name>", "<init_name>");

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Initialize Method for submission
// Initialize the GridEngine Multi Infrastructure Job Submission
object
MultiInfrastructureJobSubmission miJobSubmission =
new MultiInfrastructureJobSubmission();
// Assigns all enabled infrastructures
InfrastructureInfo[]
infrastructuresInfo=appPreferences.getEnabledInfrastru
ctures();

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Job parameters

// Job details
String executable="/bin/sh"; // Application executable
String arguments =appPreferences.getPilotScript(); //executable'
arguments
String outputPath="/tmp/";
// Output Path
String outputFile="hostname-Output.txt"; // Distributed application
standard output
String errorFile ="hostname-Error.txt"; // Distrubuted application
standard error
String appFile
="hostname-Files.tar.gz"; // Hostname output files
(created by the pilot script)

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Input & Output

// InputSandbox (string with comma separated list of file names)
String inputSandbox=appServerPath+"WEB-INF/job/"
+appPreferences.getPilotScript() // pilot script
+","+appInput.inputSandbox_inputFile // input file
;
// OutputSandbox (string with comma separated list of file names)
String outputSandbox=appFile; // Output file

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Job Requirement

// Take care of job requirements
// More requirements can be specified in the preference value 'jobRequirements’
// separating each requirement by the ';' character
String jdlRequirements[] =
appPreferences.getJobRequirements().split(";");
int numRequirements=0;
for(int i=0; i<jdlRequirements.length; i++) {
if(!jdlRequirements[i].equals("")) {
jdlRequirements[numRequirements] =
"JDLRequirements=("+jdlRequirements[i]+")";
numRequirements++;
}
} // for each jobRequirement
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Setting parameter and submit
// Other job initialization settings
miJobSubmission.setExecutable (executable); // Specify the executeable
miJobSubmission.setArguments (arguments); // Specify the application' arguments
miJobSubmission.setOutputPath (outputPath); // Specify the output directory
miJobSubmission.setOutputFiles(outputSandbox); // Setup output files (OutputSandbox)
miJobSubmission.setJobOutput (outputFile); // Specify the std-outputr file
miJobSubmission.setJobError
(errorFile); // Specify the std-error file
if(null != inputSandbox // Setup input files (InputSandbox) avoiding empty inputSandboxes
&& inputSandbox.length() > 0)
miJobSubmission.setInputFiles(inputSandbox);
if(numRequirements>0)
// Setup the JDL requirements
miJobSubmission.setJDLRequirements(jdlRequirements);
// Submit Job
miJobSubmission.submitJobAsync(appInput.username, portalIPAddress, applicationId,
appInput.jobIdentifier);

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
From hostname to your portlet
https://gilda.ct.infn.it/wikimain/-/wiki/Main/hostname-portlet

 Extract hostname portlet form svn

svn checkout svn://svn.code.sf.net/p/ctsciencegtwys/liferay/trunk/gilda/mi-hostname-portlet

 ‘cd’ inside the hostname-portlet directory and try to compile it with
the command: ant deploy
 If the compilation is successful create a physical copy of the portlet
directory source code
 cp –r hostname-portlet <yourname>-portlet

 Customize your portlet settings configuring several XML files:
 docroot/WEB-INF/portlet.xml
<portlet-name><yourname>-portlet</portlet-name>
<display-name><yourname>-portlet</display-name>
<portlet-class><your.package.path.<yourname>_portlet</portlet-class>
…
<init-param>
<name>init_PortletVersion</name>
<value>Specify your Portlet' version number</value>
</init-param>
… other init parameters

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Init parameters
init_PortletVersion
init_bdiiHost
init_wmsHost
init_pxServerHost
init_pxRobotId
init_pxRobotVO
init_pxRobotRole
init_pxUserProxy
init_pxRobotRenewalFlag
init_SciGwyAppId
init_SciGwyUserTrackingDB_Hostname
init_SciGwyUserTrackingDB_Username
init_SciGwyUserTrackingDB_Password
init_SciGwyUserTrackingDB_Database
init_JobRequirements
init_pilotScript

Your portlet version
Infrastructure settings …
Robot proxy settings
Robot Id, Virtual Organization,
Proxy Role, Renewal Flag
pxUserProxy (mutually exclusive to Robots)

proxy file

Allows the use of a user proxy
Just provide a valid path to a

Each application has a unique Id
(GridEngine)

GridEngine connection credentials (Unused)

Grid Job requirements
Job’ pilot script

(bash)

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
Parameter in portlet preferences

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
From hostname to your portlet
 docroot/WEB-INF/portlet.xml (still)
<portlet-info>
<title>Title of yor porltlet
<short-title>Short title
<keywords>Portlet' keywords

 docroot/WEB-INF/liferay-display.xml
<category name="<place your category name here>" (your institution ‘GILDA’)
<portlet id="<place your portlet identifier>" (name displayed into the mangment
interface)

 docroot/WEB-INF/lib
Overrides or extends the portlet java code global library repository
(/opt/glassfish3/glassfish/domains/liferay/lib/)

 docroot/WEB-INF/liferay-portlet.xml
<portlet-name>
<css-class-wrapper>

 docroot/WEB-INF/glassfish-web.xml
<context-root> (Information managed by App server Glassfish)

 docroot/images/
Each image used by the jsp pages should be located here

 docroot/icon.png
Place here a 16x16 image file with your portlet icon

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
From hostname to your portlet
 /docroot/WEB-INF/src/it/infn/ct/hostname_portlet.java
 Make a copy of this source file into directory:


<your.package.name>/<yourname_portlet>.java>

WARNING: Do not forget to assign to the class the same name of the java
file

 Start to develop the interface modifying jsp files and change java code
Enums with correct Actions and Views modes using human readable
identifiers.
For simple Appliocation user interfaces there will be no need to add
other JSPs or action/view modes to the existing Enum
 Edit the java code in order to manage your application specific interface
and prepare the correct sandboxes to submit properly the job
 Prepare the pilot script and use it as parameter.

Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013
References
 SVN:
http://sourceforge.net/p/ctsciencegtwys/liferay
/
 MI-hostname project:
http://sourceforge.net/p/ctsciencegtwys/liferay
/HEAD/tree/trunk/gilda/
 MI-hostname main source:
http://sourceforge.net/p/ctsciencegtwys/liferay/HEAD/tree/trunk/gilda/mi-hostnameportlet/docroot/WEB-INF/src/it/infn/ct/mi_hostname_portlet.java#l1253

 Gilda Wiki:
 Installation and configuration of the developing
environment
 Basic portlet for a sequential job
Riccardo Rotondo
Tutorial on Science Gateways, Roma, 04.06.2013

Más contenido relacionado

La actualidad más candente

Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here! Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here! Dev_Events
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RaceBaruch Sadogursky
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
The definitive guide to java agents
The definitive guide to java agentsThe definitive guide to java agents
The definitive guide to java agentsRafael Winterhalter
 
Testable JavaScript: Application Architecture
Testable JavaScript:  Application ArchitectureTestable JavaScript:  Application Architecture
Testable JavaScript: Application ArchitectureMark Trostler
 
Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012Anton Arhipov
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Anton Arhipov
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
 
170517 damien gérard framework facebook
170517 damien gérard   framework facebook170517 damien gérard   framework facebook
170517 damien gérard framework facebookGeeks Anonymes
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languagesRafael Winterhalter
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
 
JShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java PlatformJShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java PlatformJavaDayUA
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKJosé Paumard
 

La actualidad más candente (20)

Enterprise js pratices
Enterprise js praticesEnterprise js pratices
Enterprise js pratices
 
NIO and NIO2
NIO and NIO2NIO and NIO2
NIO and NIO2
 
Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here! Portlet Specification 3.0 Is Here!
Portlet Specification 3.0 Is Here!
 
Pure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools RacePure Java RAD and Scaffolding Tools Race
Pure Java RAD and Scaffolding Tools Race
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
The definitive guide to java agents
The definitive guide to java agentsThe definitive guide to java agents
The definitive guide to java agents
 
Java RMI
Java RMIJava RMI
Java RMI
 
Testable JavaScript: Application Architecture
Testable JavaScript:  Application ArchitectureTestable JavaScript:  Application Architecture
Testable JavaScript: Application Architecture
 
Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012Mastering Java Bytecode With ASM - 33rd degree, 2012
Mastering Java Bytecode With ASM - 33rd degree, 2012
 
What`s new in Java 7
What`s new in Java 7What`s new in Java 7
What`s new in Java 7
 
JDK Power Tools
JDK Power ToolsJDK Power Tools
JDK Power Tools
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
 
170517 damien gérard framework facebook
170517 damien gérard   framework facebook170517 damien gérard   framework facebook
170517 damien gérard framework facebook
 
Ejb3 Dan Hinojosa
Ejb3 Dan HinojosaEjb3 Dan Hinojosa
Ejb3 Dan Hinojosa
 
meet.js - QooXDoo
meet.js - QooXDoomeet.js - QooXDoo
meet.js - QooXDoo
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languages
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5
 
JShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java PlatformJShell: An Interactive Shell for the Java Platform
JShell: An Interactive Shell for the Java Platform
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 

Destacado

2015-2019 Business and Managment Plan-press-conference
2015-2019 Business and Managment Plan-press-conference2015-2019 Business and Managment Plan-press-conference
2015-2019 Business and Managment Plan-press-conferencePetrobras
 
Contingency action plan in disaster managment
Contingency action plan in disaster managmentContingency action plan in disaster managment
Contingency action plan in disaster managmentSamraiz Tejani
 
Welcome to our presentation
Welcome to our presentationWelcome to our presentation
Welcome to our presentationsohag sikder
 
Mc donalds human resource managment plan -shubham-bba-2012
Mc donalds human resource managment plan -shubham-bba-2012Mc donalds human resource managment plan -shubham-bba-2012
Mc donalds human resource managment plan -shubham-bba-2012Shubham Parsekar
 
CFS MANAGMENT PLAN
CFS MANAGMENT PLANCFS MANAGMENT PLAN
CFS MANAGMENT PLANcfs001
 
Cafe construction project report
Cafe construction project reportCafe construction project report
Cafe construction project reportHagi Sahib
 
Building Construction
Building ConstructionBuilding Construction
Building ConstructionWilden How
 
Sample project plan
Sample project planSample project plan
Sample project planmamoonnift
 
project on construction of house report.
project on construction of house report.project on construction of house report.
project on construction of house report.Hagi Sahib
 

Destacado (12)

Prince 2 project managment Document: Project plan
Prince 2  project managment Document: Project planPrince 2  project managment Document: Project plan
Prince 2 project managment Document: Project plan
 
2015-2019 Business and Managment Plan-press-conference
2015-2019 Business and Managment Plan-press-conference2015-2019 Business and Managment Plan-press-conference
2015-2019 Business and Managment Plan-press-conference
 
Space managment
Space managmentSpace managment
Space managment
 
Contingency action plan in disaster managment
Contingency action plan in disaster managmentContingency action plan in disaster managment
Contingency action plan in disaster managment
 
Welcome to our presentation
Welcome to our presentationWelcome to our presentation
Welcome to our presentation
 
Mc donalds human resource managment plan -shubham-bba-2012
Mc donalds human resource managment plan -shubham-bba-2012Mc donalds human resource managment plan -shubham-bba-2012
Mc donalds human resource managment plan -shubham-bba-2012
 
CFS MANAGMENT PLAN
CFS MANAGMENT PLANCFS MANAGMENT PLAN
CFS MANAGMENT PLAN
 
Flow process chart
Flow process chartFlow process chart
Flow process chart
 
Cafe construction project report
Cafe construction project reportCafe construction project report
Cafe construction project report
 
Building Construction
Building ConstructionBuilding Construction
Building Construction
 
Sample project plan
Sample project planSample project plan
Sample project plan
 
project on construction of house report.
project on construction of house report.project on construction of house report.
project on construction of house report.
 

Similar a Job Managment Portlet

Web Applications Development
Web Applications DevelopmentWeb Applications Development
Web Applications Developmentriround
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java PlatformSivakumar Thyagarajan
 
Java Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJava Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJohn Lewis
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingVisual Engineering
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesciklum_ods
 
JSR 168 Portal - Overview
JSR 168 Portal - OverviewJSR 168 Portal - Overview
JSR 168 Portal - OverviewVinay Kumar
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Javaelliando dias
 
Jersey framework
Jersey frameworkJersey framework
Jersey frameworkknight1128
 
Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long jaxconf
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorialjbarciauskas
 
ADP- Chapter 3 Implementing Inter-Servlet Communication
ADP- Chapter 3 Implementing Inter-Servlet CommunicationADP- Chapter 3 Implementing Inter-Servlet Communication
ADP- Chapter 3 Implementing Inter-Servlet CommunicationRiza Nurman
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Similar a Job Managment Portlet (20)

Web Applications Development
Web Applications DevelopmentWeb Applications Development
Web Applications Development
 
Servlet 3.0
Servlet 3.0Servlet 3.0
Servlet 3.0
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
 
Juzu framework
Juzu frameworkJuzu framework
Juzu framework
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Java
 
Java Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJava Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) Specification
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
In kor we Trust
In kor we TrustIn kor we Trust
In kor we Trust
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
JSR 168 Portal - Overview
JSR 168 Portal - OverviewJSR 168 Portal - Overview
JSR 168 Portal - Overview
 
REST made simple with Java
REST made simple with JavaREST made simple with Java
REST made simple with Java
 
Jersey framework
Jersey frameworkJersey framework
Jersey framework
 
Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long
 
Android - Anatomy of android elements & layouts
Android - Anatomy of android elements & layoutsAndroid - Anatomy of android elements & layouts
Android - Anatomy of android elements & layouts
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
ADP- Chapter 3 Implementing Inter-Servlet Communication
ADP- Chapter 3 Implementing Inter-Servlet CommunicationADP- Chapter 3 Implementing Inter-Servlet Communication
ADP- Chapter 3 Implementing Inter-Servlet Communication
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Más de riround

Gromacs on Science Gateway
Gromacs on Science GatewayGromacs on Science Gateway
Gromacs on Science Gatewayriround
 
e-Infrastructure & Data Service
e-Infrastructure & Data Servicee-Infrastructure & Data Service
e-Infrastructure & Data Serviceriround
 
Catania Science Gateway Framework
Catania Science Gateway FrameworkCatania Science Gateway Framework
Catania Science Gateway Frameworkriround
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay wayriround
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Developmentriround
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gatewayriround
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay wayriround
 
Catania Science Gateway Framework
Catania Science Gateway Framework Catania Science Gateway Framework
Catania Science Gateway Framework riround
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gatewayriround
 
Science Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related servicesScience Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related servicesriround
 

Más de riround (10)

Gromacs on Science Gateway
Gromacs on Science GatewayGromacs on Science Gateway
Gromacs on Science Gateway
 
e-Infrastructure & Data Service
e-Infrastructure & Data Servicee-Infrastructure & Data Service
e-Infrastructure & Data Service
 
Catania Science Gateway Framework
Catania Science Gateway FrameworkCatania Science Gateway Framework
Catania Science Gateway Framework
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay way
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Development
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gateway
 
Portlet Framework: the Liferay way
Portlet Framework: the Liferay wayPortlet Framework: the Liferay way
Portlet Framework: the Liferay way
 
Catania Science Gateway Framework
Catania Science Gateway Framework Catania Science Gateway Framework
Catania Science Gateway Framework
 
Introduction on Science Gateway
Introduction on Science GatewayIntroduction on Science Gateway
Introduction on Science Gateway
 
Science Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related servicesScience Gateways: one portal, many e-Infrastructures and related services
Science Gateways: one portal, many e-Infrastructures and related services
 

Último

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 

Último (20)

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 

Job Managment Portlet

  • 1. Job Management Portlet A portlet example to access job managment service Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 2. Generic Porlets Life Cycle YES NO End of Services? Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 3. Generic Porltlets Interface Method Class GenericPortlets { init (PortletConfig); processAction (ActionRequest, ActionResponse); render (RenderRequest, RenderResponse); destroy(); doView (Request, Response); doEdit (Reuqest, Response); doHelp (Request, Response); } Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 4. Portlet Mode  A porltet works in three different states.  View Mode: generate a markup ( a portion of a web page);  Edit Mode: allow portlet customisation and setting preferences.  Help Mode: explains portlet functionalities. Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 6. Portlet workflow init doView JSP page ACTION/VIEW Architecture Hostname code provides two Enum types: Actions and Views ProcessAction init doView default JSP page JSP page For each Action a different View can be selected and easily managed by switch statements The two enumerated types used to manage the portlet behavior Between portlet methods: ‘doView and ProcessAction’. Jsp/Java Variable: ‘PortletStatus’ ProcessAction Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 7. Portlet Session data init doView Two objecst: JSP page ProcessAction actionRequest processAction() renderRequest doView() doHelp() doEdit() ProcessAction sends parameters to the other methods with a RenderRequest through: ActionResponse (2nd parameter of ProcessAction) response.setRenderParameter("param_name_y", param_value_y); doView/doHelp/doEdit (1st parameter) RenderRequest param_name_w=request.getParameter("param_name_w"); Parameters to jsp and select it: request.setAttribute("JobId", inputJobId); getPortletContext().getRequestDispatcher(”/<view_page>.jsp"); Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 8. Parameters exchange (JSP->Java) <form action=action="<portlet:actionURL portletMode="view"> <portlet:param name="param_name_1" value="param value 1"/> … <portlet:param name="param_name_n" value="param value n"/> … <input … /> <input … /> <input type="submit" … /> </form>  Portlet modes:  VIEW – Userd for normal portlet operations -> calls processAction()  EDIT – Userd to configure portlet parameters -> calls doEdit()  HELP – Userd to show help information -> calls doHelp() • • processAction(ActionRequest request,… doView/doHelp/doEdit(RenderRequest request,… // To obtain the parameter just set … String param_i = request.getParameter("param_name_i"); Tutorial on Science Gateways, Roma, 04.06.2013
  • 9. Parameters exchange (Java->JSP) doView/doHelp/doEdit(RenderRequest request,… // To send the parameter just call … request.setAttribute("param_name_j", param_name_j); <% // To load variables from Portlet Class … %> <jsp:useBean id="param_name_k" class="<variable type k>" scope="request"/> <% // To reference a param value %> <%=param_name_k%> Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 10. hostname-portlet example input.jsp  Portlet to send a test job into a distributed infrastructure  Input:  Input file or a text  A human readable job identifier  Ouput  Hostname of running machine  File containing information about the running machine  Portlet statuses submit.jsp  INPUT (Shows the input fields)  SUBMIT (Shows the job submission feedback)  Jsp/Java variable ‘PortletStatus’ Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 11. Hostname Action/View enums  Actions  ACTION_INPUT  ACTION_SUBMIT Default Action • Simply forward portlet status to the doView() in: RenderParameter  Views (Possible portlet views)  VIEW_INPUT  VIEW_SUBMIT Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 12. Hostname Action/View  Actions  ACTION_INPUT  ACTION_SUBMIT  Views  VIEW_INPUT  VIEW_SUBMIT View • Select the INPUT form view input.jsp (default view mode) Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 13. Hostname Action/View  Actions  ACTION_INPUT  ACTION_SUBMIT This action will submit the hostname job into the distributed infrastructure  Views  VIEW_INPUT  VIEW_SUBMIT <form enctype="multipart/form-data" action="<portlet:actionURL portletMode="view"> <portlet:param name="PortletStatus" value="ACTION_SUBMIT"/> </portlet:actionURL>" method="post”> Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 14. Hostname Action/View  Actions  ACTION_INPUT  ACTION_SUBMIT  Views  VIEW_INPUT  VIEW_SUBMIT Select the proper view showing the Information page that shows the job has been submitted Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 15. Portlet Initialization  portlet.xlm contains portlet initialization parameters <init-param> <name>init parameter name</name> <value>init parameter value</value> </init-param> public void init() throws PortletException { // Load default values from portlet.xml init_PortletVersion = getInitParameter(“init parameter name"); …  The init() method uses <init-param>s to load Portlet’ default parameter values  Some of the default parameters values will be used to load portlet default preferences Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 16. hostname’ <init-param>  To make parameter management easier all values are threated as String type            init_PortletVersion - Portlet version number init_bdiiHost - Information system service (ldap://...:2170) init_wmsHost - Infrastructure resource manager (wms://...:7443/glite_wms_wmproxy_server) init_pxServerHost - Hostname of Robot proxy server (myproxy.ct.infn.it not used yet) init_pxRobotId - Id of the robot certificate init_pxRobotVO - Infrastructure virtual organization init_pxRobotRole - Role of generated proxy init_pxUserProxy - Standard proxy file (instead of Robots) init_pxRobotRenewalFlag - Allows automatic job renewal mechanism init_SciGwyAppId - Science Gateway application identifier '9' for GILDA VM tester application GridEngine' User tracking database (UTDB) access credentials       init_SciGwyUserTrackingDB_Hostname init_SciGwyUserTrackingDB_Username init_SciGwyUserTrackingDB_Password init_SciGwyUserTrackingDB_Database – Users should not use Direct DB access to UTDB init_JobRequirements - Application job requirements init_pilotScript - Application pilot script Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 17. Hostname Portlet preferences  private void getPreferences( ActionRequest actionRequest ,RenderRequest renderRequest) { PortletPreferences prefs=null; if(null!=actionRequest) prefs = actionRequest.getPreferences(); getPreferences else if(null != renderRequest)  doView andrenderRequest.getPreferences(); prefs = processAction method called by both: if (null != prefs) { // The second parameter assigns a default value pref_value=prefs.getValue("<pref_name>", "<init_name>"); Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 18. Initialize Method for submission // Initialize the GridEngine Multi Infrastructure Job Submission object MultiInfrastructureJobSubmission miJobSubmission = new MultiInfrastructureJobSubmission(); // Assigns all enabled infrastructures InfrastructureInfo[] infrastructuresInfo=appPreferences.getEnabledInfrastru ctures(); Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 19. Job parameters // Job details String executable="/bin/sh"; // Application executable String arguments =appPreferences.getPilotScript(); //executable' arguments String outputPath="/tmp/"; // Output Path String outputFile="hostname-Output.txt"; // Distributed application standard output String errorFile ="hostname-Error.txt"; // Distrubuted application standard error String appFile ="hostname-Files.tar.gz"; // Hostname output files (created by the pilot script) Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 20. Input & Output // InputSandbox (string with comma separated list of file names) String inputSandbox=appServerPath+"WEB-INF/job/" +appPreferences.getPilotScript() // pilot script +","+appInput.inputSandbox_inputFile // input file ; // OutputSandbox (string with comma separated list of file names) String outputSandbox=appFile; // Output file Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 21. Job Requirement // Take care of job requirements // More requirements can be specified in the preference value 'jobRequirements’ // separating each requirement by the ';' character String jdlRequirements[] = appPreferences.getJobRequirements().split(";"); int numRequirements=0; for(int i=0; i<jdlRequirements.length; i++) { if(!jdlRequirements[i].equals("")) { jdlRequirements[numRequirements] = "JDLRequirements=("+jdlRequirements[i]+")"; numRequirements++; } } // for each jobRequirement Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 22. Setting parameter and submit // Other job initialization settings miJobSubmission.setExecutable (executable); // Specify the executeable miJobSubmission.setArguments (arguments); // Specify the application' arguments miJobSubmission.setOutputPath (outputPath); // Specify the output directory miJobSubmission.setOutputFiles(outputSandbox); // Setup output files (OutputSandbox) miJobSubmission.setJobOutput (outputFile); // Specify the std-outputr file miJobSubmission.setJobError (errorFile); // Specify the std-error file if(null != inputSandbox // Setup input files (InputSandbox) avoiding empty inputSandboxes && inputSandbox.length() > 0) miJobSubmission.setInputFiles(inputSandbox); if(numRequirements>0) // Setup the JDL requirements miJobSubmission.setJDLRequirements(jdlRequirements); // Submit Job miJobSubmission.submitJobAsync(appInput.username, portalIPAddress, applicationId, appInput.jobIdentifier); Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 23. From hostname to your portlet https://gilda.ct.infn.it/wikimain/-/wiki/Main/hostname-portlet  Extract hostname portlet form svn svn checkout svn://svn.code.sf.net/p/ctsciencegtwys/liferay/trunk/gilda/mi-hostname-portlet  ‘cd’ inside the hostname-portlet directory and try to compile it with the command: ant deploy  If the compilation is successful create a physical copy of the portlet directory source code  cp –r hostname-portlet <yourname>-portlet  Customize your portlet settings configuring several XML files:  docroot/WEB-INF/portlet.xml <portlet-name><yourname>-portlet</portlet-name> <display-name><yourname>-portlet</display-name> <portlet-class><your.package.path.<yourname>_portlet</portlet-class> … <init-param> <name>init_PortletVersion</name> <value>Specify your Portlet' version number</value> </init-param> … other init parameters Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 24. Init parameters init_PortletVersion init_bdiiHost init_wmsHost init_pxServerHost init_pxRobotId init_pxRobotVO init_pxRobotRole init_pxUserProxy init_pxRobotRenewalFlag init_SciGwyAppId init_SciGwyUserTrackingDB_Hostname init_SciGwyUserTrackingDB_Username init_SciGwyUserTrackingDB_Password init_SciGwyUserTrackingDB_Database init_JobRequirements init_pilotScript Your portlet version Infrastructure settings … Robot proxy settings Robot Id, Virtual Organization, Proxy Role, Renewal Flag pxUserProxy (mutually exclusive to Robots) proxy file Allows the use of a user proxy Just provide a valid path to a Each application has a unique Id (GridEngine) GridEngine connection credentials (Unused) Grid Job requirements Job’ pilot script (bash) Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 25. Parameter in portlet preferences Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 26. From hostname to your portlet  docroot/WEB-INF/portlet.xml (still) <portlet-info> <title>Title of yor porltlet <short-title>Short title <keywords>Portlet' keywords  docroot/WEB-INF/liferay-display.xml <category name="<place your category name here>" (your institution ‘GILDA’) <portlet id="<place your portlet identifier>" (name displayed into the mangment interface)  docroot/WEB-INF/lib Overrides or extends the portlet java code global library repository (/opt/glassfish3/glassfish/domains/liferay/lib/)  docroot/WEB-INF/liferay-portlet.xml <portlet-name> <css-class-wrapper>  docroot/WEB-INF/glassfish-web.xml <context-root> (Information managed by App server Glassfish)  docroot/images/ Each image used by the jsp pages should be located here  docroot/icon.png Place here a 16x16 image file with your portlet icon Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 27. From hostname to your portlet  /docroot/WEB-INF/src/it/infn/ct/hostname_portlet.java  Make a copy of this source file into directory:  <your.package.name>/<yourname_portlet>.java> WARNING: Do not forget to assign to the class the same name of the java file  Start to develop the interface modifying jsp files and change java code Enums with correct Actions and Views modes using human readable identifiers. For simple Appliocation user interfaces there will be no need to add other JSPs or action/view modes to the existing Enum  Edit the java code in order to manage your application specific interface and prepare the correct sandboxes to submit properly the job  Prepare the pilot script and use it as parameter. Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013
  • 28. References  SVN: http://sourceforge.net/p/ctsciencegtwys/liferay /  MI-hostname project: http://sourceforge.net/p/ctsciencegtwys/liferay /HEAD/tree/trunk/gilda/  MI-hostname main source: http://sourceforge.net/p/ctsciencegtwys/liferay/HEAD/tree/trunk/gilda/mi-hostnameportlet/docroot/WEB-INF/src/it/infn/ct/mi_hostname_portlet.java#l1253  Gilda Wiki:  Installation and configuration of the developing environment  Basic portlet for a sequential job Riccardo Rotondo Tutorial on Science Gateways, Roma, 04.06.2013