Tuesday, September 28, 2010

Gadgets - Lesson 1

What is a gadget?

Whats ia a gadget, here are definitions from wikipedia and igoogle (as of 28 Sep, 10).

wikipedia:
In the software industry, "gadget" refers to computer programs that provide services without needing an independent application to be launched for each one, but instead run in an environment that manages multiple gadgets. There are several implementations based on existing software development techniques, like JavaScript, form input, and various image formats. (wikipedia, 27,Sep 2010)

igoogle:
Gadgets are simple HTML and JavaScript applications that can be embedded in webpages and other apps (http://code.google.com/apis/gadgets/).

So as it says from above a gadget is an application which is simple, and allows to put HTML/javascript code, and can be embedded in multiple web applications and viewed by many.

In this post and few other posts following, I will be writing about different elements of gadgets. And here goes the first!!!

Let's start with basics
This is a basic Gadget. This shows the basic ingredients of a gadget - Module, Module Prefs, Content.
<?xml version="1.0" encoding="UTF-8" ?> 

   
  
     <![CDATA[ 
       Hello, world!
     ]]>
   

</xml>

Module
Denotes that it is a gadget. So you need to keep all your gadget source within tags.

ModulePrefs
Holds the information about the gadget. This can include title of the gadget, description, hight, title_url, author, author_email, screen_shot, thumbnail.

Content
Says to which content type gadget belongs to; it can be "html" or "url". Means this can hold the HTML code or a link to an external content. tag contains the real work of a gadget. It gives the programming logic and the HTML code for appearance.

Other than above we also have;
<?xml >
This line is to indicate the gadget code is of XML document type. The standard XML declaration we use for gadgets is <?xml version="1.0" encoding="UTF-8" ?>. Means it supports xml 1.0 specification and unicode encoding type of UTF-8.

<![CDATA[
Indicates the data within these tags should not be passed by the XML parser. Hence all you HTML\jvascript code related to the gadgets appearance and programming logic should go here.

Monday, September 13, 2010

Single Sign-On & Single Sign-Out - user experience

Single sign-on is "a session/user authentication process that permits a user to enter one name and password in order to access multiple applications. The process authenticates the user for all the applications they have been given rights to and eliminates further prompts when they switch applications during a particular session." - Definition from Whatis.com

In Single sign-out the user will be signed-out from all authenticated applications at a single sign-out


WSO2 Stratos demonstrates the SSO concept very well. This is how user SSO experience in WSO2 Stratos.

Firstly, you need to create a domain and register you tenant in Stratos. There'll be two follow up emails. One to confirm you email address and the other to give your account details.
Following up the mails you can login to you Startos Manager page, or you can simply sign-in using the given admin credentials.

The first page you see after sign-in from admin credentials is the Stratos Manager Home page. From here you can invoke various WSO2 products which appear as services.
With SSO enabled Stratos, you can access these services without having to re-login at each entrance point (at each point where it opens up a new service for you). It is because your username and password are already authenticated and you are permited to access these multiple applications.

Afterwards, Say you have opened sevaral services where you were automatically logged-in and while you were working on one service (e.g. Cloud Gadgets), another has gone on a session expriration. No issues :), When you accessing the page it will nicely validate you by itself and make the service availble in a refreshed session.

Now, if you signout from one of the software services by clicking the 'Sign-out' link, you will be automatically signed-out from all the accessed services. That's where you will notice that Single -sign-out is in place!!!

Wednesday, September 1, 2010

Creating a WSO2 artifact using Eclipse

As was shown in my previous article, we have a plugin which can be added to eclipse which will open you a development environment to create artefacts used in WSO2 products. Now lets see how we can create WSO2 product artefacts in this environment.

So to start off with, you need to have eclipse IDE, (preferably, eclipse-jee-galileo) and install WSO2 cApp following the steps in here.

After WSO2 cApp is installed and the IDE is restarted, do following;

1. Create a WSO2 project
Go to File > New > Project. This will open up the 'New Project' wizard.
You have two menu options for this:
  • You can either select 'Carbon Application Project' option that appear at the beginning of the list.
  • Or you can select 'WSO2' at the bottom, which will also give 'Carbon Application Project' when you expand it.

In the next step, give your project a name and 'finish' the wizard.

Now you'll have a project created (with the name you gave) in the 'Project Explore'. Expand the project folder and you'll find its initial content as shown below;
  • JRE System library - Jars from your java runtime
  • java-src -the place where you keep the java src files
  • Artifacts - you will have this empty when you start. Later when you create an artifact, it will appear inside this.
  • root-artifact.xml - Is the place which manages you project
  • Server Roles - Server roles that you can specify for each of your artefact.

2. Create an artifact
Double click on root-artifact.xml. Click on 'Create New Artifact' button. You will get a drop down menu, which will have all WSO2 artifacts that are supported up to now.

From the menu simply select the artifact you need to create.

I will explain how to create few ESB artefacts in my next posts.
Enhanced by Zemanta

Friday, July 16, 2010

How to install WSO2 cApp in eclipse

Am using eclipse-jee-galileo-linux-gtk.tar.gz for this. and a milestone release of WSO2 cApp plugin, which can be downloaded from here.

1. Firstly extract you eclipse distribution and launch it.

2. Then Go to Help menu and select "Install Software"


3. Click on the 'Add' button at the top corner of the 'Install' DBox to add the location where the software resides.




4. In the 'Add site' DBox, click on 'Archive' button and navigate to the location where you downloaded WSO2 cApp plugin (wso2-eclipse-ide-tools-1.0.0.M11.zip).

5. When the achive is added, all the software available in it will appear in the small text area below it.
Remember : You need to have "group items by category" checkbox unchecked.



4. Out of the above list, select "WSO2 Carbon Studio Feature" and press Next to proceed and move on until completion.

That's it. Now you have WSO2 cApp integrated to eclipse IDE.

Sunday, June 13, 2010

WSO2 Stratos, the first 100% open source cloud platform for enterprise applications

“At a time when IT developers can create a new application in one month, taking months to provision and deploy servers and systems no longer makes strategic or economic sense,” said Dr. Sanjiva Weerawarana, WSO2 founder and CEO.

Read on @ http://www.itpro.lk/node/6962

Wednesday, June 9, 2010

Testing Cloud Services

WSO2 Stratos is a comprehensive, powerful PaaS solution which, WSO2 released newly. It is based on revolutionary Carbon platform and is a self-serving, multi-tenant, elastic runtime for private and public cloud infrastructures.

In this new deployment, Stratos has enabled WSO2 products as services. With it whole WSO2 middle-ware platform is available in the cloud as services.

So how was these services tested. As Paul has mentioned in one of his blog posts (Cloud Native), there are a set of technical attributes that the team take account of, to work well in a cloud environment. Out of these, Mutlitanency and Self servicing abilities were tested with more emphasis in this alpha release.


Self Servicing
Self-service means creating and managing your own tenant in the Stratos application. With this one could register his own organization (tenant) and manage the services, users within it.

How you do this:

1. Access Stratos from https://cloud.wso2.com/ and you will have Stratos Manager who is the entry point to wso2 cloud services.
2. Register a tenant in Startos Manager by going through the registration process that is available there in main page. This is a very simple process where you are asked to give only the domain name, administrator's credentials and security captcha.

After a successful registration, you can sign-in to Stratos using the admin account which would be admin_name@domainname. For an example, if I have my domain as 'ranaweera.lk' and administrator as 'admin', I can sign-in as 'admin@ranaweera.lk'

So that's about registering. This initial user is called the tenant-admin. After registering the organization, the tenant-admin can;
 - create users within it,
 - create various roles and assign users to them,
 - enable\disable services.

Tenant-users can;
- login and access the enabled cloud services,
- deploy there own web services,
- deploy mashups,
- apply security, change policies, apply throttling, engage modules etc to these services.

Few illustrative cases on this are;




Managing users:
From Stratos Manager, if you access 'Users & Roles' option, it allows you to add new users and roles in addition to existing admin user and role. While adding roles you can select the set of permissions you need to assign to a certain role. A user can be assigned one or many roles and vice versa. This is similar to the user management functionality we already have in all WSO2 products.



These users who were added above, are called 'tenant users'. A tenant user can login to 'Stratos Manager' from https://cloud.wso2.com/.  The user credentials that the admin assigned at the time the user was created must be used here. After signing-in to Stratos Manager, he will see all the cloud services that the tenant-admin has enabled for the tenant.




He then can sign-in to the cloud services using the same credentials.


Theming:
The tenant admin also can update the theme of his tenant by going to 'Theme' menu. There are few default themes as well as a 'customize' option.

A theme  that is applied at the Cloud Manager level should be propagate to all the cloud services within that tenant.




Billing:

This feature lets the billing information for the tenant viewable by the admin role. This component is still in development stages, so there'll be more to be said under this in future..


All the above can be done without a third party involvement making it 'self serving'. It is for the tenant administrator to manage with his tenant users.




Multitanancy

Mutlitanancy within Stratos is the ability it provides multiple organizations to register ,  Stratos Manager and work simultaneously, within their own domain. Like in our real world scenarios here the details of one organization should be private and shared only within it.

Lets simulate a step by step procedure of creating this environment;

1. First create a tenant (tenant A) and add users to it.
2. Create another tenant (tenat B) and add user to it too.
The tenant admin and users of tenant A could only access\view\edit services within their tenant. The admin and tenant users in tenant B are totally blind about the existent of tenant A.

We can use this environment to run through scenarios such as below;

Multitanancy in mashups (js services):
If the Cloud Mashup Sever was enabled as a service and tenant admin sign-in to it. He can create a javascript service in it. Lets say our admin has created a service which scrapes updates from a site and sends emails to a set of recipients. This service should be available for other tenant users to view and use. They should be able to edit it depending on the permissions granted by the admin. This mashup should appear in the service list with the author's name.



Now if you sign-in to tenant-B. Neither the admin nor the users of tenant B can access or see the services created by tenant A users. Because the two domains are two seperate entities.
Of course there are a set of system samples which will be available for all users by default. These are deployed under 'system' user.


Multitanancy in task-scheduling:

If a user\admin from a tenant schedule a task, (This is available in Cloud Mashup Server, from Configure > Scheduled Tasks menu), it will be visible and operational only within the tenant which originated it.


Multitanancy in gadgets:

In the Cloud Gadget, it allows the users to add gadgets of their desire. It lets him design their own gadget environment by adding\editing\deleting new tabs, new gadgets in their environment. All these customization done by a user (may it be the tenant user or tenant admin) is strictly for that particular user's account.

And, also these settings are not shared among tenants!

Cloud Gadget also lets you a community feature which facilitates gadgets' rating and commenting. A comment or a rating submitted by one tenant user can be viewable by other tenant users. But they are not shared with another tenant.

There's also a feature which gives you an update on the number of users who are using a particular gadget at a given time. This count is based on the users who use the gadget within a given tenant. It is not shared among tenants.



Mutlitenancy in entitlement policies:
You can create entitlement policies by going to Cloud Identity. These policies that you create in your tenant will be used only within it. And yes, these xcml policies can be used among the could services you have within your tenant.

For an example you should be able to do what is said in here.


Multitenancy in keystores/relying parties:

Again, Cloud Identity lets you store your relying party certificates and keystores. Similar to other scenarios these also tenant specific and blind to other tenants.



Likewise there's more and more scenarios you get to exercise and of course 'apply' in real world using WSO2 Stratos, which has whole of WSO2 middleware platform available in a single environment as services. Instead of having several servers started separately, here you have all the servers available at once. You can intercommunicate with them much easily.

Thursday, March 4, 2010

Creating a MySQL database for WSO2 Carbon 3.x.x products

WSO2 Carbon products have an inbuilt H2 database. Additionally the Carbon framework allows you to switch to the databases such as Oracle, MSSQL,MySQL, Derby, DB2.

You can easily switch between these databases by;
- creating a database schema within the relevant RDBMS
- point the configuration scripts to that db
- copy the drivers
- start the server with -Dsetup
I will describe these steps in a separate post.

This post is about how you can manually configure the database. I will be using MySql in my illustration. And I will be using WSO2 Identity Server 3.0 -alpha releases for this.


Creating MySQL database for WSO2 Carbon
-----------------------------------------------------------------

1. Download a wso2 identity server 3.0 alpha release

2. Navigate to the location where you have the mysql script. i.e. CARBON_HOME/dbscripts

3. Open a command prompt from that location and login to mysql from cmd prompt
mysql -u root -p

4. Create a database. Create user and grant access
create database regdb;
GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin";

6. Run the mysql.sql script. This will configure the database.
use regdb;
source mysql.sql


7. Copy the database driver to CARBON_HOME\repository\components\lib. I used mysql-connector-java-5.1.7-bin.jar, which is the official JDBC driver for MySQL. It can be downloaded from here.



8. Configure usermanager and registry scripts, which reside in CARBON_HOME/repository/conf

registry.xml
<currentDBConfig>mysql-db</currentDBConfig>
        <dbConfig name="mysql-db">
            <url>jdbc:mysql://localhost:3306/regdb</url>
            <userName>regadmin</userName>
            <password>regadmin</password>
            <driverName>com.mysql.jdbc.Driver</driverName>
            <maxActive>80</maxActive>
            <maxWait>6000</maxWait>
            <minIdle>5</minIdle>
       </dbConfig>

user-mgt.xml
<Database>
         <URL>jdbc:mysql://localhost:3306/regdb</URL>
         <UserName>regadmin</UserName>
         <Password>regadmin</Password>
         <Dialect>mysql</Dialect>
         <Driver>com.mysql.jdbc.Driver</Driver>
    </Database>

Monday, February 15, 2010

Agile or waterfall?

Here's a short video which explains the difference between agile and waterfall models.

Monday, February 8, 2010

Accessing a datafile through Selenium RC

In our testing most of us require to call data from a data storage and execute our tests to confirm various validations work as expected, different conditions are met etc.

Below is a code snippet that I used in calling data used in a .txt file in validating a simple test in user name password based sign-in process. I was on Selenium RC/JUnit/Java platform in this.

public class SignIn extends SeleneseTestCase {

public void setUp() throws Exception {
   setUp("https://localhost:9443/carbon/", "*chrome");
}

   public void testSignInValdation() throws Exception {
       BufferedReader in = null;
       InputStreamReader inputStream = null;

       inputStream = new InputStreamReader(new FileInputStream("C:" + File.separator + "signin.txt"));
       in = new BufferedReader(inputStream);
       String line = null;

       while ((line = in.readLine()) != null) {
            System.out.println("password: " + line);
            selenium.open("/carbon/admin/login.jsp");
            selenium.waitForPageToLoad("30000");
            selenium.type("txtUserName", "yumani");
            selenium.type("txtPassword", line);
            selenium.click("//input[@value='Sign-in']");
            selenium.waitForPageToLoad("30000");
       }
   }
}

Thursday, February 4, 2010

Deploying WSO2 Carbon 2.0.x in IBM WebSphere Application Server 6.1

PLEASE NOTE: THIS FEATURE IS DISCOURAGED AND DEPRECATED IN LATEST CARBON PLATFORM (WSO2 CARBON 4.0.0).

I have converted one of the past blog posts into an article and its now published in WSO2 Oxygen Tank -Library.

Its titled as "Deploying WSO2 Carbon 2.0.x in IBM WebSphere Application Server 6.1". Is available here.

Tuesday, February 2, 2010

Cloud and open source meet to test Web apps

Start-up Sauce Labs receives funding to support open-source Selenium project on-premise and in the cloud.

Blog post by Dave Rosenberg on Software, Interrupted.
http://news.cnet.com/8301-13846_3-10437699-62.html

Tuesday, October 20, 2009

SOA Workshop in Santa Clara - Nov 3rd 2009




Who should attend this workshop?
Enterprise IT Architects
Software Developers


When?
November 3rd 2009 - 9:00 am to 5:00 pm
(Registration at 8:30 am) 


What is the cost?
$75 per person

Where?
Network Meeting Center at Techmart
5201 Great America Parkway
Santa Clara, California 95054



What will I learn?

 Everything you want to know on implementing real world SAO solutions!
 More details - http://wso2.com/events/2009-us-soa-workshop/

Featured

Selenium - Page Object Model and Action Methods

  How we change this code to PageObjectModel and action classes. 1 2 3 driver . findElement ( By . id ( "userEmail" )). sendKeys (...

Popular Posts