Hi,

For the AppFactory we need to give a facility to upload an application icon
to the application creator. We suggested to store this application icon
in registry as a resource.
First we thought to do this just writing custom host object. But as ruchira
said we have new function with new jaggery version.

To update
        var carbon = require('carbon');
var registry = new carbon.registry.Registry(serverUrl, {
   username: getProperty(ADMIN_USERNAME),
   password: getProperty(ADMIN_PASSWORD)
});
var path = APPLICATIONS+"appicon/icon_"+ applicationKey ;
registry.put(path, {
   mediaType: 'image/jpg',
   content: file.getStream()
});


To read
        var carbon = require('carbon');
       var registry = new carbon.registry.Registry(serverUrl, {
          username: getProperty(ADMIN_USERNAME),
          password: getProperty(ADMIN_PASSWORD)
       });
       var path = APPLICATIONS+"appicon/icon_"+ applicationKey ;
       var res = registry.get(path);
        print(res)

Then redirecting one of url to this jag call , we can get the resource.

-- 

*Harsha Thirimanna*
Senior Software Engineer; WSO2, Inc.; http://wso2.com
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 71 5186770
blog: *http://www.mind4web.org/ <http://www.apache.org/>*
twitter: **http://twitter.com/ <http://twitter.com/afkham_azeez>**
harshathirimann
linked-in: **http: <http://lk.linkedin.com/in/afkhamazeez>**//
www.linkedin.com/pub/harsha-thirimanna/10/ab8/122*
*
*
*Lean . Enterprise . Middleware*
*
*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to