Sunday, December 11, 2011

Java SimpleDateFormatter string formats

SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows for formatting (date -> text), parsing (text -> date), and normalization.

Date and time formats are specified by date and time pattern strings. Within date and time pattern strings, unquoted letters from 'A' to 'Z' and from 'a' to 'z' are interpreted as pattern letters representing the components of a date or time string. Text can be quoted using single quotes (') to avoid interpretation. "''" represents a single quote. All other characters are not interpreted; they're simply copied into the output string during formatting or matched against the input string during parsing.

Saturday, December 3, 2011

Rest services guide for Drupal 7



You will need to download the latest version of SYPC and Mimeparse:
wget http://spyc.googlecode.com/svn/trunk/spyc.php -O  servers/rest_server/lib/spyc.php

Once downloaded you need to add spyc.php to the rest_server/lib folder which exists under
the location you have installed services in.

LogIn
POST http://<My drupal website>/<Path to endpoint>/user/login
Request Payload:

{

    "username": "<username>",
    "password": "<password>"

}



LogOut
POST http://<My drupal website>/<Path to endpoint>/user/logout
Request Payload:

{
    "username": "<username>",
    "password": "<password>"
}