Search This Blog

Showing posts with label developer. Show all posts
Showing posts with label developer. Show all posts

Monday, September 7, 2009

Print Functionality in the Page




Below are the steps to implement the print functionality in a PeopleSoft page.

Step 1. Choose a field from a derived record which you’ll use as the field for your pushbutton control. It should be in MixedCase format and at least 25 characters long. I recommend creating a new field for this purpose, so that you can assign a suitable label to the field.
Step 2. Insert the pushbutton on your page. Set the Destination to External Link and type is Dynamic. For this tutorial, I’ve created the field JS_PRINT and attached it to the DERIVED_WORK record. This is the field that the pushbutton is assigned to.
(See the attached image)
Step 3. Go to the General tab and fill in the Page Field Name. Enter the value PRINT_BTN.
(See the attached image)
Step 4. We assign a value to the external link pushbutton via PeopleCode. In the FieldDefault PeopleCode of DERIVED_WORK.JS_PRINT, put the following PeopleCode:


DERIVED_WORK.JS_PRINT = "javascript:window.print()";
This is the code that triggers the print command in the browser when the button is clicked.
Step 5. Insert an HTML area at level 0 of the target page. Set the Value to Constant and put the following text:


<style type="text/css">
@media print {
  #PAGEBAR, .PSHEADERTOOLBARFRAME, #PRINT_BTN { display: none }
}
</style>
This CSS declaration tells the browser to omit the pagebar, the tool bar, and the print button from the printout.

Note: This tutorial assumes that the print button is placed at the level 0 of the page.
And there you have it!

Normally, I have reservations about inserting the CSS in the body of an HTML document. However, it is much simpler and appears to work in most browsers including IE6 and Firefox. This post presented a more elaborate technique.

Additional Requirement:
Suppose it is desired that the Folder Tabs (top) and Hyperlinks (below) for page navigation should also be omitted on the printout.

Solution:
This requirement is little more tricky since PeopleTools doesn’t assign an id or a class to these sections of the page. We would need assign a class to these elements via javascript. The following script adds the class of PS_PAGETABSNAV to the Folder Tabs and Hyperlinks; the style is updated to omit PS_PAGETABSNAV from the printout.

Caveat: This may not work on all 8.4x versions and may stop working in future versions of PeopleTools. This is tested only on 8.45
Modify the content of the HTML area for step 5 above.


<script type="text/javascript">
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
 window.onload = func;
} else {
 window.onload = function() {
   oldonload();
   func();
 }
}
}

addLoadEvent(function() {
pg_tables = document.%FormName.getElementsByTagName('table');
for (var i1=0, el_tbl; el_tbl=pg_tables[i1]; i1++) {
  if (el_tbl.className=='PSPAGECONTAINER') continue;
  tds = el_tbl.getElementsByTagName('td');
  for (var j=0, el_td; el_td=tds[j]; j++)
    if (el_td.className=='PSACTIVETAB'|
|el_td.className=='PSHYPERLINK') {
      if (el_tbl.className) el_tbl.className+=' PS_PAGETABSNAV';
      else el_tbl.className='PS_PAGETABSNAV';
      break;
    }
}
});
</script>
<style type="text/css">
@media print {
  #PAGEBAR, .PS_PAGETABSNAV, .PSHEADERTOOLBARFRAME, #PRINT_BTN { display: none }
}
</style>

PeopleTools to Fusion


While PeopleTools continues to evolve, Fusion Applications are being built with a new generation of tools, Fusion Middleware. JDeveloper and Oracle’s Application Development Framework (Oracle ADF) are two of the key technologies of the Fusion Middleware stack that developers will use to build their core applications.


The Fusion Middleware stack brings a whole host of opportunities and possibilities to the world of enterprise application development. However, this new world and all the new terms and language can seem daunting to a developer who is used to PeopleTools. One of the best ways for PeopleTools developers to be introduced to the Fusion Development environment is to compare the concepts and terminology between the toolsets. Although they don’t always align quite right, there are enough similarities to get started.

Above images shows the comparison of familiar concepts between peopletools and fusion middle ware, written specifically for PeopleTools developers. The list will continue to be lengthened.

Oracle Application Development Framework (Oracle ADF).

Oracle ADF is an end-to-end application development framework that allows you to develop enterprise solutions that search, display, create, modify, and validate data using web, wireless, desktop, or web services interfaces. Just like PeopleSoft applications are built on PeopleTools Framework, Fusion Applications are built on Oracle ADF. Oracle ADF builds on Java Platform, Enterprise Edition (Java EE) standards and open-source technologies to simplify and accelerate implementing service-oriented applications. Whereas PeopleTools is a black box type of development environment, Oracle ADF is more of a white box. This brings with it many new opportunities but also requires more investment from developers in learning the basic aspects of the underlying technology.

JDeveloper (jdeveloper.exe)

Just like Application Designer was the Integrated Development Environment (IDE) for building PeopleTools applications, JDeveloper is an IDE for building web applications. JDeveloper covers the full development lifecycle from design to deployment, with drag-and-drop data binding, visual UI design, and team development features built-in. JDeveloper can be used to build ADF Applications but is also an IDE for other technologies such as HTML, JSF, Java, and Swing.

Oracle Application Server

PeopleSoft Application Server (psadmin.exe) and Web Server (startpia) are the runtime environment required to deploy and run your PeopleTools applications. The runtime environment required to deploy and run your ADF web applications is Oracle Application Server or an alternative J2EE Web Application Server with ADF Runtime Installed. JDeveloper also comes with an embedded integrated server for testing and debugging your applications. Hence, you don’t need to deploy your application to the main application server to test it like you do with PeopleTools.

Meta Data XML Files

Unlike PeopleTools metadata which is stored in the database in various PeopleTools tables (psrecdefn, psfielddefn, pspaneldefn etc.), ADF metadata is captured and stored as XML. For instance, when you create a new page called CreateOrder, a CreateOrder.jspx file is created in your project. As you drag and drop components onto your page in the visual editor, XML tags for these components and their attributes are added to the XML file. In contrast to PeopleTools where the only way to alter PeopleTools metadata is through the Application Designer, a developer can directly edit the source of the XML file in addition to using the visual editor.

ADF Business Components

Business Components represent the logical data model for yourapplication. The Entity Object and its attributes map to the database tables and columns, just like the record definition. Entity Objects have declarative validation and business logic. The View Object is used to create different views of the various entities, like the PeopleTools Record Definition of type View, but doesn’t require an actual view to be created in the database, which significantly reduces the number of views in the database. View Objects allow developers to create logical business objects like Person, Order etc. Attributes that don’t represent columns in the database, i.e. calculated fields, can easily be added to view objects. This removes the need for derived records. Business logic can be added to the Business Component objects at the various layers just like record and field PeopleCode.

Java

In PeopleTools, PeopleCode is the language that is used for business logic when declarative or definitional development isn’t possible. In ADF, the language used for business logic is Java.

JSF Page, JSF Page Fragment

This is the canvas for your User Interface. Developers drag and drop components such as tables, forms etc. onto their JSF page to create the user interface for users. They can drop HTML, JSF, or most likely, ADF Faces components onto their page.

ADF Task Flow

The ADF Taskflow defines your transaction boundaries like your component definition. You define the pages that are a part of your transaction and the navigational flow between your pages and across your transaction.

Component Buffer

At runtime, the component buffer is the representation of your data structures and business logic for your transaction. It maintains the current row, state, and saving of the data to the database etc.

Application Module

The Application Module is the equivalent of the Component Buffer but is defined with your ADF Business Components. This allows for separation between your data/business logic and your user interface. You can test and run your application module in JDeveloper without having a User Interface.

Application Designer Build Project

ADF Offline Database Designer In PeopleSoft, you create record definitions and build your tables in Application Designer, based on the record definition. JDeveloper and ADF provide a number of sophisticated tools to design, diagram and maintain your database schema. This technology is called the ADF Offline Database Designer

Courtesy : PeopleTools to Fusion Quick Reference Guide by Oracle