Removing gadgets

This recipe will guide you through the process of removing gadgets from the dashboard.

Getting ready

You need only to click on the X button of the window.

How to do it...

Here are the steps to follow for removing a gadget:

  1. If your gadget is in the dashboard, simply click on the X of the window as shown in the following screenshot:
    How to do it...
  2. It will then prompt you to confirm your choice. Click on the OK button as shown in the following screenshot:
    How to do it...
  3. If you want to completely delete the Gadget, simply go to the Application Registry of the gadget and click on the trash image of the chosen gadget on the left as shown in the following screenshot:
    How to do it...
  4. If you want to only delete the declaration, so that the gadget remains inside the repository, but cannot be called, go to the voice Category and click on the trash image of the chosen gadget on the left as shown in the following screenshot:
    How to do it...

If you remove a gadget imported on a user page, the user will see automatically this advice:

How to do it...

How it works...

When you click on the X button, an event listener of the UIDashboard container, the org.exoplatform.dashboard.webui.component.UIDashboardContainer .DeleteGadgetActionListener, is activated. It queries the JCR Repository and verifies if there is a child in the UIDashboardContainer; if yes it deletes it.

When the user enters the portal for the first time and goes to the dashboard page, a set of pages is created in this JCR path: portal-system/production/mop:workspace/mop:usersites/mop:root/mop:rootpage/mop:children/mop:pages/mop:children/mop:Tab_Default.

The mop:Tab_Default node represents the dashboard page. If you go inside mop:Tab_Default/mop:rootcomponent through webdav, (see R for webdav) you will note that a node named with UUID containing three other nodes is also named with the UUID. Those represent the three spaces of the dashboard page where the gadgets can be inserted.

One of these three spaces will contain the ID of the gadget inside the property mop:contentid of the mop:customization node. When you click on the X button, the information in the space will be removed.

Here are the properties of the mop:customization created while importing the YouTube gadget:

      ------------------------------------------------------
      jcr:primaryType - mop:workspaceclone
      ------------------------------------------------------
      jcr:uuid - 648e567dc0a8b21c00e159111e665b63
      ------------------------------------------------------
      mop:contentid - gadget-1270571586
      ------------------------------------------------------

Here is an example of a pre-installed gadget in the portal, for example the Calculator gadget:

      ------------------------------------------------------
      jcr:primaryType - mop:workspaceclone
      ------------------------------------------------------
      jcr:uuid - 5ccdfaeac0a8b21c2658e94580d1467d
      ------------------------------------------------------
      mop:contentid - Calculator
      ------------------------------------------------------
      mop:mimetype - application/gadget

Though it is different from the YouTube gadget, the mop:contentid is predefined because it is taken from the name field of gadget.xml:

   <gadget name="Calculator">
      <path>/gadgets/Calculator/Calculator.xml</path>
   </gadget> 

In the YouTube gadget, this value is auto generated. You will see how to create this file in the next recipe: Creating gadgets.

When you remove a gadget from the Application Registry, a delete event is sent to the org.exoplatform.applicationregistry.webui.component.UIGadgetManagement. RemoveGadgetActionListener. This listener works in two phases:

  • It searches for the gadget in the Gadget Registry Service and removes it.
  • It searches the associated Gadget Wrapper Portlet and deletes it. The Gadget Wrapper Portlet will be seen in the recipe Making the gadget a Portlet

See also

  • The Migrating a portlet that uses JCR recipe in Chapter 8, Migrating from Existing Portals
  • The Making the gadget a Portlet recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.206.25