One thing that keeps me excited about PeopleSoft is the flexibility of the PeopleTools platform. As I was working on a a custom Pagelet Transform Type, following the details outlined in Rich's blog post Markdow Text Filtering for PeopleSoft, I realized I was actually creating a custom Meta-HTML element. How cool is that? Not only can I extend the PeopleCode language using Java, I can also extend the Meta tag set. Here is the code:
Function ResolveMetaHTML(&html as string) returns string
Local JavaObject &pattern;
Local JavaObject &matcher;
Local String &node_url;
REM ** Resolve %NodePortalURL(NODENAME) tags;
&pattern = GetJavaClass("java.util.regex.Pattern")
&matcher = &pattern.matcher(
SQLExec("SELECT URI_TEXT FROM PSNODEURITEXT WHERE MSGNODENAME = :1 AND URI_TYPE = 'PL'", &matcher.group(1), &node_url);
&html = Substitute(&html, &matcher.group(), &node_url);
This Meta-HTML element replaces
%NodePortalURL(NAMEOFNODE) with the Portal URL defined on the portal tab of the node NAMEOFNODE. This can be used to ensure images, scripts, CSS, links, iframes, etc point to the correct server at runtime.
If you want to create your own Meta-HTML elements, I suggest you place the implementation of those elements inside an Application Class. This custom Application Class would be responsible for accessing its HTML definition using
GetHtmlText and replacing all instances of custom Meta-HTML elements with your implementation of those Meta-HTML elements. Rather than call
GetHtmlText directly, your PeopleCode would use your custom Application Class.
If this works for Meta-HTML, why not custom Meta-SQL?
Thanks Jim for a wonderful Blog! Some excellent information listed here.
Jim - It looks like the link on this post has moved.
I am interested in implementing custom meta-html and wondering if you can give me some pointers.
How is the ResolveMetaHTML function getting executed?
@Sasank, you have to create your own Display Format, which is an App Class. You then register this app class in the Pagelet Wizard metadata repository. I have an example of creating a data type in my book. Creating a display format is very similar.
Great! Thanks Jim.
I will give that a try.
@Khantozavri, using the approach above, anything can become "meta-html" for Pagelet Wizard, but only when used through a transformer as in the manner described here.
@Jim, I'm sure what you have said makes lots of sense to those who are more technical than me. I'm not at that level so if you find this too novice - it is.
Here's my need: I have a live chat tool which works via injecting an html object to peoplesoft via branding objects feature. We are PT 8.54.18. That html object is actually a javascrip that has a function to 'identify' which basically accepts variables to identify currently logged in users.
I have taken a leap of faith and knowing (through experimentation) that basic text has several variables (%UserID, %EmailAddress and %UserDescription among others), I passed them all to that tool and discovered that some worked and others didn't.
Through some reasearch I came accross one possible explanation that %UserId works as it is a meta-html (as well as system variable), while %EmailAddress and %UserDescription are just system variables and not meta-html.
I'm not sure if to what you are refering to as tranformers and Pagelt Wizards is really applicable to my situation here, but my need is very simple: pass on to my tool (live chat widget) %EmailAddress and %UserDescription just like the %UserId, hene my original question: Will the logic / approach above work?
Post a Comment