lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Decrem" <thegall...@gmail.com>
Subject gdata-server newbie installation/code question
Date Sun, 10 Sep 2006 15:56:08 GMT
I was able to create the war gdata-server file with simon's documentation.
The documentation now states I should create user accounts.  Does the
section below (authenticate an existing account) also need to be included
(in the section Create/update/delete an account) ?  Is the
yourAuthenticationstring the same as authToken in the code directly below
this?  Should I assume that GoogleLogin really means gdata-server login ?

Thanks

___
 Authenticate an existing account

Requiered jars:

   -

   gdata-client.jar

____

 /*
  * The protocol can either be http or https, depends on your server
configuration.
  * The name of the application is just a meta data field an can be ommited.
  */
  GoogleService service = new
GoogleService("feedId","yourapplicationname", "http",
"localdomain:port/gdata-server");
 /*
  * ServiceType should be configured in the gdata-config.xml
  * Username and password for the admin account are the default values
  * and should be changed
  */
  String authToken = service.getAuthToken("administrator","password",
null,null,"servicetype","yourapplicationname");

____

Create/update/delete an account

____

 String accountAdminEndpoint =
"http://www.yourdomain.com/gdata-server/admin/account";
  /*
   * XML Account format to send in the http request body
   */
  String account = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
  "<account>" +
    "<account-name>administrator</account-name>" +
    "<password>yourpassword</password>" +
    "<account-role>15</account-role>" +
    "<account-owner>" +
      "<name>your name</name>" +
      "<email-address>admin@apache.org</email-address>" +
      "<url>http://www.apache.org</url>" +
    "</account-owner>" +
    "</account>";

  RequestEntity feedReqeustEnt = new StringRequestEntity(account);
  /*
   * Put method to update the account
   */
  PutMethod httpMethod = new PutMethod(accountAdminEndpoint);
  /*
   * you need to authenticate before adding a new feed. Authentication
   * will return an authentication token.
   */
  httpMethod.addRequestHeader(new Header("Authorization",
  "GoogleLogin auth=yourAuthenticationstring"));
  httpMethod.setRequestEntity(feedReqeustEnt);

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message