Sterling Map Editor : Conditional Null Value - ibm-sterling

I have a XML to XML map on IBM Sterling B2B Integrator map.
I am trying to set an empty tag on a conditional variable as follows:
empty($my_var[counter][1].#my_var);
The result is that on output the empty tag does not show up.
Expected result:
<my_var/>
Is there any way to achieve this?

The XML element should be declared as mandatory in the map.
The PCDATA property should not have Mandatory checked if it is not required, but the element level should be mandatory.
Note also this known problem:
http://www-01.ibm.com/support/docview.wss?uid=swg21701246

Related

Aria labelledby is not valid - 508 compliance

I'm receiving this error from the 508 compliance
The 'id' "authorizationsFiltersMember" specified for the WAI-ARIA property 'aria-labelledby' value is not valid
I've tried with authorizations filters member authorizations_filters_member and none of these works ?
How should I call it ?
All it is telling you is that you have either:
self referenced (i.e. <p id="authorizationsFiltersMember" aria-labelledby="authorizationsFiltersMember">) for example. Something can't be labelled by itself.
or that you have a typo in the element you are referencing (or you don't have an element with that ID at all).
or that the element you are referencing cannot be used as a label (i.e. if you gave it or it has a role that is an interactive element etc.)
Most likely is that you have a typo in the ID so try copy and pasting it again (ensure there are no spaces before and after it), it is a perfectly valid ID in terms of length and format.
As a side note: "authorizations filters member" would actually try and reference 3 elements with the IDs "authorizations", "filters" and "member" and combine them in that order to create the label for the element.

Adobe DTM to set query string in eVar and sProp

So normally I would use the s.getQueryParam(); to parse out my URLs for query strings that I've been using.
s.eVar8=s.getQueryParam('cid,pid,eid',':');
s.prop28=s.getQueryParam('Role');
But since DTM has that all built into it, how would you really define that? I know I can set a page load rule using the campaign variable, but what if I have multiple parameters separated by ":"
www.domain.com?cid=blah1:blah2:blah3&pid=blah4:blah5:blah6&eid=blah7:blah8:blah9
Is there something that I'm missing when using this approach? Should I be capture these values into a data element then passing the data element into a page load rule using an eVar or sProp?
For variables that only look for a single URL parameter:
Create a Data Element of Type URL Parameter. For Parameter Name, put e.g. "Role" (no quotes) for prop28. Alternatively, you can do the same thing below, for multiple.
For variables that look for multiple URL parameters:
Create a Data Element of Type Custom Script. Click the [Open Editor] button and in the code box, add the following:
var d=':',
p=['cid','pid','eid'],
v=[],c,l,q;
for (c=0,l=p.length;c<l;c++) {
q=_satellite.getQueryParamCaseInsensitive(p[c]);
if (q) v.push(q);
}
return v.join(d);
The d= and p= values are based on what you have for eVar8. This isn't 100% the same as AA's s.getQueryParam plugin but it's most of it; the parts you care about based on your posted code.
Reference the Data Element(s)
In the Adobe Analytics tool config, in the Global Variables section, you can add your prop(s) and eVar(s) there, using %data_element_name_here% syntax.

jsonapi.org correct way to use pagination using the page query string

In the documentation for jsonapi for pagination is says the following:
For example, a page-based strategy might use query parameters such as
page[number] and page[size]
How would I represent this in the query string? http://localhost:4200/people?page[number]=1&page[size]=25, I don't think using a map link structure is a valid query string. Only the page parameter is reserved according to the documentation.
I don't think using a map link structure is a valid query string.
You're right technically, and that's why the spec has the note that says:
Note: The example query parameters above use unencoded [ and ] characters simply for readability. In practice, these characters must be percent-encoded, per the requirements in RFC 3986.
So, page[size] is really page%5Bsize%5D which is a valid query parameter name.
Only the page parameter is reserved according to the documentation.
When the spec text says that only page is reserved, it actually means that any page[......] style query parameter is reserved. (I can tell you that for sure as one of the spec's editors.) But it should say so more explicitly, so I'll open an issue for it.

Encoding wildcarding, stemming, etc in simple search

We have a simple search interface which calls the search:search($query-text) function. Is there a syntax to include control for wildcarding, stemming and case sensitivity within the single text string that the function accepts? I haven't been able to find anything in the MarkLogic docs.
See the $options parameter and the <term> and <term-option> constraint at https://docs.marklogic.com/search:search . There is a guide at http://developer.marklogic.com/learn/2009-07-search-api-walkthrough
and some details http://developer.marklogic.com/learn/2009-07-search-api-walkthrough#ndbba3437f320a4a4
I don't know of any existing syntax for those options, aside from the built-in behavior of turning on wildcards when a term contains '*' or '?' and turning on case-sensitivity when the term contains capital letters.
You could develop a syntax. Implementing it might involve a custom parser along the lines of https://github.com/mblakele/xqysp then feeding the resulting cts:query into search:resolve.
Piggybacking on Eric Bloch's answer... you can always dynamically construct your node based on input in the user interface.
For example, I often do this in order to separate the facet selection portion of the query from the text search portion and put the facet selection query in the additional-query element in the options node.

spring form error tag: check for specific error (only display invalid if the not null is not present for example)

So I have a String I need to check for a valid format for which I used a pattern, and whether the entered value is valid according to some business rules for which I used a custom validator. Now the customer would prefer it if the error message associated with the latter is only shown if the former didn't occur. But as far as I know there is no way to make this distinction.
Or can anyone think of a way to do this?
The trick is: have two different constraints (annotations),
one for the pattern, that accept null,
and a second for not null.
By default the javax.validation.constraints.Pattern "validator" accept null.
Accepts String. null elements are considered valid.
(javax.validation.constraints.Pattern javadoc)
So what you need to do in the end is this:
#NotNull(message="{validation.notNull}")
#Pattern(pattern="123" message="{validation.notPattern}")
String myString;
Added:
(Comment)
Not really the desired behaviour since I want to reuse the bean object but the conditions aren't the same for each page. – Jack Nickels 5 mins ago
In this case you can use the so called groups (See JSR303 Bean Validation Spec, Chapter 4.1.2 groups -- there is also an example). Use the default Group for #Pattern and an other group for #NotNull. Now you can enable or disable the Validation rules according the groups you specify for validation.
validator.validate(myObject, Default.class);
validator.validate(myObject, MyGroup.class);
There is one problem left: in Spring 3.0 you can not Specify the Group you want to use for the automatic validation process. But in 3.1 you can, according to that Feature Request SPR-6373 (I have not tryed it, but I hope it works)

Resources