Package org.apache.isis.viewer.json.viewer

Examples of org.apache.isis.viewer.json.viewer.RepContext


    private RepContext context;
   
    @Test
    public void bothNonNull() throws Exception {
        context = new RepContext(null, "attribute");
        String relFor = context.relFor("relSuffix");
        assertThat(relFor, is("attribute.relSuffix"));
    }
View Full Code Here


        assertThat(relFor, is("attribute.relSuffix"));
    }

    @Test
    public void attributeNull() throws Exception {
        context = new RepContext(null, null);
        String relFor = context.relFor("relSuffix");
        assertThat(relFor, is("relSuffix"));
    }
View Full Code Here

        assertThat(relFor, is("relSuffix"));
    }

    @Test
    public void relSuffixNull() throws Exception {
        context = new RepContext(null, "attribute");
        String relFor = context.relFor(null);
        assertThat(relFor, is("attribute"));
    }
View Full Code Here

        assertThat(relFor, is("attribute"));
    }

    @Test
    public void bothNull() throws Exception {
        context = new RepContext(null, null);
        String relFor = context.relFor(null);
        assertThat(relFor, is(""));
    }
View Full Code Here

        super(repContext);
        this.objectAdapter = objectAdapter;
    }
   
    public Representation build() {
        RepContext repContext = this.repContext.underAttribute("_self");
        Representation selfLink = LinkRepBuilder.newBuilder(repContext, "link", url()).build();
        Representation selfType = LinkRepBuilder.newTypeBuilder(repContext, "type", objectAdapter.getSpecification()).build();
        String title = objectAdapter.titleString();
        Representation iconLink = LinkRepBuilder.newBuilder(repContext, "icon", icon()).build();
        Representation self = new Representation();
View Full Code Here

        return asJson(serviceSelfRepresentations());
    }

    protected List<Representation> serviceSelfRepresentations() {
        final List<ObjectAdapter> serviceAdapters = getPersistenceSession().getServices();
        RepContext representationContext = getResourceContext().repContext();
       
        Function<ObjectAdapter, Representation> objectSelfRepresentation =
            Functions.compose(
                DomainObjectRepBuilder.selfOf(),
                DomainObjectRepBuilder.fromAdapter(representationContext));
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.json.viewer.RepContext

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.