Package org.gatein.management.api.model

Examples of org.gatein.management.api.model.ModelReference


            {
               resolveLinks(mo.get(name), uriInfo);
            }
            break;
         case REFERENCE:
            ModelReference ref = value.asValue(ModelReference.class);
            PathAddress address = ref.getValue();
            ref.remove("_ref");
            LinkBuilder linkBuilder = new LinkBuilder(uriInfo.getBaseUriBuilder());
            linkBuilder.path(RestApplication.API_ENTRY_POINT).path(address.toString());
            ref.get("url").set(linkBuilder.build().getHref());
            break;
         case LIST:
            for (ModelValue mv : value.asValue(ModelList.class))
            {
               resolveLinks(mv, uriInfo);
View Full Code Here


            attr.set("key", key);
            attr.set("value", attributes.get(key));
        }

        // Pages
        ModelReference pagesRef = siteModel.get("pages", ModelReference.class);
        pagesRef.set(address.append("pages"));

        // Navigation
        ModelReference navigationRef = siteModel.get("navigation", ModelReference.class);
        navigationRef.set(address.append("navigation"));

        return siteModel;
    }
View Full Code Here

    }

    private ModelList populateModel(List<Site> sites, ModelList list, PathAddress address) {
        for (Site site : sites) {
            if (hasPermission(site.getAccessPermission())) {
                ModelReference siteRef = list.add().asValue(ModelReference.class);
                siteRef.set("name", site.getName());
                siteRef.set("type", site.getType().getName());
                siteRef.set(address.append(site.getName()));
            }
        }

        return list;
    }
View Full Code Here

                PathAddress childAddress = address.append(child.getName());
                if (scope > 0 || scope < 0) // Continue populating nodes in response
                {
                    populateNode(child, scope - 1, childModel.setEmptyObject(), childAddress);
                } else { // Populate node reference which can be followed
                    ModelReference nodeRef = childModel.set(childAddress);
                    nodeRef.set("name", child.getName());
                }
            }
        }

        return model;
View Full Code Here

                PathAddress childAddress = address.append(child.getName());
                if (scope > 0 || scope < 0) // Continue populating nodes in response
                {
                    populateNode(child, scope - 1, childModel.setEmptyObject(), childAddress);
                } else { // Populate node reference which can be followed
                    ModelReference nodeRef = childModel.set(childAddress);
                    nodeRef.set("name", child.getName());
                }
            }
        }
        // Page reference
        ModelReference pageRef = model.get("page").asValue(ModelReference.class);
        if (node.getPageId() != null) {
            PageId pageId = node.getPageId();
            pageRef.set("pageName", pageId.getPageName());
            pageRef.set("siteName", pageId.getSiteId().getName());
            pageRef.set("siteType", pageId.getSiteId().getType().getName());

            // Set the address for the ref
            PathAddress pageAddress = getPagesAddress(pageId.getSiteId()).append(pageId.getPageName());
            pageRef.set(pageAddress);
        }
    }
View Full Code Here

    }

    private ModelList populateModel(List<Page> pages, ModelList list, PathAddress address) {
        for (Page page : pages) {
            if (Utils.hasPermission(page.getAccessPermission())) {
                ModelReference pageRef = list.add().asValue(ModelReference.class);
                pageRef.set("name", page.getName());
                pageRef.set("siteType", page.getId().getSiteId().getType().name().toLowerCase());
                pageRef.set("siteName", page.getId().getSiteId().getName());
                pageRef.set(address.append(page.getName()));
            }
        }

        return list;
    }
View Full Code Here

TOP

Related Classes of org.gatein.management.api.model.ModelReference

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.