Examples of Site


Examples of org.gatein.mop.api.workspace.Site

        POMSession session = pomMgr.getSession();

        WorkspaceObject workspaceObject = session.findObjectById(workspaceObjectId);

        if (workspaceObject instanceof UIComponent) {
            Site site = ((UIComponent) workspaceObject).getPage().getSite();
            ObjectType<? extends Site> siteType = site.getObjectType();

            String[] siteInfo = new String[2];

            // Put the siteType on returned map
            if (siteType == ObjectType.PORTAL_SITE) {
                siteInfo[0] = PortalConfig.PORTAL_TYPE;
            } else if (siteType == ObjectType.GROUP_SITE) {
                siteInfo[0] = PortalConfig.GROUP_TYPE;
            } else if (siteType == ObjectType.USER_SITE) {
                siteInfo[0] = PortalConfig.USER_TYPE;
            }

            // Put the siteOwner on returned map
            siteInfo[1] = site.getName();

            return siteInfo;
        }

        throw new Exception("The provided ID is not associated with an application");
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

            return key;
        }

        public Void run(POMSession session) {
            Workspace workspace = session.getWorkspace();
            Site site = workspace.getSite(type, key.getId());
            if (site == null) {
                throw new NoSuchDataException("Could not remove non existing portal " + key.getId());
            } else {
                site.destroy();
            }
            return null;
        }
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

            return key;
        }

        public Void run(POMSession session) {
            Workspace workspace = session.getWorkspace();
            Site site = workspace.getSite(type, key.getId());
            if (site != null) {
                if (!overwrite) {
                    throw new IllegalArgumentException("Cannot create portal " + config.getName() + " that already exist");
                }
            } else {
                if (overwrite) {
                    throw new IllegalArgumentException("Cannot update portal " + config.getName() + " that does not exist");
                }

                //
                site = workspace.addSite(type, config.getName());
                Page root = site.getRootPage();
                root.addChild("pages");
                root.addChild("templates");
            }
            new Mapper(session).save(config, site);
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

      }

      public Void run(POMSession session) throws Exception
      {
         Workspace workspace = session.getWorkspace();
         Site site = workspace.getSite(siteType, ownerId);

         //
         Customization customization = null;
         if (site != null)
         {
            if (instanceName.startsWith("@"))
            {
               String id = instanceName.substring(1);
               UIWindow window = session.findObjectById(ObjectType.WINDOW, id);

               // Should check it's pointing to same instance though
               customization = window.getCustomization();
            }
            else
            {
               int pos = instanceName.indexOf("#");
               if (pos != -1)
               {
                  String a = instanceName.substring(0, pos);
                  String b = instanceName.substring(pos + 1);
                  Page page = site.getRootPage().getChild("pages").getChild(b);
                  Customization c = page.getCustomizationContext().getCustomization(a);
                  if (c != null)
                  {
                     c.destroy();
                  }
                  customization =
                     page.getCustomizationContext().customize(a, Portlet.CONTENT_TYPE, applicationName + "/" + portletName,
                        new PortletBuilder().build());
               }
               else
               {
                  Customization c = site.getCustomizationContext().getCustomization(instanceName);
                  if (c != null)
                  {
                     c.destroy();
                  }
                  customization =
                     site.getCustomizationContext().customize(instanceName, Portlet.CONTENT_TYPE, applicationName + "/" + portletName,
                        new PortletBuilder().build());
               }
            }
         }
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

      }

      public PortletPreferences run(POMSession session) throws Exception
      {
         Workspace workspace = session.getWorkspace();
         Site site = workspace.getSite(siteType, ownerId);
         if (site == null)
         {
            throw new IllegalArgumentException("Cannot load portlet preferences " + windowId
               + " as the corresponding portal " + ownerId + " with type " + siteType + " does not exist");
         }

         //
         if (instanceName != null)
         {
            Customization<Portlet> customization;
            if (instanceName.startsWith("@"))
            {
               String id = instanceName.substring(1);
               UIWindow window = session.findObjectById(ObjectType.WINDOW, id);
               customization = (Customization<Portlet>)window.getCustomization();
            }
            else
            {
               int pos = instanceName.indexOf('#');
               if (pos == -1)
               {
                  customization = (Customization<Portlet>)site.getCustomizationContext().getCustomization(instanceName);
               }
               else
               {
                  String a = instanceName.substring(0, pos);
                  String b = instanceName.substring(pos + 1);
                  Page page = site.getRootPage().getChild("pages").getChild(b);
                  customization = (Customization<Portlet>)page.getCustomizationContext().getCustomization(a);
               }
            }

            //
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

            {
               Iterator<? extends Site> iterator = portals.iterator();
               PortalKey[] result = new PortalKey[length];
               for (int i = 0; i < length; i++)
               {
                  Site site = iterator.next();
                  result[i] = new PortalKey("portal", site.getName());
               }
               return result;
            }

            public int getSize() throws Exception
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

      }

      public NavigationData run(POMSession session) throws Exception
      {
         Workspace workspace = session.getWorkspace();
         Site site = workspace.getSite(siteType, key.getId());
         if (site != null)
         {
            Navigation nav = site.getRootNavigation();
            Navigation defaultNav = nav.getChild("default");
            if (defaultNav != null)
            {
               return new Mapper(session).load(defaultNav);
            }
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

      }

      public Void run(POMSession session) throws Exception
      {
         Workspace workspace = session.getWorkspace();
         Site site = workspace.getSite(siteType, key.getId());
         if (site == null)
         {
            throw new IllegalArgumentException("Cannot insert page navigation "
               + " as the corresponding portal " + key.getId() + " with type " + siteType + " does not exist");
         }

         // Delete node descendants first
         Navigation nav = site.getRootNavigation();

         //
         Navigation defaultNav = nav.getChild("default");
         if (defaultNav == null)
         {
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

      }

      public Void run(POMSession session) throws Exception
      {
         Workspace workspace = session.getWorkspace();
         Site site = workspace.getSite(siteType, key.getId());
         if (site == null)
         {
            throw new IllegalArgumentException("Cannot insert page navigation "
               + " as the corresponding portal " + key.getId() + " with type " + siteType + " does not exist");
         }

         // Delete descendants
         Navigation nav = site.getRootNavigation();

         //
         Navigation defaultNav = nav.getChild("default");
         if (defaultNav != null)
         {
View Full Code Here

Examples of org.gatein.mop.api.workspace.Site

      }

      public Void run(POMSession session)
      {
         Workspace workspace = session.getWorkspace();
         Site site = workspace.getSite(type, key.getId());
         if (site == null)
         {
            throw new NoSuchDataException("Could not remove non existing portal " + key.getId());
         }
         else
         {
            site.destroy();
         }
         return null;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.