Is it possible to read content of an IceBreak 'marker' in the program code? - rpgle

I'm using IceBreak to make HTML frontend for RPG programs.
There is a function called 'SetMarker' which takes the name of the marker and the value:
SetMarker('Demo':'Example');
This makes the value available for the HTML code:
<!--#tag="MyTag"-->
<p>This is a/an <%$ Demo %></p>
When called by RPG:
ResponseWriteTag('IceB.html':'MyTag');
My question is: Is it possible to check the value of a specific 'marker'? Or if it has been set? Some kind of 'GetMarker' method perhaps?
(I tried searching here and there, but 'marker' and 'icebreak' mostly gives completely unrelated stuff)

After having searched through the methods defined by IceBreak I conclude that there is no defined way of obtaining the value of a marker.
The only method other than "SetMarker" that even mentions markers is "ParseMarker" which "Render current markers into the response object".
The short answer: No, it is not possible.

If you are still looking for an answer, maybe try posting this question on RPG400-L

Related

Accessing Area.Name Throws Error

I'm just trying to find a way to access the name property of an Area element inside Revit Python Shell, tried looking on Jeremy Tammik's amazingly informative blog, tried AUGI, Revit API docs, been looking for 2 days now...
Tried accessing via a bunch of ways, FilteredElementsCollector(doc).OfCategory(BuiltInCategory.OST_Areas), tried by Area class, tried through AreaTag, every single time I get an error under every circumstance and it's driving me nuts, it seems like such a simple issue that I can't seem to grasp!
EDIT: Also tried by element id, through tags, through area schemes, nada, no go...
Can anyone please tell me how to access this property via RPS?
I would say two things:
areaObject.LookupParameter("Name")
areaObject.GetParameters("Name")
...are valid methods. Please notice how I used GetParameters() NOT GetParameter(). There are some drawbacks to using either one of the two. The lookup method will return FIRST parameter that matches the name which in many cases might be a different parameter for different elements. It's not very reliable.
GetParameters() method will return them all if there are multiple so then you have to deal with a List<Parameter> rather than a single object that you can extract your value from.
I would personally recommend to use areaObject.get_Parameter(BuiltInParameter.ROOM_NAME) method to extract a Name value from Area object. The BuiltInParameter always points at the same parameter, and will reliably return just that one parameter. Here's a little more details about these methods:
http://www.revitapidocs.com/2018/4400b9f8-3787-0947-5113-2522ff5e5de2.htm
To answer my own question, I actually never thought of looking through the code of other Revit Python scripts... in this case of PyRevit, which is in my opinion far more eloquently written than RPS, raelly looking forward for their console work to be done!
Basically, I had mistakenly used GetParameter('parameter') instead of LookupParameter('parameter').
As I said, it was something stupidly simple that I just didn't understand.
If anyone has sufficient knowledge to coherently clarify this, please do answer!
Many thanks!
Maybe your issue is the same as this one ? :
https://groups.google.com/forum/#!searchin/RevitPythonShell/name|sort:relevance/revitpythonshell/uaxB1FLXG80/sdJNrTfoPuUJ
Your_Area.Name # throws error
Element.Name.GetValue(Your_Area) # works great

MediaWiki QuickTemplate class - Where to find references?

I'm new to MediaWiki skin design. I have found these two functions being used heavily.
QuickTemplate::html($str)
QuickTemplate::text($str)
These are used in execute() function in the custom Template class, as $this->html($str) and $this->text($str)
I'm pretty ok with their functionality. But, so far, I haven't found a reference for the list of string arguments fed through the $str parameter. I've seen them being used in templates with various arguments like, $this->html( 'headelement' ), or $this->text( 'pageLanguage' ). My question is how do we exactly know the the argument is 'headelement' ? Is there a complete list of such arguments? Not sure whether I'm missing some part of the documentation.
Well, did you try the QuickTemplate Class Reference and Using QuickTemplate in extensions?
The functions html() and text() don't really do anything, they seem just a way to supposedly "abstract" the handling of HTML strings vs. all other strings: text() escapes the HTML a bit. Mostly a historical thing.
As the manual says, please don't use QuickTemplate :), follow the skinning template.

How to write text values in masked field?

i need some help related to masked field in web form. Syntax of phone field is (___)___-_____, if i execute this code in ruby shell
browser.text_field(:id => 'txtphone').set '7893457889'
... nothing has been added in the phone field.
then i find this solution in one blog, someone said first unmask this field using this code.
browser.text_field(:id,'txtphone').fire_event("unmask")
then write the above code again.
browser.text_field(:id => 'txtphone').set '7893457889'
but still nothing has happened. kindly help me out...am i doing right or still there is a mistake.
If you could provide some sample of the page HTML it will be easier to give you an answer more likely to work.
Given what you have provided us to work from, we have to go with the normal way that such masked input fields typically work and go from there. Usually pages with this kind of thing are calling a javascript function which is triggered by a specific event. Most often this is an event such as onchange but it may be something like keypress or any other even that happens when a normal user types or pasts text into the cell.
You likely need to experiment with using the '.fire_event' method to fire the proper javascript event, or if that fails entirely making a direct call to execute the proper script
When doing this do not confuse the name of a script such as 'applymask' or somesuch with the javascript event which causes that script to be invoked.
The answers to this question How to find out which JavaScript events fired? include some good information on how to use firebug or the chrome developer tools to figure out what events are being fired when you interact with an object on the browser screen.
Update: instead of responding here to indicate if this answer was of any use the OP reposted their question here Masked Text Box issue and by digging around on the vendor's demo site (since that time he actually had posted some of the HTML when we asked for it) I was able to find a solution using watir-webdriver that worked for him.

Is there another way to fix Yesod's nicHtmlField?

I've been rewriting my (fairly simple) website using Yesod as a way to get familiar with the framework. Part of that involves serving some simple static (but formatted) content. To do that I decided to use the nicHtml field that is described in the Yesod book:
http://www.yesodweb.com/book/forms
It allows simple formatting and, as the book says, "thanks to the xss-sanitize package, all user input is validated and ensured to not have XSS attacks."
However, all is not well. Some formatting seems to work when you enter it into the field, but gets wiped out somewhere between entry and submission. In particular, the form uses css embedded in 'style' attributes to do things like center text, and it is these css based formatting elements that seem to get wiped out.
I used print statements to check that it wasn't my code which was somehow messing it up. Since it doesn't seem to be, I assume that xss-sanitize doesn't like any embedded css and removes it. Modifying Yesod.Form.Nic to remove the call to sanitizeBalance appears to fix the problem, so that would seem to be the cause.
Now, I can just leave it like that, since editing these static pages requires being a trusted user anyway (i.e. me at the moment), so I don't care too much about validating out nastiness. But it feels like what it is, a hack, so my question is - is there any other way around this? Or is there another package I don't know about that provides a non-broken HTML editor field for Yesod?
Will you file a bug on the Yesod issue tracker for this? I think we are going to have to allow basic css through the editor no matter which editor we use. In your case of a trusted user, right now you could find the NicEdit field type and create a similar type that won't get filtered at all. Perhaps we should create such a field.
We're actually looking at other possible rich text editors right now for use in the Yesod website, so most likely whatever we use there will end up with a module in yesod-form. Most recently Greg pointed out Aloha editor which on first glance looks pretty cool.

Accessing YUI RichTextEditor node

I'm inserting images to editor with id param. after that i'm trying to access it with Dom.get('id'), but it returns null.
I understand that it returns null because it works under parent window's scope. Is there any standard way to access it?
For specialized YUI-related questions, and especially if you don't get the answer you're looking for on StackOverflow, you may want to post to http://yuilibrary.com/forum -- the YUI devs and many YUI specialists spend time there, and that's typically the best place to get YUI-related help.

Resources