Presentation is loading. Please wait.

Presentation is loading. Please wait.

WS-PGRADE + ASM Basic hands-on Zoltán Farkas, MTA SZTAKI

Similar presentations


Presentation on theme: "WS-PGRADE + ASM Basic hands-on Zoltán Farkas, MTA SZTAKI"— Presentation transcript:

1 WS-PGRADE + ASM Basic hands-on Zoltán Farkas, MTA SZTAKI zfarkas@sztaki.hu

2 Outline What we will do Development environment Modification steps Deployment of the new ASM portlet Try it out!

3 Topic of the hands-on I. Modify an existing, simple ASM portlet: –Remove some features, –Present some features in a different way –Add some error handling Necessary modifications in: –Java, JSP and XML files Application of the ASM portlet: –Add two integers –One coming through a file –One coming through command line

4 Topic of the hands-on II.

5 Development Environment Ubuntu VM in VirtualBox: –2G RAM –NAT network gUSE automatically started NetBeans contains the starting project: –ASM_Sample

6 Modification Step 1 – Copy the application Really simple! In NetBeans: –Right-click on the ASM_Sample project –Select “Copy” –Enter a new project name, e.g. MyASM_Sample –Click “Copy”

7 Modification Step 1 – Copy the application Really simple! In NetBeans: –Right-click on the ASM_Sample project –Select “Copy” –Enter a new project name, e.g. MyASM_Sample –Click “Copy”

8 Modification Step 2 – Rename files and classes Expand “Source packages” Expand “hu.sztaki.lpds...” Right-click on “ASM_SamplePortlet.java” Select “Refactor”/“Rename” Enter a new class name, e.g. “MyASM_SamplePortlet” (You can apply rename of comments, if you like) Click “Refactor”

9 Modification Step 2 – Rename files and classes Expand “Source packages” Expand “hu.sztaki.lpds...” Right-click on “ASM_SamplePortlet.java” Select “Refactor”/“Rename” Enter a new class name, e.g. “MyASM_SamplePortlet” (You can apply rename of comments, if you like) Click “Refactor”

10 Modification Step 3 – Modify portlet layout I. Expand “Web Pages” Expand “jsp” Expand “asm_sample” Open “asm_sample.jsp”

11 Modification Step 3 – Modify portlet layout I. Expand “Web Pages” Expand “jsp” Expand “asm_sample” Open “asm_sample.jsp”

12 Modification Step 3 – Modify portlet layout II. Remove “Get Input”: –Search for the “div_getinput” div –Remove it (along with its parent )!

13 Modification Step 3 – Modify portlet layout II. Remove “Get Inputs” Search for the “div_getinputs” div Remove it (along with its parent )!

14 Modification Step 3 – Modify portlet layout III. Modify “Set Input” to “Set Inputs”: –Search for the “doSetInput” hidden input action

15 Modification Step 3 – Modify portlet layout III. Modify “Set Input” to “Set Inputs”: –Update as follows:

16 Modification Step 3 – Modify portlet layout IV. Remove “Upload”: –Search for the “Upload” button –Remove it (along with its parent )!

17 Modification Step 3 – Modify portlet layout V. Add an error message: –Append the following to the end of the JSP file:

18 Modification Step 4 – Modify portlet class I. Necessary modifications: –Read additional input and update workflow's input file with it –Report error message if inputs are not integers Open “MyASM_SamplePortlet.java” Check out the “doSetInput” method

19 Modification Step 4 – Modify portlet class II. Original version

20 Modification Step 4 – Modify portlet class III. Updated version Define input file's port number Get input file's content Input validation Update Input Port

21 Modification Step 5 – Modify XML files Expand “Configuration Files” Open “web.xml” Select the “XML” view Modify any occurences of “ASM_Sample” to the name of your new project (e.g. “MyASM_Sample”)

22 Modification Step 5 – Modify XML files Expand “Configuration Files” Open “web.xml” Select the “XML” view Modify any occurences of “ASM_Sample” to the name of your new project (e.g. “MyASM_Sample”)

23 Modification Step 5 – Modify XML files Expand “Configuration Files” Open “portlet.xml” Select the “XML” view Change the “portlet-class” tag to the name of the class you renamed “ASM_SamplePortlet” to You are welcome to change any of the “portlet-info” sub-tags

24 Modification Step 5 – Modify XML files Expand “Configuration Files” Open “portlet.xml” Select the “XML” view Change the “portlet-class” tag to the name of the class you renamed “ASM_SamplePortlet” to You are welcome to change any of the “portlet-info” sub-tags

25 Deploy it to Liferay-based gUSE Sign in as a user with admin roles (default username is : test@liferay.com, password is : test ) test@liferay.com

26 Deploy it to Liferay-based gUSE Navigate to Plugin Installer panel by clicking Manage -> Control Panel, and by selecting Plugins Installation from the menu in the left hand-side, finally clicking install More Portlets button and upload File link.

27 Adjusting it as a new component (just once) As admin, please go to Settings menu and select Internal Services

28 Adjusting it as a new component (just once) Click to New button and set the followings: Type of Component: portal Service group: gUSE URL of Component: http://localhost:8080/MyASM_Sample URL to initialize Component: http://localhost:8080/MyASM_Sample/init Public URL of Component: http://localhost:8080/MyASM_Sample State: active Then click to Save button!

29 Adjusting it as a new component (just once) Click to copy component Properties tab Set http://localhost:8080/wspgrade as Source component and http://localhost:8080/MyASM_Sample as Destination one, then click to copy

30 Adjusting it as a new component Finally initialize the whole portal again by calling http://localhost:8080/information/init.jsp http://localhost:8080/information/init.jsp (in some cases portal restart required.)

31 Creating new menuitem for it (just once)

32 Adding the portlet under this menu (just once) Click to „Add” and select „more” The newly developed portlet should be available under undefined group. Finally click to „add” in the row of the portlet


Download ppt "WS-PGRADE + ASM Basic hands-on Zoltán Farkas, MTA SZTAKI"

Similar presentations


Ads by Google