Welcome Message

"The difference between a successful person and others is not a lack of strength,
not a lack of knowledge, but rather a lack in will."
-Vince Lombardi

March 18, 2010

parseInt('08') and parseInt('09') does not work in javascript

Few of you might know this logic before.  We would like to just let everyone know the lessons learnt from our team.

 

When we were looking into an issue reported by customers on a date being passed wrongly even though when we key in a correct date, we figured out that parseInt(‘08’) and parseInt(‘09’) will give you a wrong value in javascript.

 

This is because when you say parseInt (string), it considers by default octal as numbers.  Octal numbers ends with 07.

08 and 09 are considered to be invalid numbers in octal.

 

Solution:

 

Its always safe to give the base value with the method.

 

parseInt (‘08’,10) will consider the base as decimal.

 

Refer to below link for the actual syntax:

 

http://www.w3schools.com/jsref/jsref_parseInt.asp

                                                                                   

Please share this info with others as well.

March 1, 2010

How to check what are the HTTP and HTTPS port in WPS from logs and Admin console

Hi,

There would be some case, where we dont have access to the admin console, but have only access to the logs. In this case how can we find the HTTP and HTTPS port for default and admin.

To find the ports using Admin Console:

start the server, go to Servers->Application servers > server1 > Ports, scroll down to see the screenshot below



WC admin host: HTTP port for admin console

WC admin host secure: HTTPS port for admin console

WC defaulthost: HTTP port for default host

WC defaulthost secure: HTTPS port for default host

To find the ports using the System out logs:

Search for the below sentence in the logs

“Web Module WebSphere Admin File Transfer Application has been bound to admin_host” - [*:HTTP,*:HTTPS]. This is for the admin HTTP and HTTPS ports

“Web Module Default Web Application has been bound to default_host” – [*:HTTP,*:80,*:HTTPS]. This is for the default HTTP and HTTPS ports

-Sudan

Invoking PeS through plain Java

Hi All,

Today I would like to explain the POC that I was trying last week. Generally for connecting to PeS we have three ways as below

  1. File Layout
  2. Web Services Application Messaging
  3. Component Interface

File Layout:

This is used to connect to PeS when we need file based polling integration. Generally the type of file used would be xml or csv’s. This method is still very popularly used in many applications.

Web Services Application Messaging:

This is a plain Web Service communication. Messaging architecture for both synchronous and guaranteed delivery asynchronous integration into and out of the Integration Broker

Component Interface:

This is Object-oriented, request/reply, component architecture that encapsulates PeopleSoft data and communicates.

I am interested in using Component Interface for PeS connectivity. Generally in market lots of adapters are available for doing this. The leaders are Oracle and IBM, they provide adapters for connecting to PeS. So, the developer doesnt have to code or worry about the PeS connectivity, they just need to send the data and get back the data they need. This makes life simple for developers

I have used IBM adapter in Websphere process server for PeopleSoft. The advantage i could see using is just easy development. But is it worth paying huge money for just getting this advantage. Why cant we develop our own component in process server which does this functionality.

The other advantage that adapter give is that we can discover the CI available in the PeS and just use the operation we want. All these things can be done using a good UI wizard. When we go for our own java implementations, we have to open each CI and create a java template for each.

We will go step by step tutorial for doing this.

PSJOA.jar -> This is the interface jar file which would help Java to interact with PeopleSoft through a component interface. It will be available in %PS_HOME%\class directory.

Create a record with a single field and put this on a page. Create a component and move it to a component interface. The component interface should have the following methods :- Cancel, Create, Find, Get and Save.

Now, open the component interface. Click on Build -> PeopleSoft APIs. This process would validate all the component interface and you will get some errors in this process. You can just skip the errors and continue the process. Select the “java” class option and specify the target location where the java files needs to be placed. For any component interface, PeopleSoft create four files like for CI name JobData, it would create

IJobDataCI.java

IJobDataCICollection.java

JobDataCI.java

JobDataCICollection.java

So, after compiling this, pack all the class files into a jar file, say PSFTCI.jar. So, now we have two jar’s PSJOA.jar and PSFTCI.jar

The next step is to create a java template. Open the component Interface, right click and click on generate a Java template. So, this would be saving your java template for that CI in some temp folder. Generally the Java template name would be the CI name itself, say JobDataCI.java

Now if we open the java template, we can see a code like

“oSession.connect(1, strAppServerPath, strOperatorID, strPassword, null)”

Here we can give the server name, username and password for the PeS we are trying to connect. This would take the default port. If we need to modify this port number to some specific value and have all these data coming from properties fil, we need to follow the below steps.

  1. change the above code to “oSession.connect(1, strAppServerPath, strOperatorID, strPassword, null)”
  2. create a property file pstools.properties in the java project with the following key names

server_port=<server_port>
server_name=<server_name>
logon_id=<logon_id>
logon_password=<logon_password>

That’s it, we are done. Just need to use the setter and getter methods in the java template to select or update the date in PeS.

This finishes the tutorial for connecting to PeS through java.

-Sudan