Prototype Javascript validation in Magento forms

In this article, we are going to discuss about How to use the prototype javascript validation in Magento forms. Using Javascript validation in forms will improves the usability and efficiency of the website. It will leads to a better web 2.0 look and feel.

Javascript Validation in Magento

In Magento, they are using the form.js (js/varien/form.js) file to provide the abstract JavaScript functions for forms by default. To achieve this validation, form.js uses the Validation class which is part of the Prototype Javascript library. It works by checking form inputs for certain class names. Each class name tells the validator to perform certain checks on the value inside the input.

Custom Form Validation

Adding Javascript validation to your own forms is extremely simple. First, you need to create a Form (form.js) object to represent your form.

<script type="text/javascript">
//< ![CDATA[
  var myForm= new VarienForm('formId', true);
//]]>
</script>

The first parameter, in this case formId, is the ID of your form.

The second parameter defines whether or not the first input field in the form should steal the cursor focus. If set to true, the cursor will automatically be moved into the first input field and any user input will be entered into this field. You can disable this functionality by setting the second parameter to false.

Now that you have created a Javascript object to represent your form you need to add some validation rules to your form inputs.

<label for="name">Name *</label>
<input type="text" id="name" name="name" value="" class="required-entry"/>
<label for="email">Email Address *</label>
<input type="text" id="email" name="email" value="" class="required-entry validate-email"/>

Notice the classes 'required-entry' and 'validate-email'? These both tell the classes to apply certain validation rules on the input fields. If any of the validation checks fail, the form will not be submitted and the user will be alerted to the errors.

Magento Javascript Validation Classes

There are many more validation classes you can assign and I list them here as a reference. For more information on this please use Google, experiment with the code or contact me via my email or the contact form.

validate-select
Please select an option

required-entry
This is a required field

validate-number
Please enter a valid number in this field

validate-digits
Please use numbers only in this field. please avoid spaces or other characters such as dots or commas

validate-alpha
Please use letters only (a-z or A-Z) in this field.

validate-code
Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.

validate-alphanum
Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed

validate-street
Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field

validate-phoneStrict
Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890

validate-phoneLax
Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890

validate-fax
Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890

validate-date
Please enter a valid date

validate-email
Please enter a valid email address. For example johndoe@domain.com.

validate-emailSender
Please use only letters (a-z or A-Z), numbers (0-9) , underscore(_) or spaces in this field.

validate-password
Please enter 6 or more characters. Leading or trailing spaces will be ignored

validate-admin-password
Please enter 7 or more characters. Password should contain both numeric and alphabetic characters

validate-cpassword
Please make sure your passwords match

validate-url
Please enter a valid URL. http:// is required

validate-clean-url
Please enter a valid URL. For example http://www.example.com or www.example.com

validate-identifier
Please enter a valid Identifier. For example example-page, example-page.html or anotherlevel/example-page

validate-xml-identifier
Please enter a valid XML-identifier. For example something_1, block5, id-4

validate-ssn
Please enter a valid social security number. For example 123-45-6789

validate-zip
Please enter a valid zip code. For example 90602 or 90602-1234

validate-zip-international
Please enter a valid zip code

validate-date-au
Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006

validate-currency-dollar
Please enter a valid $ amount. For example $100.00

validate-one-required
Please select one of the above options.

validate-one-required-by-name
Please select one of the options.

validate-not-negative-number
Please enter a valid number in this field

validate-state
Please select State/Province

validate-new-password
Please enter 6 or more characters. Leading or trailing spaces will be ignored

validate-greater-than-zero
Please enter a number greater than 0 in this field

validate-zero-or-greater
Please enter a number 0 or greater in this field

validate-cc-number
Please enter a valid credit card number.

validate-cc-type
Credit card number doesn't match credit card type

validate-cc-type-select
Card type doesn't match credit card number

validate-cc-exp
Incorrect credit card expiration date

validate-cc-cvn
Please enter a valid credit card verification number.

validate-data
Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.

validate-css-length
Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%

validate-length
Maximum length exceeded

Create category navigation listings in Magento

In this article, we are going to discuss about How to create the Category navigation listings in Magento. This below code will display the categories and the current category's subcategory or categories and all sub-categories. The below code is working fine. I have recently stumbled on a much better, neater way to accomplish this. This method requires less database interaction and therefore should render faster on the front end.

Listing Categories in Magento 1.4.1.1 and Above

Before start, you need to make sure the block that you're working is of the type "catalog/navigation". If you're editing "catalog/navigation/left.phtml" then you should be okay.

This can be slow and often loads in more information than we need for a simple navigation menu. This version uses the Varien_Data_Tree class.

<div id="leftnav">
    <?php $helper = $this->helper('catalog/category') ?>
    <?php $categories = $this->getStoreCategories() ?>
    <?php if (count($categories) > 0): ?>
        <ul id="leftnav-tree" class="level0">
            <?php foreach($categories as $category): ?>
                <li class="level0<?php if ($this->isCategoryActive($category)): ?> active<?php endif; ?>">
                    <a href="<?php echo $helper->getCategoryUrl($category) ?>"><span><?php echo $this->escapeHtml($category->getName()) ?></span></a>
                    <?php if ($this->isCategoryActive($category)): ?>
                        <?php $subcategories = $category->getChildren() ?>
                        <?php if (count($subcategories) > 0): ?>
                            <ul id="leftnav-tree-<?php echo $category->getId() ?>" class="level1">
                                <?php foreach($subcategories as $subcategory): ?>
                                    <li class="level1<?php if ($this->isCategoryActive($subcategory)): ?> active<?php endif; ?>">
                                        <a href="<?php echo $helper->getCategoryUrl($subcategory) ?>"><?php echo $this->escapeHtml(trim($subcategory->getName(), '- ')) ?></a>
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                            <script type="text/javascript">decorateList('leftnav-tree-<?php echo $category->getId() ?>', 'recursive')</script>
                        <?php endif; ?>
                    <?php endif; ?>
                </li>
            <?php endforeach; ?>
        </ul>
        <script type="text/javascript">decorateList('leftnav-tree', 'recursive')</script>
    <?php endif; ?>
</div>

If you copy and paste the above code into "catalog/navigation/left.phtml", it should work straight away. It should list all categories and any first level subcategories of the current category. You can modify this code to display all sub-categories by removing the IF statement at line 9.

Drupal - Override Exposed Views Filters with hook_form_alter

In this article, we are going to discuss about How to override the Exposed views filters with hook_form_alter function. Override the exposed filters is easy and a good way of customizing what users can select. A common example I've found is when you want users to choose from a select list but views only provides you with a textfield.  Using hook_form_alter, you can easily change the #type attirbute of the exposed filter form.

However, one simple mistake can result in the HUGELY annoying, "Illegal choice detected. Please contact your administrator".

As I mentioned, if you are looking to override exposed filters, you can do so with:

hook_form_alter ($form, &$form_state, $form_id) {
//add some kind of if statment here to check the form_id otherwise you'll affect all your forms
if ($form['#id'] == 'views-exposed-form-[VIEW-NAME]-[WHICHEVER VIEW NUMBER]') {
        $form['EXPOSED FILTER FIELD'] = array(
            '#type' => 'select',
            '#default_value' => '',
            '#options' => array(
                "" => t("- Select -"), //be sure to add the t() function around the first value
                "1"  => "VALUE 1",
                "2"=> "VALUE 2",
            ),
        );
}

**additionally, you can use hook_form_FORM_ID_alter to specify the form you are altering, avoiding the initial if statment all together.

The common illegal choice detected error comes up if you don't add t() around your first option. This is because this value would be passed through views using the t() function.

As a result, Drupal checks all forms during rendering to make sure nothing modified without permission. If you don't use the t() function, Drupal will see your changes as unauthorized and potential hacking -- This is a good thing.

Hope this helps.

Roles and permission of User groups in Wordpress

In this article, we are going to discuss about the Roles and permission of User groups in wordpress. WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL, which runs on a web hosting service.


Features include a plug-in architecture and a template system. WordPress is used by more than 18.9% of the top 10 million websites as of August 2013. WordPress is the most popular blogging system in use on the Web, at more than 60 million websites. Wordpress having a set of User groups roles and permission. They are

  1. Super Admin – somebody with access to the site network administration features and all other features. See the Create a Network article.
  2. Administrator – somebody who has access to all the administration features within a single site.
  3. Editor – somebody who can publish and manage posts including the posts of other users.
  4. Author – somebody who can publish and manage their own posts.
  5. Contributor – somebody who can write and manage their own posts but cannot publish them.
  6. Subscriber – somebody who can only manage their profile.

Graphical User Roles and permission in WordPress:


Steps to develop a Web Installer for a Codeigniter Application

In this article, we are going to discuss about How to develop a web installer for a CodeIgniter (CI) application. When you installing a CMS on your server, usually you need to find a form for setting up your database settings, admin user credentials, SMTP details..etc. This option can be found on popular open source CMS by default. This article might help after you finish create your own custom web project and don't want to make confuse your client with manual install by editing php file.

This script will change some of default CodeIgniter (CI) setting, they are

  1. - index.php
  2. - application/config/config.php
  3. - application/config/database.php

Just make sure they are writable (I'm using windows, no permission needs to be changed)

Step 1 : Create MY_Install library (MY_Install.php)

Create a file named "MY_Install.php" on your codeigniter application library, I assume we have a default codeigniter database setting, so this script will check if database name are blank we can continue on installation, by redirecting the page to install folder.

<?php
class MY_Install {
    public function __construct() {
        $CI =& get_instance();
        $CI->load->database();
        if ($CI->db->database == "") {
            header('location:install/');
        } else {
            if (is_dir('install')) {
                echo '<i>Plese delete or rename <b>Install</b> folder</i>';
                exit;
            }
        }
    }
}

Step 2 : Include the library on autoload.php

$autoload['libraries'] = array('database', 'MY_Install');

Step 3 : Create an install folder


After an install folder is created, create an index file which consists of form script for database setting and php script for replacing the default codeigniter settings.

Form script

<?php
$error = 0;
if (isset($_POST['btn-install'])) {
    
    // validation
    if ($_POST['inputDBhost'] == '' || $_POST['inputDBusername'] == '' || 
            $_POST['inputDBname'] == '' ||
            $_POST['inputSiteurl'] == '' || $_POST['inputAppfolder'] == '' || 
            $_POST['inputSystemfolder'] == '' || 
            ($_POST['inputAppfolder'] == $_POST['inputSystemfolder'])) {
        $error = 1;
    } else {
        
        @$con = mysql_connect($_POST['inputDBhost'], $_POST['inputDBusername'], $_POST['inputDBpassword']);
        @$db_selected = mysql_select_db($_POST['inputDBname'], $con);

        if (!$con) {
            $error = 1;
        } else if (!$db_selected) {  
            $error = 1;
        } else {
            // setting site url
            $file_config = "../application/config/config.php";
            $content_config = file_get_contents($file_config);
            $content_config .= "\n\$config['base_url'] = '".$_POST['inputSiteurl']."';";
            file_put_contents($file_config, $content_config);

            // setting database
            $file_db = "../application/config/database.php";
            $content_db = file_get_contents($file_db);
            $content_db .= "\n\$db['default']['hostname'] = '".$_POST['inputDBhost']."';";
            $content_db .= "\n\$db['default']['username'] = '".$_POST['inputDBusername']."';";
            $content_db .= "\n\$db['default']['password'] = '".$_POST['inputDBpassword']."';";
            $content_db .= "\n\$db['default']['database'] = '".$_POST['inputDBname']."';";
            file_put_contents($file_db, $content_db);

            // setting folder name
            $file_index = "../index.php";
            $content_index = str_replace("\$system_path = 'system';", "\$system_path = '".$_POST['inputSystemfolder']."';", file_get_contents($file_index));
            file_put_contents($file_index, $content_index);
            $content_index = str_replace("\$application_folder = 'application';", "\$application_folder = '".$_POST['inputAppfolder']."';", file_get_contents($file_index));
            file_put_contents($file_index, $content_index);

            // rename app folder
            $index = str_replace('install', '', dirname(__FILE__));
            rename($index.'application', $index.$_POST['inputAppfolder']);
            rename($index.'system',      $index.$_POST['inputSystemfolder']);
            header('location:../');
        }
    }
}

?>

PHP Script

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="bootstrap.css"/>
</head>
<body>
<div class="container">
    <div class="row-fluid">
    <h4>Install Your Codeigniter App</h4>
    <form class="form-horizontal" action="" method="post" style="margin-top:30px;">

        <?php if ($error == 1): ?>
        <div class="alert alert-error" style="font-size:11px;">               
            <b>Opps error ... </b> please check: 
            <br/> - <i>Each fields cannot be blank</i>
            <br/> - <i>App Folder and System Folder cannot the same</i>
            <br/> - <i>Database name must exist on your MySQL</i>
        </div>
        <?php endif; ?>
        <legend>Database Settings</legend>
        <div class="control-group">
            <label class="control-label">DB Host</label>
            <div class="controls">
                <input type="text" name="inputDBhost">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">DB Name</label>
            <div class="controls">
                <input type="text" name="inputDBname">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">DB Username</label>
            <div class="controls">
                <input type="text" name="inputDBusername">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">DB Password</label>
            <div class="controls">
                <input type="password" name="inputDBpassword">
            </div>
        </div>

        <legend>App Settings</legend>
        <div class="control-group">
            <label class="control-label">Site URL</label>
            <div class="controls">
                <input type="text" name="inputSiteurl">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">App Folder</label>
            <div class="controls">
                <input type="text" name="inputAppfolder">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">System Folder</label>
            <div class="controls">
                <input type="text" name="inputSystemfolder">
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <input type="reset" class="btn" name="btn" value="Reset"/>
                <input type="submit" class="btn btn-primary" name="btn-install" value="Install"/>
            </div>
        </div>
    </form>
    </div>
</div>
</body>
</html>

That's all after the installation finish it will redirect to index page again and ask you to rename or remove install folder, you can add more validation by yourself or even other settings for common web application, below are the example screenshot.

Step to add Two "add to cart" buttons with different redirect actions in Magento

In this article, we are going to discuss about How to add two add to cart buttons with different redirect options at once in Magento. If we want to add two types of "Add to cart" buttons. One for adds the product in the cart, but stays on the product description or product list page, and another one to add the product in the cart and redirects to the "My Cart" page.

Magento has the possibility to set from admin, how to react if a product is added in the cart. There is a setting in the administration interface:

"After Adding a Product Redirect to Shopping Cart – Yes/No".


But the issue is, how can someone use two "Add to cart" buttons in the same time, with different actions (one to redirect to shopping cart, and one to stay on the product list or detail page) after the products has been added in the cart.

There is a solution, but for this, the Checkout-CartController has to be overridden.

Step 1 : Create your module folders and files

  1. Magento/app/code/local/MyNameSpace/MyCheckout/etc/config.xml
  2. Magento/app/code/local/MyNameSpace/MyCheckout/controllers/CartController.php
  3. Magento/app/etc/modules/MyNameSpace_MyCheckout.xml


Step 2 : Edit /etc/config.xml

Go to Magento/app/code/local/MyNameSpace/MyCheckout/etc/config.xml and paste the following xml into it:

<?xml version="1.0"?>
<config>
    <modules>
        <MyNameSpace_Mycheckout>
            <version>0.1.0</version>
        </MyNameSpace_Mycheckout>
    </modules>
    <frontend>
        <routers>
            <MyNameSpace_Mycheckout>
                <use>standard</use>
                <args>
                    <module>MyNameSpace_Mycheckout</module>
                    <frontName>mycheckout</frontName>
                </args>
            </MyNameSpace_Mycheckout>
        </routers>
    </frontend>
    <global>
        <routers>
            <checkout>
                <rewrite>
                    <cart>
                        <to>mycheckout/cart</to>
                        <override_actions>true</override_actions>
                        <actions>
                            <add>
                                <to>mycheckout/cart/add</to>
                            </add>
                        </actions>
                    </cart>
                </rewrite>
            </checkout>
        </routers>
    </global>
</config>

Step 3 : Edit /controllers/CartController.php

Paste the following php code into Magento/app/code/local/MyNameSpace/MyCheckout/controllers/CartController.php

<?php
require_once 'Mage/Checkout/controllers/CartController.php';
class MyNameSpace_Mycheckout_CartController extends Mage_Checkout_CartController
{
    /**
     * Add product to shopping cart action
     */
    public function addAction()
    {
        $cart   = $this->_getCart();
        $params = $this->getRequest()->getParams();
        try {
            if (isset($params['qty'])) {
                $filter = new Zend_Filter_LocalizedToNormalized(
                    array('locale' => Mage::app()->getLocale()->getLocaleCode())
                );
                $params['qty'] = $filter->filter($params['qty']);
            }

            $product = $this->_initProduct();
            $related = $this->getRequest()->getParam('related_product');

            /**
             * Check product availability
             */
            if (!$product) {
                $this->_goBack();
                return;
            }

            $cart->addProduct($product, $params);
            if (!empty($related)) {
                $cart->addProductsByIds(explode(',', $related));
            }

            $cart->save();

            $this->_getSession()->setCartWasUpdated(true);

            /**
             * @todo remove wishlist observer processAddToCart
             */
            Mage::dispatchEvent('checkout_cart_add_product_complete',
                array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
            );

            if (!$this->_getSession()->getNoCartRedirect(true)) {
                if (!$cart->getQuote()->getHasError()){
                    $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));
                    $this->_getSession()->addSuccess($message);
                }
                if ($returnUrl = $this->getRequest()->getParam('return_url')) {
                    // clear layout messages in case of external url redirect
                    if ($this->_isUrlInternal($returnUrl)) {
                        $this->_getSession()->getMessages(true);
                    }
                    $this->getResponse()->setRedirect($returnUrl);
                } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart')
                    && !$this->getRequest()->getParam('in_cart')
                    && $backUrl = $this->_getRefererUrl()) {

                    $this->getResponse()->setRedirect($backUrl);
                } else {
                    if (($this->getRequest()->getActionName() == 'add') && !$this->getRequest()->getParam('in_cart')) {
                        $this->_getSession()->setContinueShoppingUrl($this->_getRefererUrl());
                    }

                    if($this->getRequest()->getParam('noCheckoutYet')=="yes")
                        $this->getResponse()->setRedirect($this->_getRefererUrl());
                    else
                        $this->_redirect('checkout/cart');
                }
            }
        }
        catch (Mage_Core_Exception $e) {
            if ($this->_getSession()->getUseNotice(true)) {
                $this->_getSession()->addNotice($e->getMessage());
            } else {
                $messages = array_unique(explode("\n", $e->getMessage()));
                foreach ($messages as $message) {
                    $this->_getSession()->addError($message);
                }
            }

            $url = $this->_getSession()->getRedirectUrl(true);
            if ($url) {
                $this->getResponse()->setRedirect($url);
            } else {
                $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());
            }
        }
        catch (Exception $e) {
            $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));
            $this->_goBack();
        }
    }
}

Step 4 : Edit Magento/app/etc/modules/MyNameSpace_MyCheckout.xml

<?xml version="1.0"?>
<config>
    <modules>
    <MyNameSpace_Mycheckout>
            <active>true</active>
            <codePool>local</codePool>
    </MyNameSpace_Mycheckout>
    </modules>
</config>

Step 5 : Edit Magento/app/design/frontend/[myinterface]/[mytheme]/layout/checkout.xml

Add th following lines to the xml:

<camelweb_mycheckout_cart_index>
    <update handle="checkout_cart_index"/>
</camelweb_mycheckout_cart_index>

Step 6 : Add the second "Add to cart" button from the template file

Edit Magento/app/design/frontend/[myinterface]/[mytheme]/template/catalog/product/view/addtocart.phtml

<?php $_product = $this->getProduct() ?>

<?php if($_product->isSaleable()): ?>
    <div class="add-to-cart">
        <?php if(!$_product->isGrouped()): ?>
        <label for="qty"><?php echo $this->__('Qty:') ?></label>
        <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
        <?php endif; ?>
        <button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="productAddToCartForm.submit()"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
        <br />
        <!--The second Add to cart link-->
        <a href="<?php echo Mage::getUrl('checkout/cart/add', array('product' => $_product->getId(), 'noCheckoutYet'=>'yes')) ?>">Add to cart 2</a>
        <?php echo $this->getChildHtml('', true, true) ?>
    </div>
<?php endif; ?>

Step 7 : Be sure, that in the Administration interface "After Adding a Product Redirect to Shopping Cart" is set to Yes

Please note, that the second link will add only one product at a time.

This solution has been tested on Magento ver. 1.4.1.1

Symfony2 - Translate the validation error messages

In this article, we are going to discuss about How to translate the validation Error messages in Symfony 2 framework. Translation is the communication of the meaning of a source-language text by means of an equivalent target-language text. Here, we are going to translate the validation error messages in Symfony 2 framework.

Here is the Example for the Model class "Car"

<?php
namespace  Phpcmsframework\Test Bundle\Entity;
use  Doctrine\ORM\Mapping as  ORM;
use  Symfony\Component\Validator\Constraints as  Assert;

/ **
 * Car Class - buzz buzz
 * @ ORM \ Entity (repositoryClass = "Phpcmsframework\Test Bundle\Entity\CarRepository")
 * @ ORM \ Table (name = "cars")
 * /
class  Car
{
    / **
     * @ ORM \ Id
     * @ ORM \ Column (type = "integer", name = "id")
     * @ ORM \ GeneratedValue (strategy = "AUTO")
     * /
    private  $ id ;

    / **
      * The serial number of the car
      * @ Assert \ NotBlank (message = "The name can not be left blank!")
      * @ Assert \ regex (pattern = "/ ^ ([A-Z0-9]) {1,} $ /", message = "Please use only capitalized letters and dashes")
      * @ ORM \ Column (type = "string", name = "serial", nullable = true)
      * @ Var string
      * /
    private  $ serial ;

    / * Getter and Setter Methods are hidden * /
}

If a new car is added by /cars/add, it is first check, whether the "serial" field is not empty, then if the serial number has only capital letters and dashes (eg: A-BZ-K55).

To view the error messages now fit into another language to translate, "{language}. Yml validators." Must be in the project folder for the translations. A new file will be created with ".Yml" is my preference here. Support XML or similar from Symfony2 formats can also be selected. The translations are (mostly) in the folder /src/Phpcmsframework/Test Bundle/Resources/translations.

In this example, the German translation would look like this:

#/src/Phpcmsframework/Test Bundle/Resources/translations/validators.de_DE.yml. 'Please use only letters capitalized and Dashes': 'Please use only capital letters and dashes'

Creating web services in wordpress using WPWS

In this article, we are going to discuss about How to create the web services in wordpress using WPWS (WordPress Web Service) plugin. By using this wordpress plugin, we can access the Wordpress resources via WSDL and SOAP. It allows you to connect WSDL enabled software like Adobe Flex / Flash Builder, Microsoft Visual Studio, PHP, J2EE, etc. to WordPress resources like posts and pages.

WPWS (WordPress Web Service) wordpress plugin gives you also the opportunity to program alternative (graphical) interfaces for your WordPress installation.

Furthermore alternative interpretations of WordPress resources are possible. For example you can interpret a post/page as a gallery; a datatype consisting of all included images with the corresponding attributes.

After installation simply open http://yoursite.com/blog/index.php/wpws to test your plugin. That is to add "/wpws" to the index.php part in your WordPress' url.

For more details : WordPress Web Service