You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Arturo Ulises Castañeda Estrada <ar...@sisorg.com.mx> on 2016/02/19 19:50:20 UTC

instanceId

Hi Dan, I have a problem, when i insert data, I get return the resource and i get all JSON, I need the instanceId but for any reason the instanceId it's encrypted.


"instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"



Re: instanceId

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Closing off this old thread... I believe this was fixed in 1.12.x.



On 19 February 2016 at 20:16, Arturo Ulises Castañeda Estrada <
arturo.castaneda@sisorg.com.mx> wrote:

> This is my definition
>
> //region > cancellationTime (Property)
>     private DateTime cancellationTime;
>
>     @Property(
>         editing = Editing.DISABLED,
>         editingDisabledReason = "Cancellation time is automatically set
> when using actions"
>     )
>     @Column(allowsNull = "true")
>     @MemberOrder(name="Status",sequence = "8")
>     public DateTime getCancellationTime() {
>             return cancellationTime;
>     }
>     public void setCancellationTime(DateTime cancellationTime) {
>             this.cancellationTime = cancellationTime;
>     }
>     //endregion
>
>     //region > creationTime (Property)
>     private DateTime creationTime;
>
>     @Property(
>         editing = Editing.DISABLED,
>         editingDisabledReason = "Creation time is automatically set when
> using actions"
>     )
>     @Column(allowsNull = "false")
>     @MemberOrder(name="Status",sequence = "9")
>     @Persistent
>     public DateTime getCreationTime() {
>             return creationTime;
>     }
>     public void setCreationTime(DateTime creationTime) {
>             this.creationTime = creationTime;
>     }
>     //endregion
>
>     //region > shoppingCartItems (collection)
>     @Persistent(mappedBy = "shoppingCart", dependentElement = "false")
>     private SortedSet<ShoppingCartItem> shoppingCartItems = new
> TreeSet<ShoppingCartItem>();
>
>     @CollectionLayout(render = RenderType.EAGERLY)
>     @MemberOrder(sequence = "100")
>     public SortedSet<ShoppingCartItem> getShoppingCartItems() {
>         return shoppingCartItems;
>     }
>
>     public void setShoppingCartItems(final SortedSet<ShoppingCartItem>
> shoppingCartItems) {
>         this.shoppingCartItems = shoppingCartItems;
>     }
>     //endregion
>
>
>
> ________________________________________
> De: Dan Haywood <da...@haywood-associates.co.uk>
> Enviado: viernes, 19 de febrero de 2016 02:08 p. m.
> Para: users
> Asunto: Re: instanceId
>
> Hmm, presumably is the Shopping cart that has the instance Id that you
> quoted?
>
> Perhaps you could show us the definition on that class too?
>
> ---
> Unrelated to your original query, now that you should be able to inject
> your AytoNumberRepository. Just ensure that it is annotated with
> @DomainService and is in a package specified by your AppManifest.
> On 19 Feb 2016 19:08, "Arturo Ulises Castañeda Estrada" <
> arturo.castaneda@sisorg.com.mx> wrote:
>
> > As I understand the persist is after the return obj.
> >
> > @DomainService(repositoryFor = ShoppingCart.class,
> >         nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
> >
> > public class ShoppingCartRepository {
> >
> >     //region > newShoppingCart (action)
> >     public static class CreateDomainEvent extends
> > ActionDomainEvent<ShoppingCartRepository> {
> >         public CreateDomainEvent(final ShoppingCartRepository source,
> > final Identifier identifier, final Object... arguments) {
> >             super(source, identifier, arguments);
> >         }
> >     }
> >
> >     @Action(
> >             domainEvent = CreateDomainEvent.class
> >     )
> >     @MemberOrder(name="shoppingCarts",sequence = "1")
> >     public ShoppingCart newShoppingCart(
> >             //final @ParameterLayout(named="Shopping Cart Id") Long
> > shoppingCartId,
> >             final @ParameterLayout(named="Customer Subscription")
> > CustomerSubscription customerSubscription
> >     )
> >     {
> >         final ShoppingCart obj =
> > container.newTransientInstance(ShoppingCart.class);
> >
> >         //Obtener Folio
> >         autoNumberRepository = new AutoNumberRepository();
> >         autoNumberRepository.setContainer(container);
> >         Long shoppingCartId =
> > autoNumberRepository.nextAutoNumber("SHOPPING CART ID" , null);
> >         obj.setShoppingCartId(shoppingCartId);
> >         obj.setCustomerSubscription(customerSubscription);
> >         obj.setCreationTime(clockService.nowAsDateTime());
> >         obj.setStatus(ShoppingCartStatus.SHOPPING);
> >         container.persistIfNotAlready(obj);
> >         return obj;
> >     }
> >     //endregion
> > ________________________________________
> > De: Dan Haywood <da...@haywood-associates.co.uk>
> > Enviado: viernes, 19 de febrero de 2016 12:52 p. m.
> > Para: users
> > Asunto: Re: instanceId
> >
> > I suspect that's actually the instanceId of a domain object that's
> neither
> > a view model nor a persistent entity, ie is a "transient" entity (not yet
> > persisted to the DB).
> >
> > The RO viewer doesn't support such things (in fact, nor does the Wicket
> > viewer anymore; they are a legacy of an earlier time).  The fix, I
> expect,
> > will be to make sure the entity is a properly annotated view model.
> >
> > HTH
> > Dan
> >
> >
> >
> >
> > On 19 February 2016 at 18:50, Arturo Ulises Castañeda Estrada <
> > arturo.castaneda@sisorg.com.mx> wrote:
> >
> > > Hi Dan, I have a problem, when i insert data, I get return the resource
> > > and i get all JSON, I need the instanceId but for any reason the
> > instanceId
> > > it's encrypted.
> > >
> > >
> > > "instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"
> > >
> > >
> > >
>

Re: instanceId

Posted by Arturo Ulises Castañeda Estrada <ar...@sisorg.com.mx>.
This is my definition
    
//region > cancellationTime (Property)
    private DateTime cancellationTime;

    @Property(
        editing = Editing.DISABLED,
        editingDisabledReason = "Cancellation time is automatically set when using actions"
    )
    @Column(allowsNull = "true")
    @MemberOrder(name="Status",sequence = "8")
    public DateTime getCancellationTime() {
            return cancellationTime;
    }
    public void setCancellationTime(DateTime cancellationTime) {
            this.cancellationTime = cancellationTime;
    }
    //endregion

    //region > creationTime (Property)
    private DateTime creationTime;

    @Property(
        editing = Editing.DISABLED,
        editingDisabledReason = "Creation time is automatically set when using actions"
    )
    @Column(allowsNull = "false")
    @MemberOrder(name="Status",sequence = "9")
    @Persistent
    public DateTime getCreationTime() {
            return creationTime;
    }
    public void setCreationTime(DateTime creationTime) {
            this.creationTime = creationTime;
    }
    //endregion

    //region > shoppingCartItems (collection)
    @Persistent(mappedBy = "shoppingCart", dependentElement = "false")
    private SortedSet<ShoppingCartItem> shoppingCartItems = new TreeSet<ShoppingCartItem>();

    @CollectionLayout(render = RenderType.EAGERLY)
    @MemberOrder(sequence = "100")
    public SortedSet<ShoppingCartItem> getShoppingCartItems() {
        return shoppingCartItems;
    }

    public void setShoppingCartItems(final SortedSet<ShoppingCartItem> shoppingCartItems) {
        this.shoppingCartItems = shoppingCartItems;
    }
    //endregion



________________________________________
De: Dan Haywood <da...@haywood-associates.co.uk>
Enviado: viernes, 19 de febrero de 2016 02:08 p. m.
Para: users
Asunto: Re: instanceId

Hmm, presumably is the Shopping cart that has the instance Id that you
quoted?

Perhaps you could show us the definition on that class too?

---
Unrelated to your original query, now that you should be able to inject
your AytoNumberRepository. Just ensure that it is annotated with
@DomainService and is in a package specified by your AppManifest.
On 19 Feb 2016 19:08, "Arturo Ulises Castañeda Estrada" <
arturo.castaneda@sisorg.com.mx> wrote:

> As I understand the persist is after the return obj.
>
> @DomainService(repositoryFor = ShoppingCart.class,
>         nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
>
> public class ShoppingCartRepository {
>
>     //region > newShoppingCart (action)
>     public static class CreateDomainEvent extends
> ActionDomainEvent<ShoppingCartRepository> {
>         public CreateDomainEvent(final ShoppingCartRepository source,
> final Identifier identifier, final Object... arguments) {
>             super(source, identifier, arguments);
>         }
>     }
>
>     @Action(
>             domainEvent = CreateDomainEvent.class
>     )
>     @MemberOrder(name="shoppingCarts",sequence = "1")
>     public ShoppingCart newShoppingCart(
>             //final @ParameterLayout(named="Shopping Cart Id") Long
> shoppingCartId,
>             final @ParameterLayout(named="Customer Subscription")
> CustomerSubscription customerSubscription
>     )
>     {
>         final ShoppingCart obj =
> container.newTransientInstance(ShoppingCart.class);
>
>         //Obtener Folio
>         autoNumberRepository = new AutoNumberRepository();
>         autoNumberRepository.setContainer(container);
>         Long shoppingCartId =
> autoNumberRepository.nextAutoNumber("SHOPPING CART ID" , null);
>         obj.setShoppingCartId(shoppingCartId);
>         obj.setCustomerSubscription(customerSubscription);
>         obj.setCreationTime(clockService.nowAsDateTime());
>         obj.setStatus(ShoppingCartStatus.SHOPPING);
>         container.persistIfNotAlready(obj);
>         return obj;
>     }
>     //endregion
> ________________________________________
> De: Dan Haywood <da...@haywood-associates.co.uk>
> Enviado: viernes, 19 de febrero de 2016 12:52 p. m.
> Para: users
> Asunto: Re: instanceId
>
> I suspect that's actually the instanceId of a domain object that's neither
> a view model nor a persistent entity, ie is a "transient" entity (not yet
> persisted to the DB).
>
> The RO viewer doesn't support such things (in fact, nor does the Wicket
> viewer anymore; they are a legacy of an earlier time).  The fix, I expect,
> will be to make sure the entity is a properly annotated view model.
>
> HTH
> Dan
>
>
>
>
> On 19 February 2016 at 18:50, Arturo Ulises Castañeda Estrada <
> arturo.castaneda@sisorg.com.mx> wrote:
>
> > Hi Dan, I have a problem, when i insert data, I get return the resource
> > and i get all JSON, I need the instanceId but for any reason the
> instanceId
> > it's encrypted.
> >
> >
> > "instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"
> >
> >
> >

Re: instanceId

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hmm, presumably is the Shopping cart that has the instance Id that you
quoted?

Perhaps you could show us the definition on that class too?

---
Unrelated to your original query, now that you should be able to inject
your AytoNumberRepository. Just ensure that it is annotated with
@DomainService and is in a package specified by your AppManifest.
On 19 Feb 2016 19:08, "Arturo Ulises Castañeda Estrada" <
arturo.castaneda@sisorg.com.mx> wrote:

> As I understand the persist is after the return obj.
>
> @DomainService(repositoryFor = ShoppingCart.class,
>         nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
>
> public class ShoppingCartRepository {
>
>     //region > newShoppingCart (action)
>     public static class CreateDomainEvent extends
> ActionDomainEvent<ShoppingCartRepository> {
>         public CreateDomainEvent(final ShoppingCartRepository source,
> final Identifier identifier, final Object... arguments) {
>             super(source, identifier, arguments);
>         }
>     }
>
>     @Action(
>             domainEvent = CreateDomainEvent.class
>     )
>     @MemberOrder(name="shoppingCarts",sequence = "1")
>     public ShoppingCart newShoppingCart(
>             //final @ParameterLayout(named="Shopping Cart Id") Long
> shoppingCartId,
>             final @ParameterLayout(named="Customer Subscription")
> CustomerSubscription customerSubscription
>     )
>     {
>         final ShoppingCart obj =
> container.newTransientInstance(ShoppingCart.class);
>
>         //Obtener Folio
>         autoNumberRepository = new AutoNumberRepository();
>         autoNumberRepository.setContainer(container);
>         Long shoppingCartId =
> autoNumberRepository.nextAutoNumber("SHOPPING CART ID" , null);
>         obj.setShoppingCartId(shoppingCartId);
>         obj.setCustomerSubscription(customerSubscription);
>         obj.setCreationTime(clockService.nowAsDateTime());
>         obj.setStatus(ShoppingCartStatus.SHOPPING);
>         container.persistIfNotAlready(obj);
>         return obj;
>     }
>     //endregion
> ________________________________________
> De: Dan Haywood <da...@haywood-associates.co.uk>
> Enviado: viernes, 19 de febrero de 2016 12:52 p. m.
> Para: users
> Asunto: Re: instanceId
>
> I suspect that's actually the instanceId of a domain object that's neither
> a view model nor a persistent entity, ie is a "transient" entity (not yet
> persisted to the DB).
>
> The RO viewer doesn't support such things (in fact, nor does the Wicket
> viewer anymore; they are a legacy of an earlier time).  The fix, I expect,
> will be to make sure the entity is a properly annotated view model.
>
> HTH
> Dan
>
>
>
>
> On 19 February 2016 at 18:50, Arturo Ulises Castañeda Estrada <
> arturo.castaneda@sisorg.com.mx> wrote:
>
> > Hi Dan, I have a problem, when i insert data, I get return the resource
> > and i get all JSON, I need the instanceId but for any reason the
> instanceId
> > it's encrypted.
> >
> >
> > "instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"
> >
> >
> >

Re: instanceId

Posted by Arturo Ulises Castañeda Estrada <ar...@sisorg.com.mx>.
As I understand the persist is after the return obj.
 
@DomainService(repositoryFor = ShoppingCart.class,
        nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)

public class ShoppingCartRepository {

    //region > newShoppingCart (action)
    public static class CreateDomainEvent extends ActionDomainEvent<ShoppingCartRepository> {
        public CreateDomainEvent(final ShoppingCartRepository source, final Identifier identifier, final Object... arguments) {
            super(source, identifier, arguments);
        }
    }

    @Action(
            domainEvent = CreateDomainEvent.class
    )
    @MemberOrder(name="shoppingCarts",sequence = "1")
    public ShoppingCart newShoppingCart(
            //final @ParameterLayout(named="Shopping Cart Id") Long shoppingCartId,
            final @ParameterLayout(named="Customer Subscription") CustomerSubscription customerSubscription
    )
    {
        final ShoppingCart obj = container.newTransientInstance(ShoppingCart.class);

        //Obtener Folio
        autoNumberRepository = new AutoNumberRepository();
        autoNumberRepository.setContainer(container);
        Long shoppingCartId =  autoNumberRepository.nextAutoNumber("SHOPPING CART ID" , null);
        obj.setShoppingCartId(shoppingCartId);
        obj.setCustomerSubscription(customerSubscription);
        obj.setCreationTime(clockService.nowAsDateTime());
        obj.setStatus(ShoppingCartStatus.SHOPPING);
        container.persistIfNotAlready(obj);
        return obj;
    }
    //endregion
________________________________________
De: Dan Haywood <da...@haywood-associates.co.uk>
Enviado: viernes, 19 de febrero de 2016 12:52 p. m.
Para: users
Asunto: Re: instanceId

I suspect that's actually the instanceId of a domain object that's neither
a view model nor a persistent entity, ie is a "transient" entity (not yet
persisted to the DB).

The RO viewer doesn't support such things (in fact, nor does the Wicket
viewer anymore; they are a legacy of an earlier time).  The fix, I expect,
will be to make sure the entity is a properly annotated view model.

HTH
Dan




On 19 February 2016 at 18:50, Arturo Ulises Castañeda Estrada <
arturo.castaneda@sisorg.com.mx> wrote:

> Hi Dan, I have a problem, when i insert data, I get return the resource
> and i get all JSON, I need the instanceId but for any reason the instanceId
> it's encrypted.
>
>
> "instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"
>
>
>

Re: instanceId

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
I suspect that's actually the instanceId of a domain object that's neither
a view model nor a persistent entity, ie is a "transient" entity (not yet
persisted to the DB).

The RO viewer doesn't support such things (in fact, nor does the Wicket
viewer anymore; they are a legacy of an earlier time).  The fix, I expect,
will be to make sure the entity is a properly annotated view model.

HTH
Dan




On 19 February 2016 at 18:50, Arturo Ulises Castañeda Estrada <
arturo.castaneda@sisorg.com.mx> wrote:

> Hi Dan, I have a problem, when i insert data, I get return the resource
> and i get all JSON, I need the instanceId but for any reason the instanceId
> it's encrypted.
>
>
> "instanceId" : "ec263491-bb79-4a11-a205-f1dfd2840f36"
>
>
>