Examples of XhtmlTemplate


Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specs() {
        init();

        final XhtmlTemplate xhtml = new XhtmlTemplate("Specifications", getServletRequest());

        xhtml.appendToBody(asDivIsisSession());
        xhtml.appendToBody(resourcesDiv());

        final Element div = xhtmlRenderer.div_p("Specifications", HtmlClass.SECTION);

        final Element ul = xhtmlRenderer.ul(HtmlClass.SPECIFICATIONS);
        final ArrayList<ObjectSpecification> allSpecs =
            Lists.newArrayList(getSpecificationLoader().allSpecifications());
        Collections.sort(allSpecs, ObjectSpecification.COMPARATOR_FULLY_QUALIFIED_CLASS_NAME);
        final List<ObjectSpecification> sorted = allSpecs;
        for (final ObjectSpecification spec : sorted) {
            final String specFullName = spec.getFullIdentifier();
            final String uri =
                MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
            ul.appendChild(xhtmlRenderer.li_a(uri, specFullName, "spec", "specs", HtmlClass.SPECIFICATION));
        }
        div.appendChild(ul);

        xhtml.appendToBody(div);

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    // /////////////////////////////////////////////////////////////////////

    @Override
    public String spec(final String specFullName) {
        init();
        final XhtmlTemplate xhtml = new XhtmlTemplate(specFullName, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        final ObjectSpecification noSpec = getSpecification(specFullName);

        xhtml.appendToBody(asDivTableFacets(noSpec, noSpec.getFullIdentifier()));

        final Element propertiesDivEl = asDivProperties(noSpec);
        xhtml.appendToBody(propertiesDivEl);

        final Element collectionsDivEl = asDivCollections(noSpec);
        xhtml.appendToBody(collectionsDivEl);

        for (final ActionType type : ACTION_TYPES) {
            final Element actionsDivEl = asDivActions(noSpec, type);
            xhtml.appendToBody(actionsDivEl);
        }

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specFacet(final String specFullName, final String facetTypeName) {
        init();

        final String specAndFacet = specFullName + "/facet/" + facetTypeName;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndFacet, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        final ObjectSpecification noSpec = getSpecification(specFullName);

        final String uri = MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        xhtml.appendToBody(xhtmlRenderer.aHref(uri, "owning spec", "spec", "facet", HtmlClass.SPECIFICATION));

        try {
            xhtml.appendToBody(divFacetElements(facetTypeName, noSpec));
        } catch (final IllegalArgumentException e) {
            throw new WebApplicationException(responseOfNotFound(e));
        } catch (final ClassNotFoundException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IntrospectionException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IllegalAccessException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final InvocationTargetException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        }

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specProperty(final String specFullName, final String propertyName) {
        init();

        final String specAndProperty = specFullName + "/property/" + propertyName;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndProperty, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        // owners
        final Element div = xhtmlRenderer.div_p("Owners", null);
        xhtml.appendToBody(div);
        final Element ul = xhtmlRenderer.ul(HtmlClass.SPECIFICATION);

        final String uri = MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        ul.appendChild(xhtmlRenderer.aHref(uri, "owning spec", "spec", "property", HtmlClass.SPECIFICATION));

        div.appendChild(ul);

        final ObjectSpecification noSpec = getSpecification(specFullName);
        final ObjectAssociation property = noSpec.getAssociation(propertyName);

        xhtml.appendToBody(asDivTableFacets(property, propertyName));

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specCollection(final String specFullName, final String collectionName) {
        init();

        final String specAndCollection = specFullName + "/collection/" + collectionName;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndCollection, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        // owners
        final Element div = xhtmlRenderer.div_p("Owners", null);
        xhtml.appendToBody(div);
        final Element ul = xhtmlRenderer.ul(HtmlClass.SPECIFICATION);

        final String uri = MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        ul.appendChild(xhtmlRenderer.aHref(uri, "owning spec", "spec", "collection", HtmlClass.SPECIFICATION));

        div.appendChild(ul);

        final ObjectSpecification noSpec = getSpecification(specFullName);
        final ObjectAssociation collection = noSpec.getAssociation(collectionName);

        xhtml.appendToBody(asDivTableFacets(collection, collectionName));

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

public class ServicesResourceImpl extends ResourceAbstract implements ServicesResource {

    @Override
    public String services() {
        init();
        final XhtmlTemplate xhtml = new XhtmlTemplate("Services", getServletRequest());

        xhtml.appendToBody(asDivIsisSession());
        xhtml.appendToBody(resourcesDiv());

        final Element div = xhtmlRenderer.div_p("Services", HtmlClass.SECTION);

        final Element ul = xhtmlRenderer.ul(HtmlClass.SERVICES);
        final List<ObjectAdapter> serviceAdapters = getPersistenceSession().getServices();
        for (final ObjectAdapter serviceAdapter : serviceAdapters) {
            final String uri =
                MessageFormat.format("{0}/object/{1}", getServletRequest().getContextPath(), getOidStr(serviceAdapter));
            ul.appendChild(xhtmlRenderer.li_a(uri, serviceAdapter.titleString(), "object", "services",
                HtmlClass.SERVICE));
        }
        div.appendChild(ul);

        xhtml.appendToBody(div);

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specAction(final String specFullName, final String actionId) {
        init();

        final String specAndAction = specFullName + "/action/" + actionId;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndAction, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        // owners
        final Element div = xhtmlRenderer.div_p("Owners", null);
        xhtml.appendToBody(div);
        final Element ul = xhtmlRenderer.ul(HtmlClass.SPECIFICATION);

        final String specUri =
            MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        ul.appendChild(xhtmlRenderer.li_a(specUri, specFullName, "owning spec", "spec", HtmlClass.SPECIFICATION));

        div.appendChild(ul);

        final ObjectSpecification noSpec = getSpecification(specFullName);
        final ObjectAction action = noSpec.getObjectAction(null, actionId);

        xhtml.appendToBody(asDivTableFacets(action, actionId));

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specPropertyFacet(final String specFullName, final String propertyName, final String facetTypeName) {
        init();

        final String specAndPropertyAndFacet = specFullName + "/property/" + propertyName + "/facet/" + facetTypeName;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndPropertyAndFacet, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        final ObjectSpecification noSpec = getSpecification(specFullName);
        final ObjectAssociation property = noSpec.getAssociation(propertyName);

        // owners
        final Element div = xhtmlRenderer.div_p("Owners", null);
        xhtml.appendToBody(div);
        final Element ul = xhtmlRenderer.ul(HtmlClass.PROPERTIES);

        final String specUri =
            MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        ul.appendChild(xhtmlRenderer.li_a(specUri, specFullName, "owning spec", "spec", "facet"));

        final String propertyUri =
            MessageFormat.format("{0}/specs/{1}/property/{2}", getServletRequest().getContextPath(), specFullName,
                propertyName);
        ul.appendChild(xhtmlRenderer.li_a(propertyUri, propertyName, "owning property", "property", "facet"));

        div.appendChild(ul);

        try {
            xhtml.appendToBody(divFacetElements(facetTypeName, property));
        } catch (final IllegalArgumentException e) {
            throw new WebApplicationException(responseOfNotFound(e));
        } catch (final ClassNotFoundException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IntrospectionException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IllegalAccessException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final InvocationTargetException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        }

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specCollectionFacet(final String specFullName, final String collectionId, final String facetTypeName) {
        init();

        final String specAndPropertyAndFacet = specFullName + "/collection/" + collectionId + "/facet/" + facetTypeName;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndPropertyAndFacet, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        final ObjectSpecification noSpec = getSpecification(specFullName);
        final ObjectAssociation collection = noSpec.getAssociation(collectionId);

        // owners
        final Element div = xhtmlRenderer.div_p("Owners", null);
        xhtml.appendToBody(div);
        final Element ul = xhtmlRenderer.ul(HtmlClass.PROPERTIES);

        final String specUri =
            MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        ul.appendChild(xhtmlRenderer.li_a(specUri, specFullName, "owning spec", "spec", "facet"));

        final String collectionUri =
            MessageFormat.format("{0}/specs/{1}/collection/{2}", getServletRequest().getContextPath(), specFullName,
                collectionId);
        ul.appendChild(xhtmlRenderer.li_a(collectionUri, collectionId, "owning collection", "collection", "facet"));
        div.appendChild(ul);

        try {
            xhtml.appendToBody(divFacetElements(facetTypeName, collection));
        } catch (final IllegalArgumentException e) {
            throw new WebApplicationException(responseOfNotFound(e));
        } catch (final ClassNotFoundException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IntrospectionException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IllegalAccessException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final InvocationTargetException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        }

        return xhtml.toXML();
    }
View Full Code Here

Examples of org.apache.isis.viewer.xhtml.viewer.html.XhtmlTemplate

    @Override
    public String specActionFacet(final String specFullName, final String actionId, final String facetTypeName) {
        init();

        final String specAndPropertyAndFacet = specFullName + "/action/" + actionId + "/facet/" + facetTypeName;
        final XhtmlTemplate xhtml = new XhtmlTemplate(specAndPropertyAndFacet, getServletRequest());
        xhtml.appendToBody(asDivIsisSession());

        final ObjectSpecification noSpec = getSpecification(specFullName);
        final ObjectAction action = noSpec.getObjectAction(null, actionId);

        // owners
        final Element div = xhtmlRenderer.div_p("Owners", null);
        xhtml.appendToBody(div);
        final Element ul = xhtmlRenderer.ul(HtmlClass.PROPERTIES);
        final String specUri =
            MessageFormat.format("{0}/specs/{1}", getServletRequest().getContextPath(), specFullName);
        ul.appendChild(xhtmlRenderer.li_a(specUri, specFullName, "owning spec", "spec", "facet"));
        final String actionUri =
            MessageFormat.format("{0}/specs/{1}/action/{2}", getServletRequest().getContextPath(), specFullName,
                actionId);
        ul.appendChild(xhtmlRenderer.li_a(actionUri, actionId, "owning action", "collection", "facet"));
        div.appendChild(ul);

        try {
            xhtml.appendToBody(divFacetElements(facetTypeName, action));
        } catch (final IllegalArgumentException e) {
            throw new WebApplicationException(responseOfNotFound(e));
        } catch (final ClassNotFoundException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IntrospectionException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final IllegalAccessException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        } catch (final InvocationTargetException e) {
            throw new WebApplicationException(responseOfInternalServerError(e));
        }

        return xhtml.toXML();
    }
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.