Thursday 27 November 2014

Send SMS Using Peoplecode


Local String &MobileNumbr = "03434605956" ;

Local String &rand1 , &MSG_ID , &reqStr ;

/* Random Msg ID generation */

   &rand1 = Int(Rand() * 10);
   &rand2 = Int(Rand() * 10);
   &rand3 = Int(Rand() * 10);
   &rand4 = Int(Rand() * 10);
   &rand5 = Int(Rand() * 10);
   &rand6 = Int(Rand() * 10);
   &rand7 = Int(Rand() * 25) + 65;
   &rand8 = Int(Rand() * 25) + 65;
  
   &MSG_ID = &rand1 | &rand2 | &rand3 | &rand7 | &rand4 | &rand5 | &rand6 | &rand8;

   &reqStr = "<?xml version=""1.0"" encoding=""utf-8""?>  <soapenv:Envelope xmlns:soapenv=";
   &reqStr = &reqStr | """http://schemas.xmlsoap.org/soap/envelope/""";
   &reqStr = &reqStr | " xmlns:urn=" | """urn:webService""";
   &reqStr = &reqStr | "> <soapenv:Header>  <wsse:Security soapenv:mustUnderstand=""1"" ";
   &reqStr = &reqStr | "xmlns:wsse=";

   &reqStr = &reqStr | """http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-   secext-1.0.xsd""";

   &reqStr = &reqStr | ">   <wsse:UsernameToken> <wsse:Username>PS</wsse:Username> <wsse:Password Type=";

   &reqStr = &reqStr | """http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText""";

   &reqStr = &reqStr | ">PS</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body><urn:sendSMS><arrayData>  <!--You may enter the following 6 items in any order-->  <mobile>";

   &reqStr = &reqStr | &MOBILE;
   &reqStr = &reqStr | "</mobile> <password>password1234</password> <sender>";
   &reqStr = &reqStr | &SENDER;
   &reqStr = &reqStr | "</sender> <numbers>";
   &reqStr = &reqStr | &MOBILE_PHONE;
   &reqStr = &reqStr | "</numbers> <msg>";
   &reqStr = &reqStr | &BODY;
   &reqStr = &reqStr | "</msg> <msgId>";
   &reqStr = &reqStr | &MSG_ID;
   &reqStr = &reqStr | "</msgId></arrayData> </urn:sendSMS>   </soapenv:Body>
</soapenv:Envelope>";

 &length = Len(&BODY);
  
   If &length <= 156 Then
     
     
      /* (1) Create Request Message from Service Operation */
      &reqMsg = CreateMessage(Operation.SENDSMS10005, %IntBroker_Request);

      /* (2) Create XML Document from Request XML Text String */
      &inXml = CreateXmlDoc(&reqStr);

      /* (3) Set XML Document on Request Message */
      &reqMsg.SetXmlDoc(&inXml);

      /* (4) Invoke SyncRequest for Request Message */
      &respMsg = %IntBroker.SyncRequest(&reqMsg);

      /* (5) Get XML Document from Response Message */
      &outXml = &respMsg.GetXmlDoc();
     
      &userProfile = &outXml.DocumentElement;
      Local number &SMSReturn = &userProfile.GetElementsByTagName("return")[1].NodeValue;


Else
      &toLong = "Message body is too long.";
      MessageBox(0, "", 0, 0, "Message Not Sent." | &toLong);
   End-If;
  
  
  
   If  &SMSReturn = 1 Then
      MessageBox(0, "", 0, 0, "Message Sent.");
     
   Else
      If &SMSReturn <> 1 Then
         &Return = "2";
         MessageBox(0, "", 0, 0, "Message Sending Failed. And Return Code Is = " | &SMSReturn);
      End-If;
   End-If;
  

XML Publisher


Download the XML Publisher Toolbar

–  Log In to PeopleSoft
–  Navigate : Home> Reporting Tools> XML Publisher> Setup> Design Helper





– Unzip & Execute “xmlp_desktop.zip”

– Installs the XML Toolbar in Microsoft Word





Create Report Category

Navigate: Home> Reporting Tools> XML Publisher> Setup> Report Category






Identify / Add New Data Source 

– 
PSQuery is preconfigured XML Data Source
– Other Data Sources
: Rowset, XML File, XMLDoc Object -Require Additional Config
– Navigate:
Home> Reporting Tools> XML Publisher> Data Source







Enter Data Source description, and object owner






Generate & Save Sample Data File and Schema File





Creating an XML Publisher Report


Create Report template in Microsoft Word

– Import XML file generated from the Data Source creation

– Import XSD file generated from the Data Source creation




Insert Table from Wizard





Select table characteristics




Select fields from Data Source for Report



Select table criteria








Edit Field names prior to table generation




Initial table generated from wizard


Portal Registering of Component


Navigation : PeopleTools > Portal > Structure and Content

First, navigate to the folder where you want to add the content reference. Then, click "Add Content Reference" at the bottom of the page.

If you are editing a content reference, you must click on the "Edit" link next to the content reference to change any information.

Import / Export Message Catalog


Export Message Catalog


SET NO TRACE;
SET LOG C:\temp\EXPORT_MSGCATLG.log;
SET OUTPUT C:\temp\MSGCATLG_DATA.dat;

Export PSMSGSETDEFN Where MESSAGE_SET_NBR=13000;
Export PSMSGCATDEFN Where MESSAGE_SET_NBR=13000 And ((MESSAGE_NBR > 0 And MESSAGE_NBR <650));

Export PSMSGSETLANG Where MESSAGE_SET_NBR=13000;
Export PSMSGCATLANG Where MESSAGE_SET_NBR=13000 And ((MESSAGE_NBR > 0 And MESSAGE_NBR <650));



Import Message Catalog
 
SET NO TRACE;
SET LOG C:\temp\IMPORT_MSGCATLG.log;
SET INPUT C:\temp\MSGCATLG_DATA.dat;

IMPORT PSMSGSETDEFN;
IMPORT PSMSGCATDEFN;
IMPORT PSMSGSETLANG;
IMPORT PSMSGCATLANG;

Data Mover Script Templates


Export Record data to File

SET OUTPUT C:\TEMP\PROG_PLN_DATA.dat
EXPORT PS_ACAD_PROG_TBL;
EXPORT PS_ACAD_PLAN_TBL;

Import Record data from File to System

SET IGNORE_DUPS;
SET INPUT C:\TEMP\PROG_PLN_DATA.dat
IMPORT PS_ACAD_PROG_TBL;
IMPORT PS_ACAD_PLAN_TBL;

‘IGNORE_DUPS’ command will ignore the duplicate rows with the same key structure, but it will not check if there is any data change in non key fields.

OR

SET INPUT C:\TEMP\PROG_PLN_DATA.dat
REPLACE_DATA PS_ACAD_PROG_TBL;
REPLACE_DATA PS_ACAD_PLAN_TBL;


‘REPLACE_DATA’ (without ‘IGNORE_DUPS) command will delete the existing data and re-insert the newly available data in the table .



OR

SET INPUT C:\TEMP\PROG_PLN_DATA.dat
REPLACE_ALL PS_ACAD_PROG_TBL;
REPLACE_ALL PS_ACAD_PLAN_TBL;


‘REPLACE_ALL’ (without ‘IGNORE_DUPS) command will drop the table / indexes and then recreate the table and insert  the newly available data in the table .