Thursday, March 3, 2016

Component Error "You Are Not Authorized..."

There is a common peoplesoft component error "You are not authorized to access this component. (40,20)".

To address this, first check the following:


1. Component in the menu
2. Access to component in the permission list
3. permission list in the role
4. the role assigned to the user profile
5. clear browser cache, close the browser, reopen browser
6. clear and reboot app server cache

If all pass, then check this

7. non-existing permission list assigned to the role.



The only way that non-existing permission list in the role is by doing a project migration from database to database. You may think the permission list in the project, but apparently not.

I do not add roles, permission lists, menu in my project. Unless you are the sole developer for the system, I would encourage to stay away from it.

Code Tip:
Here is a SQL to check if there is non-existed permission list which is still attached to role:

Select R.rolename , RC.classidFrom psroleuser R , psroleclass RCWhere RC.Rolename = R.Rolename And not exists (Select 'X' from psclassdefn C Where C.classid = RC.classid) And R.roleuser = '[--OPRID--]'

Friday, November 6, 2015

Data Mover Import Export

A common development task is to move data between two different PeopleSoft environments.  You can use App Designer to move code, table structures, and pages, but data is a different story.  Data Mover is your tool for moving your data.
My biggest challenge is that I don’t use it enough to have the syntax memorized.  This post is a list of common tasks with the syntax to make it easier to remember…

Copying Data Out

The export command copies data out of the database into a DAT file.  You should set the Log parameter to save the log to a particular place.
SET LOG C:\Temp\export.log;
SET OUTPUT C:\Temp\data.dat;

EXPORT PS_BAS_EVT_CLASS;

You can use the record name or the table name.  So, here’s the same thing with the record name instead of the table name.
EXPORT BAS_EVT_CLASS;
If you want to restrict which rows from the table get written into the data file, you can add a where clause:
EXPORT BAS_EVT_CLASS
WHERE EVENT_CLASS = 'CVG';

Copying Data In

The import command is the way to copy the data back into the system.  You will want to set the Log parameter and you have to set the Input parameter.
SET LOG C:\Temp\import.log;
SET INPUT C:\Temp\data.dat;

IMPORT BAS_EVT_CLASS;

If you want to limit which rows you want to import, you can use a Where clause.  For me, it wouldn’t work unless I used the parameter (:1).
IMPORT BAS_EVT_CLASS WHERE EVENT_CLASS = :1;CHAR,CVG;

Now, if the row already exists, it will ignore it.  There is a “Set Ignore_Dups” option, but I didn’t have to use it.  It just ignored the row that already existed.  To get it to update the row, I used the “Set Update_Update” option:
SET UPDATE_DUPS;
IMPORT BAS_EVT_CLASS WHERE EVENT_CLASS = :1;CHAR,CVG;

These commands so far work with only the rows that are in the data file.  If the database has extra rows that you don’t want, you need to use Replace_Data.  You could truncate the table first, but the Replace_Data command is designed for just this:
REPLACE_DATA BAS_EVT_CLASS;

Tuesday, October 13, 2015

Consume Third Party Web Service in PeopleSoft


In this example we will consume a 3rd party web service in our peoplesoft system. The web service we have used is a simple calculator program having four operations – Add, Subtract, Multiply & Divide.

This configuration is for  PeopleTools 8.51.15
Before performing the steps please make sure that Integration Broker is configured

Step 1 – Setup Node


We have to setup a node in PeopleSoft System which will communicate with the external system.
Open the existing node WSDL_NODE.






Copy the node to be used for integration.




Step 2 – Get a Public Web Service

There are many available on the net. We will use this as an example.

http://www.dneonline.com/calculator.asmx?WSDL




It is having four operations – Add, Multiply, Subtract and Divide. We will use these four operations.

Step 2 – Consume the Web Service



Navigate to PeopleTools  Integration Broker  Web Services  Consume Web Service



Check the WSDL URL radio button and enter the WSDL.





Select the Operations that you want to use.





Give some friendly message names.






Enter the new node that we have created in the first step.








Step 4 – Enter Connection Information



Again, open the node DR_WEB_SERVICE and enter the connector id and Primary URL.




The Primary URL will be - http://www.dneonline.com/calculator.asmx


Now, ping the node to confirm that the setup is correct.






Step 5 – Provide Security

Now, search for the service operations that we have created above.





Give a permission list which is assigned to your user profile.




Similarly, provide the security for other service operations.

Step 5 – PeopleCode to Use Web Service


Review the request and response message and accordingly we will create in peoplecode.
Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="http://tempuri.org/">
<intA>int</intA>
<intB>int</intB>
</Add>
</soap:Body>
</soap:Envelope>

Response

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>int</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>



Create a simple page –






On the FieldChange event of Calculate button write the following peoplecode. In this example we are using ADD service operation.








Click on the Calculate button.

Request




Response


Friday, August 7, 2015

Peoplesoft Webserver Cache Location

C:\bea\webserv\peoplesoft\applications\peoples oft\PORTAL\ps\cache

<PS_HOME>\webserv\<Domain>\applications\ peoplesoft\PORTAL\<PIASite>\cache

PeopleSoft and Load Balancers on WebLogic


ISSUE:
End users are intermittently seeing "This page is no longer available" message or intermittently kicked out to the search page. These problems occur since the end user's sessions are not sticky and end user's session are bouncing between multiple webservers. Incorrect load balancer setup may cause other intermittent problems.

SOLUTION:
Verify PIA and load balancer are setup correctly with the following checklist:

1. For customers that use a load balancer, Oracle recommends using a cookie (session) based load balancer and sticky bits enabled.  IP based load balancing is not recommended and IP based load balancing is known to cause session stickiness problems.  
For more information on cookie based load balancing and sticky bits, please follow up with your load balancer vendor.
F5: http://www.f5.com/pdf/deployment-guides/f5-peoplesoft-dg.pdf

2. Ensure all your webservers have the same cookie name in each weblogic.xml file.  This file can be found in the following directory: 
/webserv//applications/peoplesoft/PORTAL/WEB-INF/weblogic.xml
In this example, there's two webservers behind the load balancer. Therefore, verify that your cookie names are the same:

weblogic.xml (webserver 1):


CookieNamepststweb-7011-PORTAL-PSJSESSIONID 

weblogic.xml (webserver 2):


CookieNamepststweb-7011-PORTAL-PSJSESSIONID 

Save both weblogic.xml files.

** If you're running Enterprise Portal and have content providers, please ensure that all Enterprise Portal webserver cookie name are all exactly the same. The content provider's webserver cookie names should have their own set of cookie names. Therefore, both Portal and content should not have the exact same cookie name. Suppose Enterprise Portal had 4 webservers and HR had 4 webservers. All 4 Enterprise Portal cookie names could be eportal-7011-PORTAL-PSJSESSIONID, but all 4 HR cookie names could be hrms-7011-PORTAL-PSJSESSIONID.

3. In weblogic.xml, ensure CookieDomain is set in all weblogic.xml. This value is automatically set when entering the authentication domain during the PIA install. If the authentication domain isn't set during PIA install, please reinstall PIA and set authentication domain.


CookieDomain .company.com
4. In PIA, navigate to "PeopleTools -> Web Profile -> Web Profile Configurations". Search for your Web Profile. Click on

Virtual Address and populate your default addressing. For example, suppose your end users access your load balancer with the following URL:@ http://mycompany.com/ps/signon.html You would need to set the following:

Default addressing Protocol: HTTP
Default addressing Name: mycompany.com
Default addressing Port: 80

* The above is an example. You'll need to populate with your load balancer info.
5. Please ensure PIA "Inactivity Logout" in seconds matches HTTP timeout in minutes.

a) In PIA, navigate to "PeopleTools -> Web Profile -> Web Profile Configurations". Search for webprofile. Click on "Security" tab. PIA timeout is "Inactivity Logout" in seconds. Suppose "Inactivity Logout" = 1200 seconds.

b) In WebLogic, open web.xml file.  This file can be found in the following directory:
/webserv//applications/peoplesoft/PORTAL/WEB-INF/web.xml 
WebLogic HTTP timeout appears in minutes:

20

In this example, ensure WebLogic HTTP timeout is 20 minutes to match "Inactivity Logout" (1200 seconds).

The Load Balancer's timeout should be higher than the PIA "Inactivity Logout" timeout and webserver HTTP timeout. Please consult with load balancer vendor to find out where to set load balancer timeout.

6. After updating weblogic.xml, web.xml and webprofile, you must bounce your webservers.

KEYWORDS: SPOTLIGHT, "page is no longer available", Load Balancer

Monday, February 16, 2015

Pagelet Wizard Custom Tags

Pagelet Wizard custom transformations can use special tags documented here to insert images, message catalog entries, or to format numbers and dates. This is great when trying to format currencies or ensure multilingual compliance. The problem with "Post-Transformation Processing," as it is called in PeopleBooks, is that it requires the transformation results to be valid XML. Question: How do you get Pagelet Wizard to generate valid XML when the Xalan processor used by PeopleTools sees HTML tags and automatically generates HTML? Answer: use the <xsl:output> XSL tag. Here is a sample template that produces valid XML:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    exclude-result-prefixes="xhtml xsl">

    <xsl:output method="xml" version="1.0" encoding="UTF-8"
        doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
        indent="yes" />

    <xsl:template match="/">
        <!-- your XSL goes here -->
    </xsl:template>
    
  <!-- identity transform templates -->
  <xsl:template match="*">
    <xsl:apply-templates/>
  </xsl:template>

  <!-- delete unmatched text -->
  <xsl:template match="@*|text()|comment()|processing-instruction()">
  </xsl:template>
  
</xsl:stylesheet>

Iscripts Example



Iscripts by Example:
Create a derived work record which starts with WEBLIB_XXXXXXXX
Include a field ISCRIPT1 which holds the peoplecode function for Iscript as show below.
Record Definition: WEBLIB_HELOWRLD

The below script , echoes the value entered in the text box.
Function IScript_HelloWorld()
Below is the code placed in fieldformula



Security:
After you create a WEBLIB record, and your functions, you must add them just as you would add a page to an application.

Adding the WEBLIB record to permission list PTPT1000. Below is the snapshot.



Click on Edit to control the type of access to the functions.
Testing: Login to PIA and copy the below URL.

http://localhost:8000/psp/hr9stg/EMPLOYEE/HRMS/s/WEBLIB_HELOWRLD.ISCRIPT1.FieldFormula.IScript_HelloWorld

Note: You need to replace 8000 with webserver port and hr9stg with the domain name.
The below script , echoes the value entered in the text box.
 
This completes the creation and testing of iscript.
Note:  You might have observed that just like the content reference which has a URL , the iscript is also a URL.
So, just like the way we register component through App designer to make the link available to the user in PIA, similar way we can register for iscript as well.
Will discuss in detail on the registring iscript in another post. Below arrow shows the registration wizard for Iscript in App Designer.