Package org.gatein.mop.api.workspace

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


    }

    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


    @Override
    public void importData(ImportMode importMode) throws Exception {
        if (data == null || data.getPages() == null || data.getPages().isEmpty())
            return;

        Site site = siteProvider.getSite(siteKey);
        if (site == null)
            throw new Exception("Cannot import pages because site does not exist for " + siteKey);
        org.gatein.mop.api.workspace.Page pages = site.getRootPage().getChild("pages");
        int size = (pages == null) ? 0 : pages.getChildren().size();

        Page.PageSet dst = null;
        switch (importMode) {
            case CONSERVE:
View Full Code Here

            if (component instanceof UIContainer) {
                UIContainer srcContainer = (UIContainer) component;
                Attributes attrs = srcContainer.getAttributes();
                String type = attrs.getValue(MappedAttributes.TYPE);
                if ("dashboard".equals(type)) {
                    Site owner = src.getPage().getSite();
                    TransientApplicationState<Portlet> state = new TransientApplicationState<Portlet>(
                            "dashboard/DashboardPortlet", null, getOwnerType(owner.getObjectType()), owner.getName());

                    //
                    boolean showInfoBar = attrs.getValue(MappedAttributes.SHOW_INFO_BAR, false);
                    boolean showMode = attrs.getValue(MappedAttributes.SHOW_MODE, false);
                    boolean showWindowState = attrs.getValue(MappedAttributes.SHOW_WINDOW_STATE, false);
View Full Code Here

            //
            TransientApplicationState<S> transientState = (TransientApplicationState<S>) instanceState;

            // Attempt to get a site from the instance state
            Site site = null;
            if (transientState.getOwnerType() != null && transientState.getOwnerId() != null) {
                ObjectType<Site> siteType = parseSiteType(transientState.getOwnerType());
                site = session.getWorkspace().getSite(siteType, transientState.getOwnerId());
            }

            // The current site
            Site currentSite = dst.getPage().getSite();

            // If it is the same site than the current page
            // set null
            if (site == dst.getPage().getSite()) {
                site = null;
View Full Code Here

        }

        if (filter.hasPathTemplate("nav-uri")) {
            filtered.execute(operationContext, resultHandler, filter);
        } else {
            Site site = navigation.getSite();
            String navUri = operationContext.getAddress().resolvePathTemplate("nav-uri");
            SiteKey siteKey = getSiteKey(site);

            DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(
                    DescriptionService.class);
View Full Code Here

            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);
View Full Code Here

        if (siteName == null)
            throw new OperationException(operationName, "No site name specified.");

        SiteKey siteKey = getSiteKey(siteType, siteName);

        Site site = workspace.getSite(siteType, siteKey.getName());
        if (site == null)
            throw new ResourceNotFoundException("No site found for site " + siteKey);

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

        Link link = navigation.getLink();
        if (link instanceof PageLink) {
            PageLink pageLink = (PageLink) link;
            org.gatein.mop.api.workspace.Page target = pageLink.getPage();
            if (target != null) {
                Site site = target.getSite();
                pageRef = Utils.siteType(site.getObjectType()).key(site.getName()).page(target.getName());
            }
        }

        //
        Attributes attrs = navigation.getAttributes();
View Full Code Here

public class NavigationReadConfig extends AbstractNavigationOperationHandler {
    @Override
    protected void execute(OperationContext operationContext, ResultHandler resultHandler, Navigation defaultNavigation) {
        String navUri = operationContext.getAddress().resolvePathTemplate("nav-uri");

        Site site = defaultNavigation.getSite();
        SiteKey siteKey = getSiteKey(site);

        // TODO: If there's any benefit in creating our own node model to use with navigation service, lets do it

        DescriptionService descriptionService = operationContext.getRuntimeContext().getRuntimeComponent(
View Full Code Here

        //
        POMSession session = manager.getSession();
        ObjectType<Site> objectType = objectType(navigation.key.getType());
        Workspace workspace = session.getWorkspace();
        Site site = workspace.getSite(objectType, navigation.key.getName());

        //
        if (site == null) {
            throw new NavigationServiceException(NavigationError.NAVIGATION_NO_SITE);
        }

        //
        Navigation rootNode = site.getRootNavigation();

        //
        Navigation defaultNode = rootNode.getChild("default");
        if (defaultNode == null) {
            defaultNode = rootNode.addChild("default");
View Full Code Here

TOP

Related Classes of org.gatein.mop.api.workspace.Site

Copyright © 2018 www.massapicom. 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.