eXo Platform 3.0

- Prev
- Next

## Chapter 8. Google Gadget Operations

The Google Gadget file is the .xml file with the special MIME type "application/x-google-gadget". With the eXo IDE, you can create such files, edit with the Code or WYSIWYG Editor, preview in the Preview Tab, deploy/undeploy it on the server through the shindig-library, add deployed gadgets to some pages in the portal.

## Create Google Gadget

To create the Google Gadget within the eXo IDE, do one of the following ways:

- The first way: Click the New > Google Gadget on the Toolbar; or select File > New > Google Gadget on the top menu.

- The second way: Open the existed gadget from the local system by selecting File > Open Local File on the top menu.

- The third way: Upload the existed gadget directly to JCR by selecting File > Upload on the top menu.

For the second and third ways, do not forget to select the MIME type as "application/x-google-gadget".

Illustration 25. Google Gadget Operations

## Deploy/Undeploy Google Gadgets in the Portal

To deploy the Google Gadget in the portal, do as follows:

- Step 1: Save the file before deploying.

- Step 2: Open the file in the Content Panel.

- Step 3: Click the Deploy Gadget to Portal button on the Toolbar; or select Run > Deploy Gadget to Portal on the top menu.

The deploy request will be sent to the server, and if there are no errors, the message like the following will be displayed in the Output Tab:

    [INFO]/rest/private/ide/gadget/deploy?gadgetURL=http%3A%2F%2F192.168.0.130%3A8080%2Frest%2Fprivate%2
    Fjcr%2Frepository%2Fdev-monit%2FTest+Gadget+File.xml&privateContext=%2Frest%2Fprivate&publicContext=
    %2Frest deployed successfully.

It means that gadget was deployed to the portal with title set in the gadget's '<ModulePrefs title="Hello World" />', for example:

Illustration 26. Deploy Gadget

Otherwise, the error message will be displayed in the Output Tab.

To undeploy the Google Gadget, do as follows:

- Step 1: Find the service which was previously deployed in the Workspace and open this service in the Content Panel.

- Step 2: Click the Undeploy Gadget from Portal button on the Toolbar; or go to Run > Undeploy on the top menu, and verify if there is no error message in the Output Tab.

If the undeployment is successful, you will receive a message as below:

    [INFO]/rest/private/ide/gadget/undeploy?gadgetURL=http%3A%2F%2F192.168.0.130%3A8080%2Frest%2Fprivate
    %2Fjcr%2Frepository%2Fdev-monit%2FTest+Gadget+File.xml&privateContext=%2Frest%2Fprivate&publicContext=
    %2Frest undeployed successfully.

## Preview Google Gadget

To preview the Google Gadget, do as follows:

- Step 1: Open the gadget file which was previously save.

- Step 2: Click the Show Preview button on the Toolbar; or select Run > Show Preview on the top menu.

The gadget will be opened in the Gadget Container of the Preview Tab as figured in the Google Gadget Operations illustration above.

- Prev
- Up
- Home
- Next