Wednesday, August 16, 2017

JSP - ASP - Peoplesoft Analogy

There are some kind of people who are proficient in JSP and J2EE(now JEE) skills might not be aware of the ASP .Net and other Microsoft technologies.

There are another kind of people who are proficient in .Net/ASP.Net skills might not be aware of the Java world.

There is a third set of  people who work in Peoplesoft PIA and Peoplecode might not be aware of the dot Net and JEE worlds.

So Let me give you a straight analogy

Java is the core technical platform which powers the JSP (Java Server Pages ) web technology

.Net is the core technical platform which powers the ASP (Active Server Pages) web technology

.Net language can be either VB or C#

Java is from Sun (now owned by Oracle) whereas .Net is from Microsoft

Similar to the ASP/JSP in Peoplesoft enterprise world is the PIA  - Peoplesoft Internet Architecture. PIA where we have the App Designer which is the IDE to build Pages and deploy in Server.

The API language of Peoplesoft is Peoplecode. The langauge specific to Peoplesoft Web based ERP solutions.

Though Peoplecode / PIA by itself is not a full fledged language , they are the Dev API for Peoplesoft.

Peoplesoft Component Processor Event model closes matches the ASP page life cycle.

The Component Prebuild, Post built, Page Activate , row init, field change kind of events are similar to ASP Pre init, init, initcomplete, preload, load, button onclick, pre render.

The rowset handling and grid data binding two resemble ASP.

Digging deep, Peoplesoft by itself is devised using a set of Microsoft and Java technlogies.

The Peoplesoft App Designer is closely similar to Visual Studio and built using VC++. The Peoplesoft web pages are indeed Java Servlets deployed in supported web servers like Weblogic

Peoplecode App Package structure closely matches .Net package structure.

There is one more construct in Peoplesoft world called PeopleTools. This has a version like 8.50, 8.51 etc.. This is nothing but similar to versions in JDK - 1.5, 1.6, 1.7 and .Net - 2.0,3.0, 3.5, 4.0 etc.

Please feel free to add more on the comments sections.

String Concatenation Operators

I will start this blog by narrating what happens with me usually during development

On a busy day, I found a bug and started debugging it and found the issue is not occuring commonly with people. so started googling and traversing google search results for 4 or 5 pages :D Thinking this as a custom big issue I google it with pride and atlast debug it to find it as a typo in code.

When you switch between multiple languages there exists a difference in syntax :( Phew! Suddenly I use a string concatenation operator of javascript (+) in PERL and find the code is throwing a Out of the World error. )

Okay let me summarize how the string concatenation operator differs in some of the languages

Oracle SQL = || (doube pipe)

SQL Server = + (plus)

Javascript, Java, C# = + (plus)

PERL  = . (dot -  mind it)

Peoplecode = | (single pipe)

bash = $a$b (no operator just write variable names continuously - thats it - OMG!)

xml = concat(v,v1,...)

So I have come up with list of commonly different syntax variations which I use frequently and keep it as my reference.. This way I avoid these silly mistakes...

You can post the similar differences in comments section :)

Start Up scripts

Start up scripts becomes handy when we need to open the same applications every time we start our machine.

Whenever I boot my machine, Outlook is the first application I open. Following, I connect to client VPN over Internet explorer. These two tasks are monotonous and became by routine.

Sometime before one of friend sent me a mail with a VBScript attachment. Opening that sent a mail to my friend with subject as ‘I am a fool’. Funny ! isn’t it?

So I decided to use the scripts to do my monotonous tasks. I have edited the scripts to open my Outlook and I have put the script in my System Start up.

 Steps to create the System Start up scripts

1. Create a file with .vbs extension

2. Type the following
Set WshShell = WScript.CreateObject(“WScript.Shell”)   ‘Create a windows shell object
WshShell.Run “Outlook”       ‘run my Outlook

Here Outlook is the exe name. You could replace this with your application name. Exe ‘s like notepad, winword,excel,calculator etc.

3. Save the file

4. Open the System start up location
Windows Start > All Programs > Start Up (right click and give open)

5. copy the script file to the above location

The above steps will open your ‘Outlook’ whenever we start our machine
Suppose we want to open a website on system start up, use the below step

WshShell.Run “iexplore

These items I have created on my own and does not contain any warranty. Hence apply discretion.

Shortcuts at your Taskbar

Will it will be easier to open our favorite website in single click every time you want open the website? Single click meant without opening your browser, typing the website url and pressing enter or by going to Internet Explorer favorites and clicking the Book mark...

What if you open google.com in single click. Or open your banking portal in single click. Everyday we start our work by connecting to client VPN, by login to vpn website. We have to open browser, select bookmark to load the website.

By creating shortcuts to these Websites in Taskbar we can open these sites in single click.

The following are the steps to create Windows Shortcuts to the websites

1. Right click on your Desktop. Select New > Shortcut





2. Click Browse and navigate to the following path

"C:\Program Files\Internet Explorer\" and select the iexplore.exe file



3. Now type the website url next to the Iexplore location followed by space. (The url is command line arg for the iexplore.exe)

Eg. "C:\Program Files\Internet Explorer\iexplore.exe" www.google.com





4. Click Next and type a Name for your Shortcut and Click finish





5. Shortcut for Google.com will be available in your Desktop





6. Now right click the shortcut icon. Click Properties and under Shortcut Tab click the 'Change Icon' button. Click Browse and select the shell32.ext in "C:\Windows\System32". Now select any icon and click apply. You can skip this step safely if you dont want any icon

7. Now Right click the Google shortcut and click "Pin to Taskbar" button





8. Now you can access your favorite website in single click at your "Windows Task Bar"





So whenever you want access Google.com just click the shortcut from Taskbar and Google.com site will the launched.



Disclaimer: These steps I learnt from my own experience. Please use caution while attempting your own

Do leave your comments

Little Icon in Personal details

In PeopleSoft HCM 9.2 Image 22, we have Personal Details Tile in Employee Self Service Homepage. Clicking this tile will take you to an Elegant Fluid Component. This component will have a Left Panel with multiple tabs for Address, Name, Phone, Ethnic Groups. I9 Information etc. Clicking each of the Tab will show the details in Right Panel Target area.

Though it looks like a single Component, each of the Tab will make a full transfer to a new Component. Full Transfer mean each component will have a similar left panel and right panel structure. Only the contents in Right panel changes giving us a unified look and feel.

On Further examination of the Fluid Component you can find that each of the Component will have a two panel Fluid layout and a grid in the sub page of the left panel. The grid contains Push Buttons which provide a Tab like CSS styling.

There is a common requirement to Add or hide any of the components from the left tabs. The visibility of the tabs is controlled by permission of the Target components. If we remove permission for the user for any particular component, the left tab will be hidden. The permission based visibility peoplecode is available in below App Package PeopleCode. This PeopleCode is called from Post Build of the components.

HR_FL:MASTER_LIST:PersonalDetails

Adding a new tab requires little PeopleCode in the above Package.

1. Add tab count and add new row in the left panel grid
2. Assign Label Text and Icon
3. Add code for transfering to component

Design the Transfer component similar by cloning the delivered Fluid component. Transfer can be made to any of the classic components too if thats the requirements.

About the little icon. The icon is 20 px by 20 px SVG image. SVG is a Scalable Vector Graphics image. It simply means the image is not bitmap. The image file can be opened in a text editor. You will find XML based geometry objects. SVG images can be downloaded from Google search. Image type can be set as SVG in the Google Image search advanced properties. The file can be downloaded and edited in Notepad++ or any XML editor. We can change the color, view port dimension to set  Height to 20px and Width 20px. Image file can be opened in browsor to preview.  Once you are satisfied with the image, Go to App Designer, File, New, Image and import this image. App Designer cannot display SVG type of image. This Image object can be used in PeopleCode like any other image.

If there is problem with the back button use the below code in Target component. Refer to Oracle Support article related to this.

SetTransferAttributes(False, False, "","", Null, True);