Steps for Creating an XML Export File with PeopleSoft

Your rating: None Average: 4 (3 votes)

Creating an XML Export File with PeopleSoft
Part of MICA’s web redesign project is going to involve doing data integration between our CMS ( Ingeniux), and our HRMS ( PeopleSoft). Recently I have been playing with XML Publisher, and the flat files that it produces seem so perfect for distribution to our CMS. I was a little disapointed that the XML documents that it creates to further create more documents was not exposed for use as an integration point between systems.
So I began looking for other alternatives.
Integration Broker seems to be quite the range in the business for the moment. After poking around with that, it seemed like a lot of work for what would ultimately be a flat file that is updated periodically when things like course descriptions, or degree plans changed. While this may be useful for more interactive or personalized content, it doesn’t really fit the bill for static content.
The “simplest” (remember, this is PeopleSoft) way I found to create an XML file similar to the one created by XML Publisher is using File Layouts in Application Designer.
The rest of this article is about creating a simple File Layout.
There are 4 basic parts to creating a File Layout.
1. Create or Select a Record for your data. I used a view, to avoid having to deal with joins in PeopleCode.
2. Create a File Layout Definition.
3. Create an Application Engine Program, with a tiny bit of code in it.
4. Stuff all these things into a project so you can maintain your sanity at a later time.
After you have selected the record with the data you want to export, create a new File Layout Definition (File->New Definition->File Layout).

On the definition tab, right click “NEW FILE” and select Insert Record. Search for the record you are using for your data, and double click it. The Record Definition, and its columns will show up under “NEW FILE” now. Save your File Layout Definition.

Click the Property Icon ( ), then click the “Use” tab, and select XML in the “File Layout Format” drop down. Click OK.

Create a new Application Engine Program (File->New->Application Engine Program). Right click “Step01″ and select “Insert Action”. Click where it says “SQL”, and select “PeopleCode” from the drop down.

Double click the new action to edit the PeopleCode. Copy and paste this PeopleCode into the window:
Local Record &Rec;
Local File &File;
Local SQL &SQL;

&File = GetFile("c:\temp\export_sample.xml", "W", %FilePath_Absolute);
If &File.IsOpen Then
If &File.SetFileLayout(FileLayout.YOUR_FILE_LAYOUT_DEFINITION) Then
&Rec = CreateRecord(Record.YOUR_RECORD_DEFINITION);
&SQL = CreateSQL("%Selectall(:1)", &Rec);
While &SQL.Fetch(&Rec)
&File.WriteRecord(&Rec);
&File.WriteLine("");
End-While;
Else
Error ("File Layout Not Correct");
End-If;
Else
Error ("file not open");
End-If;
&File.Close();
Save the above Peoplecode and close this window. Insert all these definitions into your project, and make sure you build it, creating any views and tables you may have created for your data. Click the Run Program Icon ( ), and voila: you have a XML file which can be used outside of PeopleSoft (View the File Layout XML Sample)
<?xml version="1.0" ?>
-
-
History Design & Illustration
CSGD
252
A
001229
Fall 2007
History of Design and Illustration
09/04/2007
10/23/2007
18.30.00.000000
22.00.00.000000
N
Y
N
N
N
N
N
1.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
1

-
Concept & Design1:Layout/Pres
CSGD
253
A
001230
Fall 2007
Concept & Design 1: Layout to Presentation
10/31/2007
12/19/2007
18.30.00.000000
22.00.00.000000
N
Y
N
N
N
N
N
1.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
2

-
Graphic Design2:Prob.Solv.
CSGD
351
A
001235
Fall 2007
Graphic Design 2: Problem Solving for Print & Web
09/06/2007
12/13/2007
18.30.00.000000
22.00.00.000000
N
N
N
Y
N
N
N
2.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
2

-
Pub.Design:Innov.Edit Solution
CSGD
452
A
001237
Fall 2007
Publication Design: Innovative Editorial Solutions
09/08/2007
12/15/2007
09.30.00.000000
13.00.00.000000
N
N
N
N
N
Y
N
2.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
2

-
Adobe Illus.1:Intro Vector Art
CSGD
358
A
001238
Fall 2007
Adobe Illustrator 1: Introduction to Vector Art
11/05/2007
12/17/2007
18.30.00.000000
22.00.00.000000
Y
N
N
N
N
N
N
1.00
0323
Robert
Lynch
1
1
2

-
Adobe InDesign:Prog.Publishing
CSGD
256
A
001239
Fall 2007
Adobe InDesign: A Layout Program for Publishing
09/09/2007
12/16/2007
13.00.00.000000
17.00.00.000000
N
N
N
N
N
N
Y
2.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
2

-
Adobe Photoshop1
CSGD
254
A
001241
Fall 2007
Adobe Photoshop 1: Intro to Digital Image
09/08/2007
12/15/2007
09.30.00.000000
13.00.00.000000
N
N
N
N
N
Y
N
2.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
3

-
Drawing as Design & Illus.Tool
CSGD
357
A
005792
Fall 2007
Drawing as a Design and Illustration Tool
09/10/2007
10/29/2007
18.30.00.000000
22.00.00.000000
Y
N
N
N
N
N
N
1.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
1

-
Creative Digital Photography 2
CSGD
453
A
005797
Fall 2007
Creative Digital Photography 2
09/08/2007
12/15/2007
09.30.00.000000
13.00.00.000000
N
N
N
N
N
Y
N
2.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
1

-
Drawing Design & Illus - GRAD
CSGD
5357
A
006392
Fall 2007
Drawing as a Design and Illustration Tool - Graduate Level
09/10/2007
10/29/2007
18.30.00.000000
22.00.00.000000
Y
N
N
N
N
N
N
1.00
0323
XXXXXXXXX
XXXXXXXXX
1
1
1

AttachmentSize
Creating an XML Export File with PeopleSoft.doc204 KB
Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
Guest's picture
Guest (not verified)
Re: Steps for Creating an XML Export File with PeopleSoft

good

Tolls's picture
User offline. Last seen 7 years 4 days ago. Offline
Joined: 02/03/2010
Posts: 1
Re: Steps for Creating an XML Export File with PeopleSoft

Is it necessary to learn html tutorials before XML ?

Post new comment

CAPTCHA
The question below is to prevent automated spam submissions.
1 + 8 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.