Tim | 18 May 2013 03:23

[MarkLogic Dev General] How can I extract the text within a PCDATA element in an XML document?

Give the following record, how can I extract the text from the comment?

 

<data error="1" num-seq="20">

<!-- Warning: Content model for data does not allow PCDATA in unnamed entity at line ___ char ___ of file:///___.xml-->

</data>

 

Thank you!

 

Tim Meagher

 

<div><div class="WordSection1"><div>
<p class="MsoNormal"><span>Give the following record, how can I extract the text from the comment?<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>&lt;data error="1" num-seq="20"&gt;<p></p></span></p>
<p class="MsoNormal"><span>&lt;!-- Warning: Content model for data does not allow PCDATA in unnamed entity at line ___ char ___ of file:///___.xml--&gt; <p></p></span></p>
<p class="MsoNormal"><span>&lt;/data&gt;<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Thank you!<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
<p class="MsoNormal"><span>Tim Meagher<p></p></span></p>
<p class="MsoNormal"><span><p>&nbsp;</p></span></p>
</div></div></div>
Danny Sinang | 17 May 2013 17:19
Picon

[MarkLogic Dev General] Computing ML uptime percentage

Hi,

Has anyone here written a script to compute an ML server or cluster's uptime percentage per month ?


Regards,
Danny


<div><div dir="ltr">Hi,<div><br></div>
<div>Has anyone here written a script to compute an ML server or cluster's uptime percentage per month ?</div>
<div><br></div>
<div><br></div>
<div>Regards,<br>Danny</div>

<div><br></div>
<div><br></div>
</div></div>
abhinav mishra | 17 May 2013 05:09
Picon

Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 48

Hi Danny,Brant

Got your point completly. I will use the same credentials to get the connection with xdbc server; if connection successful then its a valid user.:-)

Brent, actually i am creating a webservice framework for authentication,exception handling,logging by framework. This framework will be used my Java RestWs; whrere in which i am trying authenticate user and then allowing to process request. Java webservice will load in memory xml (generated inside webservice) to marklogic.:-):-)

Thank you very much for guiding me.

On May 17, 2013 3:07 AM, <general-request-ld4jwAGwUXTgXEvjvSGRgBvyUsyucf76@public.gmane.orgc.com> wrote:
Send General mailing list submissions to
        general <at> developer.marklogic.com

To subscribe or unsubscribe via the World Wide Web, visit
        http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

You can reach the person managing the list at
        general-owner-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. Re: General Digest, Vol 107, Issue 41 [XDMP:LOGIN(USER,
      PASS), not working when using through XDBC] (Danny Sokolsky)


----------------------------------------------------------------------

Message: 1
Date: Thu, 16 May 2013 21:36:54 +0000
From: Danny Sokolsky <Danny.Sokolsky-efBvD/aTHCF8UrSeD/g0lQ@public.gmane.org>
Subject: Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 41
        [XDMP:LOGIN(USER, PASS), not working when using through XDBC]
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Message-ID:
        <D4F697174C071D46B891B38BFC6EAFA6095824 <at> EXCHG10-BE01.marklogic.com>
Content-Type: text/plain; charset="us-ascii"

xdmp:login only works on app servers that allow application-level authentication, which means it works on HTTP servers, not an XDBC servers (it will always return false on an XDBC server).  Also, note that XDBC servers do not have app-level authentication.

So as Brent suggests, your Java code can grab the credentials from the user and then pass them in with your xcc request with the server set to do digest authentication.

-Danny

From: general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org [mailto:general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org] On Behalf Of Brent Hartwig
Sent: Thursday, May 16, 2013 6:57 AM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 41 [XDMP:LOGIN(USER, PASS), not working when using through XDBC]

It appears the same credentials are used for the XCC-XDBC connection and in the call to xdmp:login(), because "this." isn't in front of "userName" and "password" within getConnection().  That might clear things up for you.  What benefit are you after by using system credentials for the connection, versus using the user-provided credentials (and skipping the call to xdmp:login())?

-Brent

From: general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org<mailto:general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org> [mailto:general-bounces-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org] On Behalf Of abhinav mishra
Sent: Thursday, May 16, 2013 9:12 AM
To: general-ld4jwAGwUXRXKVOp+u0EsQ@public.gmane.orgrklogic.com<mailto:general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Subject: Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 41 [XDMP:LOGIN(USER, PASS), not working when using through XDBC]

Hi Brent,


Yes you are right, My XDBC app server has authentication scheme as "digest". XDBC app sever privilege section is also null (Also tried by mentioning "xdmp:login" as a value here) . Via XDBC i am always getting retrun as "false".
But via Queryconsole with authentication scheme as "application-level" i am getting "true". when i set authentication scheme as "digest" for QueryConsole then i am not able to execute xdmp:login. i have mentioned description below.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I have written an xquery file on file system module. i have following code inside .xqy file>>

//authHelper.xqy

declare variable $userName as xs:string * external;
declare variable $password as xs:string * external;


xdmp:log(fn:concat("UserName: ",$userName,"|Password: ",$password))
,
xdmp:login($userName,$password)

I have a java module where i receive the user name and password and i am sending that username and password to marklogic as:

//AuthHelper.java

        private static final String userName = ResourceReader.getProperty("mladminuser"); //Reading username from property file
        private static final String password= ResourceReader.getProperty("mladminpass");//Reading password from property file
        private static final String url= ResourceReader.getProperty("mlurl"); //Reading url "localhost:8006/toolkit" from property file

        //To get the connection from marklogic.
            public static Session getConnection(String userName, String password,
                        String url) {
                        URI uri;
                        Session session=null;
                        try {
                                    uri = new URI(prepareConnectionUrl(userName,password,url));
                                    ContentSource contentSource = ContentSourceFactory
                                                            .newContentSource(uri);
                                    session = contentSource.newSession();
                        } catch (URISyntaxException e) {
                                    e.printStackTrace();
                        } catch (XccConfigException e) {
                                    e.printStackTrace();
                        }
                        return session;
            }

      private static String prepareConnectionUrl(String userName,String password,String url){
               StringBuffer sb=new StringBuffer("xdbc://");
               sb.append(userName);
               sb.append(":");
               sb.append(password);
               sb.append(" <at> ");
               sb.append(url);
               return sb.toString();
            }

public static void main(String[] args){
// User name and password here is coming form outside some client, i have tajken here as hardcoded.
                String user= "abhinav";  //It will come from outside client
                String  pass="abhinav"; //It will come from outside client

                        authenticate(user,pass);
}

public static String authenticate(String user,String pass){
             try  {
                                    Session session = getConnection(user, password,url);// admin user and password to get connection
                                    ModuleInvoke req = session.newModuleInvoke("authHelper.xqy");
                                    req.setNewStringVariable("userName", user);
                                    req.setNewStringVariable("password", pass);
                                    ResultSequence rs = session.submitRequest(req);
                                    while (rs.hasNext()) {
                                                ResultItem rsItem = rs.next();
                                                XdmItem item = rsItem.getItem();
                                                System.out.println(item); //Should be true, but getting false.
                                    }
                        } catch (Exception e) {
                                    e.printStackTrace();
                        }

}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Executed the xdmp:login via QueryConsole:

When i am executing xdmp:login("abhinav","abhinav") in QueryConsole i am getting error as "[1.0-ml] XDMP-APPREQ: xdmp:login("abhinav", "abhinav") -- Application level authentication required"

When i set the QConsole with authentication scheme as "application-level" then xdmp:login("abhinav", "abhinav")  is returning true.


Please guide me. Thanks a ton in advance.

Regards,
Abhinav Kumar Mishra
</snip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20130516/335552f2/attachment.html

------------------------------

_______________________________________________
General mailing list
General-ld4jwAGwUXTgXEvjvSGRgA@public.gmane.orggic.com
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 107, Issue 48
****************************************
<div>
<p>Hi Danny,Brant</p>
<p>Got your point completly. I will use the same credentials to get the connection with xdbc server; if connection successful then its a valid user.:-)</p>
<p>Brent, actually i am creating a webservice framework for authentication,exception handling,logging by framework. This framework will be used my Java RestWs; whrere in which i am trying authenticate user and then allowing to process request. Java webservice will load in memory xml (generated inside webservice) to marklogic.:-):-)</p>

<p>Thank you very much for guiding me.</p>
<div class="gmail_quote">On May 17, 2013 3:07 AM,  &lt;<a href="mailto:general-request@...">general-request@...c.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote">
Send General mailing list submissions to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general@...">general <at> developer.marklogic.com</a><br><br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
or, via email, send a message with subject or body 'help' to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-request@...">general-request@...</a><br><br>
You can reach the person managing the list at<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-owner@...">general-owner@...</a><br><br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of General digest..."<br><br><br>
Today's Topics:<br><br>
&nbsp; &nbsp;1. Re: General Digest, Vol 107, Issue 41 [XDMP:LOGIN(USER,<br>
&nbsp; &nbsp; &nbsp; PASS), not working when using through XDBC] (Danny Sokolsky)<br><br><br>
----------------------------------------------------------------------<br><br>
Message: 1<br>
Date: Thu, 16 May 2013 21:36:54 +0000<br>
From: Danny Sokolsky &lt;<a href="mailto:Danny.Sokolsky@...">Danny.Sokolsky@...</a>&gt;<br>
Subject: Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 41<br>
&nbsp; &nbsp; &nbsp; &nbsp; [XDMP:LOGIN(USER, PASS), not working when using through XDBC]<br>
To: MarkLogic Developer Discussion &lt;<a href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br>
Message-ID:<br>
&nbsp; &nbsp; &nbsp; &nbsp; &lt;<a href="mailto:D4F697174C071D46B891B38BFC6EAFA6095824 <at> EXCHG10-BE01.marklogic.com">D4F697174C071D46B891B38BFC6EAFA6095824 <at> EXCHG10-BE01.marklogic.com</a>&gt;<br>
Content-Type: text/plain; charset="us-ascii"<br><br>
xdmp:login only works on app servers that allow application-level authentication, which means it works on HTTP servers, not an XDBC servers (it will always return false on an XDBC server). &nbsp;Also, note that XDBC servers do not have app-level authentication.<br><br>
So as Brent suggests, your Java code can grab the credentials from the user and then pass them in with your xcc request with the server set to do digest authentication.<br><br>
-Danny<br><br>
From: <a href="mailto:general-bounces@...">general-bounces@...</a> [mailto:<a href="mailto:general-bounces <at> developer.marklogic.com">general-bounces@...</a>] On Behalf Of Brent Hartwig<br>

Sent: Thursday, May 16, 2013 6:57 AM<br>
To: MarkLogic Developer Discussion<br>
Subject: Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 41 [XDMP:LOGIN(USER, PASS), not working when using through XDBC]<br><br>
It appears the same credentials are used for the XCC-XDBC connection and in the call to xdmp:login(), because "this." isn't in front of "userName" and "password" within getConnection(). &nbsp;That might clear things up for you. &nbsp;What benefit are you after by using system credentials for the connection, versus using the user-provided credentials (and skipping the call to xdmp:login())?<br><br>
-Brent<br><br>
From: <a href="mailto:general-bounces@...">general-bounces@...</a>&lt;mailto:<a href="mailto:general-bounces@...">general-bounces@...</a>&gt; [mailto:<a href="mailto:general-bounces@...">general-bounces@...</a>] On Behalf Of abhinav mishra<br>

Sent: Thursday, May 16, 2013 9:12 AM<br>
To: <a href="mailto:general@...">general@...rklogic.com</a>&lt;mailto:<a href="mailto:general@...">general@...</a>&gt;<br>
Subject: Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 41 [XDMP:LOGIN(USER, PASS), not working when using through XDBC]<br><br>
Hi Brent,<br><br><br>
Yes you are right, My XDBC app server has authentication scheme as "digest". XDBC app sever privilege section is also null (Also tried by mentioning "xdmp:login" as a value here) . Via XDBC i am always getting retrun as "false".<br>

But via Queryconsole with authentication scheme as "application-level" i am getting "true". when i set authentication scheme as "digest" for QueryConsole then i am not able to execute xdmp:login. i have mentioned description below.<br><br>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br>
I have written an xquery file on file system module. i have following code inside .xqy file&gt;&gt;<br><br>
//authHelper.xqy<br><br>
declare variable $userName as xs:string * external;<br>
declare variable $password as xs:string * external;<br><br><br>
xdmp:log(fn:concat("UserName: ",$userName,"|Password: ",$password))<br>
,<br>
xdmp:login($userName,$password)<br><br>
I have a java module where i receive the user name and password and i am sending that username and password to marklogic as:<br><br>
//AuthHelper.java<br><br>
&nbsp; &nbsp; &nbsp; &nbsp; private static final String userName = ResourceReader.getProperty("mladminuser"); //Reading username from property file<br>
&nbsp; &nbsp; &nbsp; &nbsp; private static final String password= ResourceReader.getProperty("mladminpass");//Reading password from property file<br>
&nbsp; &nbsp; &nbsp; &nbsp; private static final String url= ResourceReader.getProperty("mlurl"); //Reading url "localhost:8006/toolkit" from property file<br><br>
&nbsp; &nbsp; &nbsp; &nbsp; //To get the connection from marklogic.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public static Session getConnection(String userName, String password,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String url) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URI uri;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Session session=null;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uri = new URI(prepareConnectionUrl(userName,password,url));<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ContentSource contentSource = ContentSourceFactory<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .newContentSource(uri);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; session = contentSource.newSession();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (URISyntaxException e) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.printStackTrace();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (XccConfigException e) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.printStackTrace();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return session;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>
&nbsp; &nbsp; &nbsp; private static String prepareConnectionUrl(String userName,String password,String url){<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;StringBuffer sb=new StringBuffer("xdbc://");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.append(userName);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.append(":");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.append(password);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.append(" <at> ");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sb.append(url);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return sb.toString();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>
public static void main(String[] args){<br>
// User name and password here is coming form outside some client, i have tajken here as hardcoded.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String user= "abhinav"; &nbsp;//It will come from outside client<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String &nbsp;pass="abhinav"; //It will come from outside client<br><br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; authenticate(user,pass);<br>
}<br><br>
public static String authenticate(String user,String pass){<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try &nbsp;{<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Session session = getConnection(user, password,url);// admin user and password to get connection<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ModuleInvoke req = session.newModuleInvoke("authHelper.xqy");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req.setNewStringVariable("userName", user);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; req.setNewStringVariable("password", pass);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ResultSequence rs = session.submitRequest(req);<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (rs.hasNext()) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ResultItem rsItem = rs.next();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XdmItem item = rsItem.getItem();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println(item); //Should be true, but getting false.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } catch (Exception e) {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.printStackTrace();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>
}<br>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<br><br>
Executed the xdmp:login via QueryConsole:<br><br>
When i am executing xdmp:login("abhinav","abhinav") in QueryConsole i am getting error as "[1.0-ml] XDMP-APPREQ: xdmp:login("abhinav", "abhinav") -- Application level authentication required"<br><br>
When i set the QConsole with authentication scheme as "application-level" then xdmp:login("abhinav", "abhinav") &nbsp;is returning true.<br><br><br>
Please guide me. Thanks a ton in advance.<br><br>
Regards,<br>
Abhinav Kumar Mishra<br>
&lt;/snip&gt;<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://developer.marklogic.com/pipermail/general/attachments/20130516/335552f2/attachment.html" target="_blank">http://developer.marklogic.com/pipermail/general/attachments/20130516/335552f2/attachment.html</a><br><br>
------------------------------<br><br>
_______________________________________________<br>
General mailing list<br><a href="mailto:General@...">General@...gic.com</a><br><a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br><br>
End of General Digest, Vol 107, Issue 48<br>
****************************************<br>
</blockquote>
</div>
</div>
Jakob Fix | 17 May 2013 00:56
Picon
Gravatar

[MarkLogic Dev General] how can i check whether an appserver

Hello,

if I wanted to script the creation of an xdbc appserver and I don't really care about the port number to use (so let's say I use xdmp:random(65535) + 8003), how can I find out whether that port is already in use by an already existing server?

Basically I'm looking for a definition of the local:port-number-in-use($pn) below.

declare function local:get-port-number()
as xs:integer
{
   
let $pn := xdmp:random(65535 + 8003)
   
return
       
if (local:port-number-in-use($pn))
           
then local:get-port-number()
           
else $pn
};

cheers,
Jakob.
<div><div dir="ltr">Hello,<div><br></div>
<div>if I wanted to script the creation of an xdbc appserver and I don't really care about the port number to use (so let's say I use xdmp:random(65535) + 8003), how can I find out whether that port is already in use by an already existing server?</div>

<div><br></div>
<div>Basically I'm looking for a definition of the local:port-number-in-use($pn) below.</div>
<div>

<p class="">

</p>
<p class="">

</p>
<p class=""><span class="">declare function </span>local:get-port-number<span class="">()<br></span><span class="">as </span><span class="">xs:integer</span><span class=""><br>
{<br>
&nbsp; &nbsp; </span><span class="">let </span><span class="">$pn</span><span class=""> := </span>xdmp:random<span class="">(</span><span class="">65535</span><span class=""> + </span><span class="">8003</span><span class="">)<br>

&nbsp; &nbsp; </span><span class="">return </span><span class=""><br>
&nbsp; &nbsp; &nbsp; &nbsp; </span><span class="">if</span><span class=""> (</span>l<span>ocal:port-number-in-use</span><span><span class="">(</span><span class="">$pn</span></span><span class=""><span>)</span>) <br>

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="">then </span>local:get-port-number<span class="">()<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="">else </span><span class="">$pn</span><span class=""><br>
};<br></span></p>
<div>cheers,<br>Jakob.</div>
</div>
</div></div>
Prince Varshney | 16 May 2013 08:09
Favicon

[MarkLogic Dev General] Facing Issue with settingup MarkLogic 2 node cluster.

Hi,

As I am new to MarkLogic and I am having free developer license, am  
trying to create 2 Node Cluster for MarkLogic server. I have installed 
on one machine but when I am trying to add one more machine to my 
server. It is not working. I think as I am not having DNS on our CentOS 
machine. So it is not working coz it might be looking for for DNS but 
can we force it to take host name info from /etc/hosts file Please 
suggest what I need to do.

Thank in advance!!

-- 
Thanks and Regards,
Prince Varshney
Asst.Systems Engineer
Tata Consultancy Services
Pune
Cell:- +91 7350 909 606
Mailto: varshney.prince@...
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

sini narayanan | 16 May 2013 06:42
Picon

[MarkLogic Dev General] string-join output not as expected

Hi,

I have the following code

let $phonesymbol       := <SYMB>T</SYMB>
return
$phonesymbol

output : <SYMB>T</SYMB>

let $phonesymbol       := <SYMB>T</SYMB>
return
fn:string-join($phonesymbol || " " || "test")

output : T test

How do I modify this to get the output as "<SYMB>T</SYMB> text"

Thanks,
Sini
<div><div dir="ltr">
<div>Hi,</div>
<div><br></div>
<div>I have the following code</div>
<div><br></div>
<div>let $phonesymbol &nbsp; &nbsp; &nbsp; := &lt;SYMB&gt;T&lt;/SYMB&gt;</div>
<div>return</div>
<div>$phonesymbol</div>
<div><br></div>
<div>output : &lt;SYMB&gt;T&lt;/SYMB&gt;</div>
<div><br></div>
<div>let $phonesymbol &nbsp; &nbsp; &nbsp; := &lt;SYMB&gt;T&lt;/SYMB&gt;</div>
<div>return</div>
<div>fn:string-join($phonesymbol || " " || "test")</div>
<div><br></div>
<div>output : T test</div>
<div><br></div>
<div>How do I modify this to get the output as "&lt;SYMB&gt;T&lt;/SYMB&gt; text"</div>
<div><br></div>
<div>Thanks,</div>
<div>Sini</div>
</div></div>
sini narayanan | 15 May 2013 08:24
Picon

[MarkLogic Dev General] Attaching more than one forest to a DB in ML

Hi,

I have a DB created in ML. And have a Forest(F1) attached to the DB.
All the documents published from the source S1 is now in the DB.

A new source S2 will also be publishing documents into the same DB.
But I donot want these documents in the same forest.

I want a new forest (F2) to be created for the same DB and then publish documents into this forest,
so that in case I need to purge only the S2 documents, I can just delete the forest.

I have tried the above scenario. The DB already had 26002 documents. I created new Forest F2.
And then using xdmp:document-insert, I loaded a document into the DB specifying the new F2 ID.
The document got inserted and now the DB have 26003 documents.
After this I detached the forest F2 from the DB and performed an admin:forest-delete on F2.
After that when I explore, I have only 12953 docs. Why is that so? Am I doing something wrong here?

Thanks,
Sini
<div><div dir="ltr">
<div>Hi,</div>
<div><br></div>
<div>I have a DB created in ML. And have a Forest(F1) attached to the DB.</div>
<div>All the documents published from the source S1 is now in the DB.</div>
<div><br></div>
<div>A new source S2 will also be publishing documents into the same DB.</div>
<div>But I donot want these documents in the same forest.</div>
<div><br></div>
<div>I want a new forest (F2) to be created for the same DB and then publish documents into this forest,</div>
<div>so that in case I need to purge only the S2 documents, I can just delete the forest.</div>
<div><br></div>
<div>I have tried the above scenario. The DB already had 26002 documents. I created new Forest F2.</div>
<div>And then using xdmp:document-insert, I loaded a document into the DB specifying the new F2 ID.</div>
<div>The document got inserted and now the DB have 26003 documents.</div>
<div>After this I detached the forest F2 from the DB and performed an admin:forest-delete on F2.</div>
<div>After that when I explore, I have only 12953 docs. Why is that so? Am I doing something wrong here?</div>
<div><br></div>
<div>Thanks,</div>
<div>Sini</div>
</div></div>
Roy Chowdhury, Soumadri | 14 May 2013 15:04

[MarkLogic Dev General] Reindexing estimation

Hi,

I am upgrading from MarkLogic 5.x to 6, which contains ~2 terabytes data. I believe while upgrading, MarkLogic will reindex all the data. The database has ~17 range indexes defined. Can anyone help me how to estimate approximately the time MarkLogic will take to reindex all the data, without actually starting it and checking the estimation from 'Status' tab of database?

Regards,
Soumadri Roy


"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
<div>
<div dir="ltr">Hi,<div><br></div>
<div>I am upgrading from MarkLogic 5.x to 6, which contains ~2 terabytes data. I believe while upgrading, MarkLogic will reindex all the data. The database has ~17 range indexes defined. Can anyone help me how to estimate approximately the time MarkLogic will take to reindex all the data, without actually starting it and checking the estimation from 'Status' tab of database?</div>

<div><br></div>
<div>Regards,</div>
<div>Soumadri Roy</div>
</div>

<br><div><br></div>
<div><span>"This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."</span></div>
</div>
abhinav mishra | 14 May 2013 05:11
Picon

Re: [MarkLogic Dev General] General Digest, Vol 107, Issue 29

Hi,
I have a suggestion to write your own wrapper on top of recordloader.

I have faced the same issue once.
So i extended the record loader and written my own wrapper in java to handle all the exception message in my own try,catch block and for failed files i have created LoadFailureException class to take care of all files which failed to load during the loading process.
It helped me.

On May 13, 2013 11:57 PM, <general-request-ld4jwAGwUXTgXEvjvSGRgNi2O/JbrIOy@public.gmane.orgic.com> wrote:
Send General mailing list submissions to
        general <at> developer.marklogic.com

To subscribe or unsubscribe via the World Wide Web, visit
        http://developer.marklogic.com/mailman/listinfo/general
or, via email, send a message with subject or body 'help' to
        general-request-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

You can reach the person managing the list at
        general-owner-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of General digest..."


Today's Topics:

   1. Re: Recordloader (Michael Blakeley)


----------------------------------------------------------------------

Message: 1
Date: Mon, 13 May 2013 10:45:50 -0700
From: Michael Blakeley <mike <at> blakeley.com>
Subject: Re: [MarkLogic Dev General] Recordloader
To: MarkLogic Developer Discussion <general-ld4jwAGwUXTgXEvjvSGRgMKenhbt+owO@public.gmane.org>
Message-ID: <AFEBA87C-036C-40C4-B742-7259775DF5A0-dWgsRPgt/GtWk0Htik3J/w@public.gmane.org>
Content-Type: text/plain; charset=us-ascii

Grep the logs. Different errors will produce different messages. A common one is:

    WARNING: Error while processing [filename]

Another useful string to look for is "Exception".

-- Mike

On 13 May 2013, at 02:49 , Mohanraj Chozhan <Mohanraj_Chozhan-cj8gakGGFqhBDgjK7y7TUQ@public.gmane.org> wrote:

> I am using recordloader to load bulk data to ML database. I have a requirement wherein whenever a document fails to load to the database, document name should be returned. Could you please let me know how this can be achieved with recordloader.



------------------------------

_______________________________________________
General mailing list
General-ld4jwAGwUXTgXEvjvSGRgA@public.gmane.orggic.com
http://developer.marklogic.com/mailman/listinfo/general


End of General Digest, Vol 107, Issue 29
****************************************
<div>
<p>Hi,<br>
I have a suggestion to write your own wrapper on top of recordloader.</p>
<p>I have faced the same issue once.<br>
So i extended the record loader and written my own wrapper in java to handle all the exception message in my own try,catch block and for failed files i have created LoadFailureException class to take care of all files which failed to load during the loading process.<br>

It helped me.</p>
<div class="gmail_quote">On May 13, 2013 11:57 PM,  &lt;<a href="mailto:general-request@...">general-request@...ic.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote">
Send General mailing list submissions to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general@...">general <at> developer.marklogic.com</a><br><br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br>
or, via email, send a message with subject or body 'help' to<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-request@...">general-request@...</a><br><br>
You can reach the person managing the list at<br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="mailto:general-owner@...">general-owner@...</a><br><br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of General digest..."<br><br><br>
Today's Topics:<br><br>
&nbsp; &nbsp;1. Re: Recordloader (Michael Blakeley)<br><br><br>
----------------------------------------------------------------------<br><br>
Message: 1<br>
Date: Mon, 13 May 2013 10:45:50 -0700<br>
From: Michael Blakeley &lt;<a href="mailto:mike@...">mike <at> blakeley.com</a>&gt;<br>
Subject: Re: [MarkLogic Dev General] Recordloader<br>
To: MarkLogic Developer Discussion &lt;<a href="mailto:general <at> developer.marklogic.com">general@...</a>&gt;<br>
Message-ID: &lt;<a href="mailto:AFEBA87C-036C-40C4-B742-7259775DF5A0 <at> blakeley.com">AFEBA87C-036C-40C4-B742-7259775DF5A0@...</a>&gt;<br>
Content-Type: text/plain; charset=us-ascii<br><br>
Grep the logs. Different errors will produce different messages. A common one is:<br><br>
&nbsp; &nbsp; WARNING: Error while processing [filename]<br><br>
Another useful string to look for is "Exception".<br><br>
-- Mike<br><br>
On 13 May 2013, at 02:49 , Mohanraj Chozhan &lt;<a href="mailto:Mohanraj_Chozhan@...">Mohanraj_Chozhan@...</a>&gt; wrote:<br><br>
&gt; I am using recordloader to load bulk data to ML database. I have a requirement wherein whenever a document fails to load to the database, document name should be returned. Could you please let me know how this can be achieved with recordloader.<br><br><br><br>
------------------------------<br><br>
_______________________________________________<br>
General mailing list<br><a href="mailto:General@...">General@...gic.com</a><br><a href="http://developer.marklogic.com/mailman/listinfo/general" target="_blank">http://developer.marklogic.com/mailman/listinfo/general</a><br><br><br>
End of General Digest, Vol 107, Issue 29<br>
****************************************<br>
</blockquote>
</div>
</div>
Jakob Fix | 13 May 2013 14:19
Picon
Gravatar

[MarkLogic Dev General] ml install using different ports?

Hi, 

can I somehow specify different defaults ports (8000, 8001, 8002) during or after install? We already have another service running on 8000.

cheers,
Jakob.

PS: I guess if possible, this probably applies to all versions. Just to be precise, I'm looking to install EA1.
<div><div dir="ltr">Hi,&nbsp;<div><br></div>
<div>can I somehow specify different defaults ports (8000, 8001, 8002) during or after install? We already have another service running on 8000.</div>
<div>
<div><br></div>
<div>
<div>cheers,<br>

Jakob.</div>
<div><br></div>
<div>PS: I guess if possible, this probably applies to all versions. Just to be precise, I'm looking to install EA1.</div>
</div>
</div>
</div></div>
Mohanraj Chozhan | 13 May 2013 11:49
Favicon

[MarkLogic Dev General] Recordloader

Hi,

 

I am using recordloader to load bulk data to ML database. I have a requirement wherein whenever a document fails to load to the database, document name should be returned. Could you please let me know how this can be achieved with recordloader.

 

Regards,

Mohanraj

 

**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS***
<div>
<div class="WordSection1">
<p class="MsoNormal">Hi,<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">I am using recordloader to load bulk data to ML database. I have a requirement wherein whenever a document fails to load to the database, document name should be returned. Could you please let me know how this can be achieved with recordloader.<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal"><span>Regards,<p></p></span></p>
<p class="MsoNormal"><span>Mohanraj<p></p></span></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div>
<table><tr><td bgcolor="#ffffff">**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***</td></tr></table>
</div>

Gmane