5 Replies Latest reply on Feb 26, 2013 6:36 AM by Naidu Jakkana

    is there anyway to update the node properties using query manager ?

    Naidu Jakkana

      I have to update few properties of specific nodes.    I am able to get them using httpclient or sql query  .  I would like to know ,how to write back to repository with new values ?   using either JCR or query builder ?

       

      Any help apperciated.

       

       

      I am getting info using 1) httpclient : 

       

      DefaultHttpClient httpclient = new DefaultHttpClient();

              Credentials defaultcreds = new UsernamePasswordCredentials(this.getUsername(), this.getPassword());

             httpclient.getCredentialsProvider().setCredentials(AuthScope.ANY, defaultcreds);

              String request = this.host + "/bin/querybuilder.json";

                HttpPost httppost = new HttpPost(request);

              List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);

              nameValuePairs.add(new BasicNameValuePair("path", path));

              nameValuePairs.add(new BasicNameValuePair("type", "cq:Page"));

         httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

              ResponseHandler<String> responseHandler = new BasicResponseHandler();

          String responseBody = httpclient.execute(httppost, responseHandler);

       

      2) using sql query

      SELECT*  FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/path/to/node]) AND  s.[sling:resourceType]= CAST('some/thing/' AS STRING)