Package org.apache.isis.viewer.scimpi.dispatcher.view.field

Examples of org.apache.isis.viewer.scimpi.dispatcher.view.field.LinkedObject


            request.appendAsHtmlEncoded(field.getName());
            request.appendHtml(":</span>");
           
            final boolean isNotParseable =
                !fields.get(i).getSpecification().containsFacet(ParseableFacet.class);
            LinkedObject linkedObject = null;
            if (isNotParseable) {
     //           linkedObject = new LinkedObject(field.isOneToManyAssociation() ? collectionLink : objectLink);
                linkedObject = new LinkedObject(objectLink);
            }
            addField(request, object, field, linkedObject, showIcons);
           
            if (field.isOneToManyAssociation()) {
                Collection collection = (Collection) field.get(object).getObject();
                if (collection.size() == 0) {
                    request.appendHtml("[empty]");
                } else {
                    // request.appendHtml(collection.size() + " elements");
                  
                    request.appendHtml("<ol>");
                   
                   for (Object element : collection) {
                       ObjectAdapter adapterFor = IsisContext.getPersistenceSession().getAdapterManager().getAdapterFor(element);
                       IsisContext.getPersistenceSession().resolveImmediately(adapterFor);

                       String id = request.getContext().mapObject(adapterFor, linkedObject.getScope(), Scope.INTERACTION);

                       request.appendHtml("<li class=\"element\">");
                       request.appendHtml("<a href=\"" + linkedObject.getForwardView() + "?" + linkedObject.getVariable() + "="
                               + id + request.getContext().encodedInteractionParameters() + "\">");
                       request.appendHtml(element.toString());
                       request.appendHtml("</a></li>");
                   }
                   request.appendHtml("</ol>");
View Full Code Here


    @Override
    public void process(final Request request, final ObjectAdapter object) {
        final String linkRowView = request.getOptionalProperty(LINK_VIEW);
        final String linkObjectName = request.getOptionalProperty(ELEMENT_NAME, RequestContext.RESULT);
        final String linkObjectScope = request.getOptionalProperty(SCOPE, Scope.INTERACTION.toString());
        LinkedObject linkedRow = null;
        if (linkRowView != null) {
            linkedRow = new LinkedObject(linkObjectName, linkObjectScope, request.getContext().fullUriPath(linkRowView));
        }
        final String bulletType = request.getOptionalProperty("type");
        write(request, object, linkedRow, bulletType);
    }
View Full Code Here

            if (linkAllView != null) {
                linkAllView = request.getContext().fullUriPath(linkAllView);
                for (int i = 0; i < linkFields.length; i++) {
                    final boolean isObject = fields.get(i).isOneToOneAssociation();
                    final boolean isNotParseable = !fields.get(i).getSpecification().containsFacet(ParseableFacet.class);
                    linkFields[i] = isObject && isNotParseable ? new LinkedObject(linkAllView) : null;
                }
            }

            if (title == null) {
                title = object.getSpecification().getSingularName();
View Full Code Here

                cls = " class=\"field " + (evenRowClass == null ? EVEN_ROW_CLASS : evenRowClass) + "\"";
            }
            request.appendHtml("<div " + cls + description + "><span class=\"label\">");
            request.appendAsHtmlEncoded(field.getName());
            request.appendHtml(labelDelimiter + "</span>");
            final LinkedObject linkedObject = linkFields[i];
            addField(request, object, field, linkedObject, showIcons);
            HelpLink.append(request, field.getDescription(), field.getHelp());
            request.appendHtml("</div>");
        }
        request.appendHtml("</div>");
View Full Code Here

            final List<ObjectAssociation> allFields,
            final boolean showIconByDefault) {
        final String linkRowView = request.getOptionalProperty(LINK_VIEW);
        final String linkObjectName = request.getOptionalProperty(ELEMENT_NAME, RequestContext.RESULT);
        final String linkObjectScope = request.getOptionalProperty(SCOPE, Scope.INTERACTION.toString());
        final LinkedObject linkRow = linkRowView == null ? null : new LinkedObject(linkObjectName, linkObjectScope, context.fullUriPath(linkRowView));
        final boolean includeHeader = request.isRequested(HEADER, true);
        final boolean includeFooter = request.isRequested(FOOTER, false);

        final boolean linkFields = request.isRequested("link-fields", true);
        final boolean showTitle = request.isRequested(SHOW_TITLE, false);
        final boolean showIcons = request.isRequested(SHOW_ICON, showIconByDefault);
        final boolean showSelectOption = request.isRequested(SHOW_SELECT, true);
        final boolean showEditOption = request.isRequested(SHOW_EDIT, true);
        final boolean showDeleteOption = request.isRequested(SHOW_DELETE, true);

        final String noColumnsString = request.getOptionalProperty("no-columns", "3");

        final LinkedFieldsBlock block = new LinkedFieldsBlock();
        request.setBlockContent(block);
        request.processUtilCloseTag();
        final List<ObjectAssociation> fields = block.includedFields(allFields);
        final LinkedObject[] linkedFields = block.linkedFields(fields);
        for (int i = 0; i < linkedFields.length; i++) {
            if (linkedFields[i] == null && linkFields && !fields.get(i).getSpecification().containsFacet(ParseableFacet.class)) {
                linkedFields[i] = new LinkedObject("_generic.shtml");
            }
            if (linkedFields[i] != null) {
                linkedFields[i].setForwardView(context.fullUriPath(linkedFields[i].getForwardView()));
            }
        }
View Full Code Here

            LinkedObject linkedObject) {
        final LinkedObject[] linkedFields = new LinkedObject[fields.size()];
        if (linkAllFields) {
            for (int i = 0; i < linkedFields.length; i++) {
                if (fields.get(i).isOneToOneAssociation()) {
                    linkedFields[i] = linkedObject == null ? new LinkedObject("_generic.shtml") : linkedObject; 
                }
            }
        }
       
        final String headers[] = new String[fields.size()];
View Full Code Here

    @Override
    public void process(final Request request, final ObjectAdapter object) {
        final String linkRowView = request.getOptionalProperty(LINK);
        final String linkObjectName = request.getOptionalProperty(ELEMENT_NAME, RequestContext.RESULT);
        final String linkObjectScope = request.getOptionalProperty(SCOPE, Scope.INTERACTION.toString());
        LinkedObject linkedRow = null;
        if (linkRowView != null) {
            linkedRow = new LinkedObject(linkObjectName, linkObjectScope, request.getContext().fullUriPath(linkRowView));
        }
        final String bulletType = request.getOptionalProperty("type");
        write(request, object, linkedRow, bulletType);
    }
View Full Code Here

            if (linkAllView != null) {
                linkAllView = request.getContext().fullUriPath(linkAllView);
                for (int i = 0; i < linkFields.length; i++) {
                    final boolean isObject = fields.get(i).isOneToOneAssociation();
                    final boolean isNotParseable = !fields.get(i).getSpecification().containsFacet(ParseableFacet.class);
                    linkFields[i] = isObject && isNotParseable ? new LinkedObject(linkAllView) : null;
                }
            }

            if (title == null) {
                title = object.getSpecification().getSingularName();
View Full Code Here

                cls = " class=\"field " + (evenRowClass == null ? EVEN_ROW_CLASS : evenRowClass) + "\"";
            }
            request.appendHtml("<div " + cls + description + "><span class=\"label\">");
            request.appendAsHtmlEncoded(field.getName());
            request.appendHtml(":</span>");
            final LinkedObject linkedObject = linkFields[i];
            addField(request, object, field, linkedObject, showIcons);
            HelpLink.append(request, field.getDescription(), field.getHelp());
            request.appendHtml("</div>");
        }
        request.appendHtml("</div>");
View Full Code Here

    private static TableContentWriter rowBuilder(final Request request, final RequestContext context, final String title, final String object, final String fieldName, final List<ObjectAssociation> allFields, final boolean showIconByDefault) {
        final String linkRowView = request.getOptionalProperty(LINK);
        final String linkObjectName = request.getOptionalProperty(ELEMENT_NAME, RequestContext.RESULT);
        final String linkObjectScope = request.getOptionalProperty(SCOPE, Scope.INTERACTION.toString());
        final LinkedObject linkRow = linkRowView == null ? null : new LinkedObject(linkObjectName, linkObjectScope, context.fullUriPath(linkRowView));
        final boolean includeHeader = request.isRequested(HEADER, true);
        final boolean includeFooter = request.isRequested(FOOTER, false);

        final boolean linkFields = request.isRequested("link-fields", true);
        final boolean showTitle = request.isRequested(SHOW_TITLE, false);
        final boolean showIcons = request.isRequested(SHOW_ICON, showIconByDefault);
        final boolean showSelectOption = request.isRequested(SHOW_SELECT, true);
        final boolean showEditOption = request.isRequested(SHOW_EDIT, true);
        final boolean showDeleteOption = request.isRequested(SHOW_DELETE, true);

        final String noColumnsString = request.getOptionalProperty("no-columns", "3");

        final LinkedFieldsBlock block = new LinkedFieldsBlock();
        request.setBlockContent(block);
        request.processUtilCloseTag();
        final List<ObjectAssociation> fields = block.includedFields(allFields);
        final LinkedObject[] linkedFields = block.linkedFields(fields);
        for (int i = 0; i < linkedFields.length; i++) {
            if (linkedFields[i] == null && linkFields && !fields.get(i).getSpecification().containsFacet(ParseableFacet.class)) {
                linkedFields[i] = new LinkedObject("_generic.shtml");
            }
            if (linkedFields[i] != null) {
                linkedFields[i].setForwardView(context.fullUriPath(linkedFields[i].getForwardView()));
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.scimpi.dispatcher.view.field.LinkedObject

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.