[jira] [Updated] (ISIS-1874) Parented checkboxes fails - NPEs and incorrect facets.

2018-02-23 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-1874:
--
Attachment: 1-b.png
1-a.png
2-b.png
2-a.png

> Parented checkboxes fails - NPEs and incorrect facets.
> --
>
> Key: ISIS-1874
> URL: https://issues.apache.org/jira/browse/ISIS-1874
> Project: Isis
>  Issue Type: Bug
>Affects Versions: 1.16.1
>Reporter: Dan Haywood
>Assignee: Dan Haywood
>Priority: Blocker
> Fix For: 1.16.2
>
> Attachments: 1-a.png, 1-b.png, 2-a.png, 2-b.png
>
>
> Two separate issues:
>  # NPE for a parented collection with no toggle box column (the 
> AssociatedWithProvider is always created, but may return a null toggle box 
> column; this isn't guarded for.
>  # When a choices facet is installed for a parameter, doesn't check the type 
> of the parameter against the collection, meaning cannot invoke action.
> Workaround: disable the "associateWith" or memberOrder
> Example of (1) - fails with NPE (though action is executed)
> {code:java}
> @Getter @Setter
> private SortedSet occupancies = new TreeSet<>();
> // associated via .layout.xml
> public Occupancy newOccupancy(
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> startDate,
> final Unit unit) {
> Occupancy occupancy = occupancyRepository.newOccupancy(this, unit, 
> startDate);
> occupancies.add(occupancy);
> return occupancy;
> }
> public LocalDate default0NewOccupancy() {
> return getTenancyStartDate();
> }
> public List choices1NewOccupancy() {
> return getProperty()!=null ? unitRepository.findByProperty(getProperty()) 
> : unitRepository.allUnits();
> }
> {code}
>  
> Example of (2) - fails with AgreementRole incompatible with Party.  
> Workaround is to ensure there's an explicit autoComplete or choices
> {code:java}
> @javax.jdo.annotations.Persistent(mappedBy = "agreement", defaultFetchGroup = 
> "true")
> @Collection(editing = Editing.DISABLED)
> @CollectionLayout(render = RenderType.EAGERLY)
> @Getter @Setter
> private SortedSet roles = new TreeSet<>();
> @MemberOrder(name = "roles", sequence = "1")
> public Agreement newRole(
> final AgreementRoleType type,
> final Party party,
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> startDate,
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> endDate) {
> createRole(type, party, startDate, endDate);
> return this;
> }
> public List choices0NewRole() {
> return agreementRoleTypeRepository.findApplicableTo(getType());
> }
> public LocalDate default2NewRole() {
> return getEffectiveInterval().startDate();
> }
> public LocalDate default3NewRole() {
> return getEffectiveInterval().endDate();
> }
> {code}
> ^^^ the problem triggers on Party, not on AgreementRoleType, because the 
> latter has an explicit choices method.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ISIS-1874) Parented checkboxes fails - NPEs and incorrect facets.

2018-02-23 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-1874:
--
Fix Version/s: 1.16.2

> Parented checkboxes fails - NPEs and incorrect facets.
> --
>
> Key: ISIS-1874
> URL: https://issues.apache.org/jira/browse/ISIS-1874
> Project: Isis
>  Issue Type: Bug
>Affects Versions: 1.16.1
>Reporter: Dan Haywood
>Priority: Blocker
> Fix For: 1.16.2
>
>
> Two separate issues:
>  # NPE for a parented collection with no toggle box column (the 
> AssociatedWithProvider is always created, but may return a null toggle box 
> column; this isn't guarded for.
>  # When a choices facet is installed for a parameter, doesn't check the type 
> of the parameter against the collection, meaning cannot invoke action.
> Workaround: disable the "associateWith" or memberOrder
> Example of (1) - fails with NPE (though action is executed)
> {code:java}
> @Getter @Setter
> private SortedSet occupancies = new TreeSet<>();
> // associated via .layout.xml
> public Occupancy newOccupancy(
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> startDate,
> final Unit unit) {
> Occupancy occupancy = occupancyRepository.newOccupancy(this, unit, 
> startDate);
> occupancies.add(occupancy);
> return occupancy;
> }
> public LocalDate default0NewOccupancy() {
> return getTenancyStartDate();
> }
> public List choices1NewOccupancy() {
> return getProperty()!=null ? unitRepository.findByProperty(getProperty()) 
> : unitRepository.allUnits();
> }
> {code}
>  
> Example of (2) - fails with AgreementRole incompatible with Party.  
> Workaround is to ensure there's an explicit autoComplete or choices
> {code:java}
> @javax.jdo.annotations.Persistent(mappedBy = "agreement", defaultFetchGroup = 
> "true")
> @Collection(editing = Editing.DISABLED)
> @CollectionLayout(render = RenderType.EAGERLY)
> @Getter @Setter
> private SortedSet roles = new TreeSet<>();
> @MemberOrder(name = "roles", sequence = "1")
> public Agreement newRole(
> final AgreementRoleType type,
> final Party party,
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> startDate,
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> endDate) {
> createRole(type, party, startDate, endDate);
> return this;
> }
> public List choices0NewRole() {
> return agreementRoleTypeRepository.findApplicableTo(getType());
> }
> public LocalDate default2NewRole() {
> return getEffectiveInterval().startDate();
> }
> public LocalDate default3NewRole() {
> return getEffectiveInterval().endDate();
> }
> {code}
> ^^^ the problem triggers on Party, not on AgreementRoleType, because the 
> latter has an explicit choices method.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (ISIS-1874) Parented checkboxes fails - NPEs and incorrect facets.

2018-02-23 Thread Dan Haywood (JIRA)

 [ 
https://issues.apache.org/jira/browse/ISIS-1874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dan Haywood updated ISIS-1874:
--
Affects Version/s: 1.16.1

> Parented checkboxes fails - NPEs and incorrect facets.
> --
>
> Key: ISIS-1874
> URL: https://issues.apache.org/jira/browse/ISIS-1874
> Project: Isis
>  Issue Type: Bug
>Affects Versions: 1.16.1
>Reporter: Dan Haywood
>Priority: Blocker
> Fix For: 1.16.2
>
>
> Two separate issues:
>  # NPE for a parented collection with no toggle box column (the 
> AssociatedWithProvider is always created, but may return a null toggle box 
> column; this isn't guarded for.
>  # When a choices facet is installed for a parameter, doesn't check the type 
> of the parameter against the collection, meaning cannot invoke action.
> Workaround: disable the "associateWith" or memberOrder
> Example of (1) - fails with NPE (though action is executed)
> {code:java}
> @Getter @Setter
> private SortedSet occupancies = new TreeSet<>();
> // associated via .layout.xml
> public Occupancy newOccupancy(
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> startDate,
> final Unit unit) {
> Occupancy occupancy = occupancyRepository.newOccupancy(this, unit, 
> startDate);
> occupancies.add(occupancy);
> return occupancy;
> }
> public LocalDate default0NewOccupancy() {
> return getTenancyStartDate();
> }
> public List choices1NewOccupancy() {
> return getProperty()!=null ? unitRepository.findByProperty(getProperty()) 
> : unitRepository.allUnits();
> }
> {code}
>  
> Example of (2) - fails with AgreementRole incompatible with Party.  
> Workaround is to ensure there's an explicit autoComplete or choices
> {code:java}
> @javax.jdo.annotations.Persistent(mappedBy = "agreement", defaultFetchGroup = 
> "true")
> @Collection(editing = Editing.DISABLED)
> @CollectionLayout(render = RenderType.EAGERLY)
> @Getter @Setter
> private SortedSet roles = new TreeSet<>();
> @MemberOrder(name = "roles", sequence = "1")
> public Agreement newRole(
> final AgreementRoleType type,
> final Party party,
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> startDate,
> final @Parameter(optionality = Optionality.OPTIONAL) LocalDate 
> endDate) {
> createRole(type, party, startDate, endDate);
> return this;
> }
> public List choices0NewRole() {
> return agreementRoleTypeRepository.findApplicableTo(getType());
> }
> public LocalDate default2NewRole() {
> return getEffectiveInterval().startDate();
> }
> public LocalDate default3NewRole() {
> return getEffectiveInterval().endDate();
> }
> {code}
> ^^^ the problem triggers on Party, not on AgreementRoleType, because the 
> latter has an explicit choices method.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)