Search in sources :

Example 11 with XulOverlay

use of org.pentaho.ui.xul.XulOverlay in project pentaho-platform by pentaho.

the class PluginManagerResource method getPluginPerpectives.

/**
 * Retrieve the list of plugin perspective in the platform
 *
 * @return list of <code> PluginPerspective </code>
 */
@GET
@Path("/perspectives")
@Produces({ APPLICATION_JSON })
@Facet(name = "Unsupported")
public ArrayList<PluginPerspective> getPluginPerpectives() {
    IPluginPerspectiveManager manager = // $NON-NLS-1$
    PentahoSystem.get(IPluginPerspectiveManager.class, PentahoSessionHolder.getSession());
    ArrayList<PluginPerspective> perspectives = new ArrayList<PluginPerspective>();
    for (IPluginPerspective perspective : manager.getPluginPerspectives()) {
        PluginPerspective pp = new PluginPerspective();
        pp.setId(perspective.getId());
        pp.setTitle(perspective.getTitle());
        pp.setContentUrl(perspective.getContentUrl());
        pp.setLayoutPriority(perspective.getLayoutPriority());
        pp.setRequiredSecurityActions(perspective.getRequiredSecurityActions());
        pp.setResourceBundleUri(perspective.getResourceBundleUri());
        if (perspective.getOverlays() != null) {
            ArrayList<Overlay> safeOverlays = new ArrayList<Overlay>();
            for (XulOverlay orig : perspective.getOverlays()) {
                Overlay tempOverlay = new Overlay(orig.getId(), orig.getOverlayUri(), orig.getSource(), orig.getResourceBundleUri(), orig.getPriority());
                safeOverlays.add(tempOverlay);
            }
            pp.setOverlays(safeOverlays);
        }
        perspectives.add(pp);
    }
    return perspectives;
}
Also used : XulOverlay(org.pentaho.ui.xul.XulOverlay) ArrayList(java.util.ArrayList) XulOverlay(org.pentaho.ui.xul.XulOverlay) IPluginPerspectiveManager(org.pentaho.platform.api.engine.perspective.IPluginPerspectiveManager) IPluginPerspective(org.pentaho.platform.api.engine.perspective.pojo.IPluginPerspective) IPluginPerspective(org.pentaho.platform.api.engine.perspective.pojo.IPluginPerspective) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) Facet(org.codehaus.enunciate.Facet)

Aggregations

XulOverlay (org.pentaho.ui.xul.XulOverlay)11 ArrayList (java.util.ArrayList)5 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 Facet (org.codehaus.enunciate.Facet)2 MantleXulOverlay (org.pentaho.mantle.client.objects.MantleXulOverlay)2 IPluginPerspective (org.pentaho.platform.api.engine.perspective.pojo.IPluginPerspective)2 XulException (org.pentaho.ui.xul.XulException)2 DefaultXulOverlay (org.pentaho.ui.xul.impl.DefaultXulOverlay)2 XulEventHandler (org.pentaho.ui.xul.impl.XulEventHandler)2 JsArray (com.google.gwt.core.client.JsArray)1 Request (com.google.gwt.http.client.Request)1 RequestBuilder (com.google.gwt.http.client.RequestBuilder)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 Frame (com.google.gwt.user.client.ui.Frame)1 MenuItem (com.google.gwt.user.client.ui.MenuItem)1 Widget (com.google.gwt.user.client.ui.Widget)1