Package org.apache.isis.applib

Examples of org.apache.isis.applib.Identifier


        return str.length() < maxLength ? str : str.substring(0, maxLength - 3) + "...";
    }


    private static String determineActionId(final ObjectAction objectAction) {
        final Identifier identifier = objectAction.getIdentifier();
        if (identifier != null) {
            return identifier.toNameParmsIdentityString();
        }
        // fallback (used for action sets)
        return objectAction.getId();
    }
View Full Code Here


    }
   
    @Test
    public void defaultEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});

        final ActionInteractionEvent<Object> ev = new InteractionHelper(null).newActionInteractionEvent(
                ActionInteractionEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    }

    @Test
    public void actionInvokedEventDefaultEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});

        final ActionInteractionEvent<Object> ev = new InteractionHelper(null).newActionInteractionEvent(
                ActionInvokedEvent.Default.class, identifier, sdo, new Object[]{1, "bar"});
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    }

    @Test
    public void customEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.actionIdentifier(SomeDomainObject.class, "foo", new Class[]{int.class, String.class});
       
        final ActionInteractionEvent<SomeDomainObject> ev = new InteractionHelper(null).newActionInteractionEvent(
                SomeDomainObjectFooInvokedEvent.class, identifier, sdo, new Object[]{1, "bar"});
        assertThat((SomeDomainObject)ev.getSource(), is(sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    @Test
    public void defaultEventType() throws Exception {
       
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "someDateProperty");
        LocalDate oldValue = new LocalDate(2013,4,1);
        LocalDate newValue = new LocalDate(2013,5,2);
       
        final PropertyInteractionEvent<Object, Object> ev =
                new InteractionHelper(null).newPropertyInteractionEvent(PropertyInteractionEvent.Default.class, identifier, sdo, oldValue, newValue);
View Full Code Here

    @Test
    public void customEventType() throws Exception {

        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "someDateProperty");
        LocalDate oldValue = new LocalDate(2013,4,1);
        LocalDate newValue = new LocalDate(2013,5,2);
       
        final PropertyInteractionEvent<SomeDomainObject, LocalDate> ev =
                new InteractionHelper(null).newPropertyInteractionEvent(SomeDatePropertyChangedEvent.class, identifier, sdo, oldValue, newValue);
View Full Code Here

   
    @Test
    public void defaultEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        SomeReferencedObject other = new SomeReferencedObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");

        final CollectionInteractionEvent<Object, Object> ev = new InteractionHelper(null).newCollectionInteractionEvent(
                CollectionRemovedFromEvent.Default.class, AbstractInteractionEvent.Phase.EXECUTED, identifier, sdo, CollectionInteractionEvent.Of.REMOVE_FROM, other);
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    @Test
    public void collectionRemovedFromDefaultEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        SomeReferencedObject other = new SomeReferencedObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");

        final CollectionInteractionEvent<Object, Object> ev = new InteractionHelper(null).newCollectionInteractionEvent(
                CollectionRemovedFromEvent.Default.class, AbstractInteractionEvent.Phase.EXECUTED, identifier, sdo, CollectionInteractionEvent.Of.REMOVE_FROM, other);
        assertThat(ev.getSource(), is((Object)sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    @Test
    public void customEventType() throws Exception {
        SomeDomainObject sdo = new SomeDomainObject();
        SomeReferencedObject other = new SomeReferencedObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "references");

        final CollectionInteractionEvent<SomeDomainObject, SomeReferencedObject> ev = new InteractionHelper(null).newCollectionInteractionEvent(
                SomeDomainObjectCollectionRemovedFromEvent.class, AbstractInteractionEvent.Phase.EXECUTED, identifier, sdo, CollectionInteractionEvent.Of.REMOVE_FROM, other);
        assertThat(ev.getSource(), is(sdo));
        assertThat(ev.getIdentifier(), is(identifier));
View Full Code Here

    @Test
    public void defaultEventType() throws Exception {
       
        SomeDomainObject sdo = new SomeDomainObject();
        Identifier identifier = Identifier.propertyOrCollectionIdentifier(SomeDomainObject.class, "someDateProperty");
        LocalDate oldValue = new LocalDate(2013,4,1);
        LocalDate newValue = null;
       
        final PropertyInteractionEvent<Object, Object> ev =
                new InteractionHelper(null).newPropertyInteractionEvent(PropertyInteractionEvent.Default.class, identifier, sdo, oldValue, newValue);
View Full Code Here

TOP

Related Classes of org.apache.isis.applib.Identifier

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.