HI.

If you are planning using appbuilder as the base of your project, may I
suggest that you build the base app in app builder and then use Roxy to
extract the sourcecode into a new project.  You then have the source
available to change as you wish and re-deploy as a new app.

However, going forward with MarkLogic 8, there is a great resource to get
you started with a MarkLogic app.  It's called samplestack - sample 3-tier
apps in node.js and java to use as reference frameworks to get you started.


Kind Regards,
David Ennis


David Ennis
*Content Engineer*

[image: HintTech]  <http://www.hinttech.com/>
Mastering the value of content
creative | technology | content

Delftechpark 37i
2628 XJ Delft
The Netherlands
T: +31 88 268 25 00
M: +31 63 091 72 80

[image: http://www.hinttech.com] <http://www.hinttech.com>
<https://twitter.com/HintTech>  <http://www.facebook.com/HintTech>
<http://www.linkedin.com/company/HintTech>

On 5 January 2015 at 22:57, Steiner, David J. (LNG-DAY) <
[email protected]> wrote:

>  OK, let me try this another way.
>
>
>
> Using XQuery, I can transform the search:response I get from search:search
> to transform the URNs to the English words I want.  If I can insert this
> code in the appropriate place in the appbuilder XQuery that actually does
> the search:search, then all of the existing javascript should work as is
> (i.e., the appropriate “value” will be populated in the TopicReference
> Object from the “search:response”).
>
>
>
> Can someone point me to where this would be within the appbuilder built
> app code?
>
>
>
> Thanks,
> David
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Steiner, David J.
> (LNG-DAY)
> *Sent:* Tuesday, December 16, 2014 10:21 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* [MarkLogic Dev General] trying to substitute value of facet in
> app builder app
>
>
>
> Sorry if the pictures don’t come through…
>
>
>
> The values that I have in an attribute are a facet that I want to display
> in the sidebar.  However, the values are urns and I would like to display
> the English words instead.  I can see in sidebar.js where these lists are
> being created.  Now, I do have more than one facet so I only want to do
> this for one of the facets, which complicates it a bit, but I’m not quite
> sure how to go back far enough in the javascript to figure out where I can
> do the substitution.  “valueEscaped” appears to be where I want to display
> the English words.  To go back from there, it would appear that all of this
> is in “facetData” which seems to come from “data”.   Though, I’m not
> particularly adept at javascript.
>
>
>
> Is there a way to create the “value” in the “data” before it gets this far
> – like something when the search gets all of the facet data that I can just
> substitute somehow so that by the time it gets to sidebar.js “value”
> already has the “correct” (English words) value in it?  Or is best to
> create some sort of big array here and just do the substitution here if the
> “constraint” is the particular constraint that I want this done for?
>
>
>
>
>
> sidebar.js
>
>
>
>   buildFacet = function (constraint, data) {
>
>         var html = '',
>
>             label,
>
>             facetData,
>
>             listDisplay,
>
>             listHidden,
>
>             listTipdown;
>
> …
>
> facetData = data.facets[constraint].facetValues;
>
> …
>
> if (facetData !== undefined) {
>
>                 html += '<ul class="'+listHidden+'">';
>
>                 var i, len;
>
>                 for (i=0,len=facetData.length; i < len; i = i + 1) {
>
>                                 // Handle any quotes in facet data
>
>                                 nameEscaped =
> facetData[i].name.toString().replace(/"/g, '&quot;');
>
>                                 valueEscaped =
> facetData[i].value.toString().replace(/"/g, '&quot;');
>
>                     // Do not display item if more... unclicked and item
> number over limit
>
>                     itemDisplay = (($.inArray(constraint, moreItems) ===
> -1) && (i > limit-1)) ? ' hidden' : '';
>
>                     html += '<li class="facet-item' + itemDisplay + '">'
>
>                          + '<a href="#" rel="'+nameEscaped+'"
> title="'+nameEscaped+'">' + truncateStr(valueEscaped, 32) + '</a> '
>
>                          + '<span class="count">(' + facetData[i].count +
> ')</span>'
>
>                          + '</li>';
>
>                 }
>
> …
>
> [image: cid:[email protected]]
>
>
>
> [image: cid:[email protected]]
>
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to