Question
Coforge Ltd.
IN
Last activity: 30 Jan 2020 2:18 EST
HTML Code of a section
Hi All,
I want to obtain the HTML code of a section rule on clipboard.
Can anybody please suggest me how can I achieve it?
There is an OOTB activity to get the HTML code but it includes the classes and other rule names which other applications will not understand.
I want to get the raw HTML code of the section.
Requirement is to export this Raw HTML code to an external DB.
Urgent help needed.
Thanks in advance
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
1. open the section rule
2. From the Actions menu select either "Run" (OR) "Preview" . (I think Run is preferred). "Execute" the page
3. Right click on the page and "Inspect" . This should give the HTML code generated for that section
Coforge Ltd.
IN
Hi Krithiga,
Apologies for not providing the complete requirement.
I need to see the HTML code on clipboard so that I can save it to some DB.
Pegasystems Inc.
US
1. I do not think this is stored in the clipboard as far as I know.
2. Do you need this at run time (Or) at design time. When you open a section in designer studio, the section details are usually the "RH-1" page in the clipboard. I don't think even this contains the generated HTML.
Coforge Ltd.
IN
Hi Krithiga,
No the RH-1 page also does not contain the section's HTML code. Is there any alternate way of doing it?
BPM Company
NL
There is a way of doing so. But it's kind a weird :)
You should use the activity "GetSectionHtml" from Rule-HTML-Section class. The html code you're looking for is in the local property strSectionHtml.
-
Abener Ochoa
Coforge Ltd.
IN
Hi Vaspoz,
Yes the local variable does contain the HTML code but it contains with Pega classes and attributes like the Ins key.
These maybe unnecessary for the external applications. Is there any alternate way of doing it?
BPM Company
NL
that's exactly how it's served to the client. The HTML code you see in this local variable IS the same HTML code what is rendering on the client side.
And yes, some meta data attributes in DIVs tag contain that data. Why is it a problem?
BTW, your phrase "These maybe unnecessary for the external applications" looks veeeery weird, at least what it implies. Before that point, I just tried to blindly help you, but now it seems that your requirement either is not correct or you have misunderstanding with your business.
Could you tell me more - what are you tryng to archieve?
Coforge Ltd.
IN
Hi Vaspoz,
Apologies I could not explain my requirement well.
I totally agree that the additional tags wont cause any problem, it serves the purpose and the attributes on the section renders in an expected manner.
I was just wondering if we can get the HTML code of the section without these additions tags.
This HTML code that I want to get will be used by external applications/parties, as we will be extracting it to an external DB.
So if a person who knows only HTML and not Pega, might fail to modify the HTML code further.
BPM Company
NL
why would someone modify HTML code of autogenerated section to use it somewhere else??
everything what's inside the HTML code is important and must not be ommited.
Plus, it will not work as a standalone html file. It must be served alongside with css and js files, plus other static content.
Plus, almost every section will contain properties from a work object. That's why sections are not static html, but a dynamic element - it must be generated by Pega engine.
And the last - a person who does not know Pega, but knows HTML must not touch HTMLs from Pega :)
Coforge Ltd.
IN
Hi Vaspoz,
Thank you for the inputs.
Yes you are correct. The requirement was to build sections in Pega and the HTML of the section will be exported to external location, so that the other users can make use of the same attributes of the section that was created in Pega.
The above requirement can be achieved by the OOTB activity you mentioned. As it was having the additional tags so I was wondering if we can remove them and then export.
BPM Company
NL
ok, I'm giving up understanding your requirements :)
just last thing which might be helpful. If you want to remove some tags or attributes from an inline HTML code (or any other string), you could write a wrapper activity around the one mentioned above and make use of the function pxReplaceAllViaRegex
Coforge Ltd.
IN
Hi Vaspoz,
Thank you for all the help :)