Examples of Navigation


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

            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)
         {
            defaultNav = nav.addChild("default");
         }
View Full Code Here

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

            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)
         {
            defaultNav.destroy();
         }

         //
         return null;
      }
View Full Code Here

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

        if (pages != null && !pages.getChildren().isEmpty()) {
            children.add("pages");
            pageOrNav = true;
        }

        Navigation defaultNav = site.getRootNavigation().getChild("default");
        if (defaultNav != null && !defaultNav.getChildren().isEmpty()) {
            children.add("navigation");
            pageOrNav = true;
        }

        if (pageOrNav) {
View Full Code Here

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

            boolean pageOrNav = false;
            Page pages = site.getRootPage().getChild("pages");
            if (pages != null && !pages.getChildren().isEmpty()) {
                pageOrNav = true;
            }
            Navigation defaultNav = site.getRootNavigation().getChild("default");
            if (defaultNav != null && !defaultNav.getChildren().isEmpty()) {
                pageOrNav = true;
            }

            // TODO: Until invalid site entries without a leading slash is corrected, this is needed to ignore them.
            if (siteType == ObjectType.GROUP_SITE) {
View Full Code Here

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

    final void removeNavigationData(POMSession session, SiteKey key) {
        removeNavigation(key);
    }

    protected final NodeData loadNode(POMSession session, String nodeId) {
        Navigation navigation = session.findObjectById(ObjectType.NAVIGATION, nodeId);
        if (navigation != null) {
            return new NodeData(navigation);
        } else {
            return null;
        }
View Full Code Here

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

    protected final NavigationData loadNavigation(POMSession session, SiteKey key) {
        Workspace workspace = session.getWorkspace();
        ObjectType<Site> objectType = objectType(key.getType());
        Site site = workspace.getSite(objectType, key.getName());
        if (site != null) {
            Navigation defaultNavigation = site.getRootNavigation().getChild("default");
            if (defaultNavigation != null) {
                return new NavigationData(key, defaultNavigation);
            } else {
                return NavigationData.EMPTY;
            }
View Full Code Here

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

*/
public abstract class AbstractNavigationOperationHandler extends AbstractSiteOperationHandler {
    @Override
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, Site site)
            throws ResourceNotFoundException, OperationException {
        Navigation navigation = site.getRootNavigation().getChild("default");
        if (navigation == null)
            throw new ResourceNotFoundException("Navigation does not exist for site " + getSiteKey(site));

        execute(operationContext, resultHandler, navigation);
    }
View Full Code Here

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

            toUpdate.add(target.handle);
        }

        @Override
        public void onDestroy(NodeContext<N> target, NodeContext<N> parent) {
            Navigation parentNav = session.findObjectById(ObjectType.NAVIGATION, parent.data.id);
            Navigation sourceNav = session.findObjectById(ObjectType.NAVIGATION, target.data.id);

            //
            toEvict.add(parentNav.getObjectId());
            sourceNav.destroy();

            //
            parent.data = new NodeData(parentNav);
            toUpdate.add(parent.handle);
View Full Code Here

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

            }
        }

        @Override
        public void onUpdate(NodeContext<N> source, NodeState state) throws NavigationServiceException {
            Navigation sourceNav = session.findObjectById(ObjectType.NAVIGATION, source.data.id);

            //
            toEvict.add(sourceNav.getObjectId());
            Workspace workspace = sourceNav.getSite().getWorkspace();
            PageKey reference = state.getPageRef();
            if (reference != null) {
                ObjectType<? extends Site> siteType = Utils.objectType(reference.getSite().getType());
                Site site = workspace.getSite(siteType, reference.getSite().getName());
                org.gatein.mop.api.workspace.Page target = site.getRootPage().getChild("pages").getChild(reference.getName());
                PageLink link = sourceNav.linkTo(ObjectType.PAGE_LINK);
                link.setPage(target);
            } else {
                PageLink link = sourceNav.linkTo(ObjectType.PAGE_LINK);
                link.setPage(null);
            }

            //
            Described described = sourceNav.adapt(Described.class);
            described.setName(state.getLabel());

            //
            Visible visible = sourceNav.adapt(Visible.class);
            visible.setVisibility(state.getVisibility());

            //
            visible.setStartPublicationDate(state.getStartPublicationDate());
            visible.setEndPublicationDate(state.getEndPublicationDate());

            //
            Attributes attrs = sourceNav.getAttributes();
            attrs.setValue(MappedAttributes.ICON, state.getIcon());

            //
            source.data = new NodeData(sourceNav);
            source.state = null;
View Full Code Here

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

        }

        @Override
        public void onMove(NodeContext<N> target, NodeContext<N> from, NodeContext<N> to, NodeContext<N> previous)
                throws NavigationServiceException {
            Navigation sourceNav = session.findObjectById(ObjectType.NAVIGATION, target.data.id);
            Navigation fromNav = session.findObjectById(ObjectType.NAVIGATION, from.data.id);
            Navigation toNav = session.findObjectById(ObjectType.NAVIGATION, to.data.id);

            //
            toEvict.add(sourceNav.getObjectId());
            toEvict.add(fromNav.getObjectId());
            toEvict.add(toNav.getObjectId());
            int index;
            if (previous != null) {
                Navigation previousNav = session.findObjectById(ObjectType.NAVIGATION, previous.data.id);
                index = previousNav.getIndex() + 1;
            } else {
                index = 0;
            }
            toNav.getChildren().add(index, sourceNav);
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.