private Object propertyChoices() { final ObjectAdapter[] choiceAdapters = objectMember.getChoices(objectAdapter); if (choiceAdapters == null || choiceAdapters.length == 0) { return null; } final List<Object> list = Lists.newArrayList(); for (final ObjectAdapter choiceAdapter : choiceAdapters) { final ObjectSpecification objectSpec = objectMember.getSpecification(); list.add(DomainObjectReprRenderer.valueOrRef(resourceContext, choiceAdapter, objectSpec)); } return list; }
private Object propertyChoices() { final ObjectAdapter[] choiceAdapters = objectMember.getChoices(objectAdapter); if (choiceAdapters == null || choiceAdapters.length == 0) { return null; } final List<Object> list = Lists.newArrayList(); for (final ObjectAdapter choiceAdapter : choiceAdapters) { // REVIEW: previously was using the spec of the member, but think instead it should be the spec of the adapter itself // final ObjectSpecification choiceSpec = objectMember.getSpecification(); // REVIEW: check that it works for ToDoItem$Category, though... final ObjectSpecification choiceSpec = objectAdapter.getSpecification(); list.add(DomainObjectReprRenderer.valueOrRef(rendererContext, choiceAdapter, choiceSpec)); } return list; }
private Object propertyChoices() { final ObjectAdapter[] choiceAdapters = objectMember.getChoices( objectAdapter, getInteractionInitiatedBy()); if (choiceAdapters == null || choiceAdapters.length == 0) { return null; } final List<Object> list = Lists.newArrayList(); for (final ObjectAdapter choiceAdapter : choiceAdapters) { // REVIEW: previously was using the spec of the member, but think instead it should be the spec of the adapter itself // final ObjectSpecification choiceSpec = objectMember.getSpecification(); // REVIEW: check that it works for ToDoItem$Category, though... final ObjectSpecification choiceSpec = choiceAdapter.getSpecification(); list.add(DomainObjectReprRenderer.valueOrRef(rendererContext, choiceAdapter, choiceSpec)); } return list; }
@Override public List<ObjectAdapter> getChoices(final ScalarModel scalarModel) { final PropertyMemento propertyMemento = scalarModel.getPropertyMemento(); final OneToOneAssociation property = propertyMemento.getProperty(); final ObjectAdapter[] choices = property.getChoices(scalarModel.parentObjectAdapterMemento.getObjectAdapter()); return choicesAsList(choices); } },
@Override public void doHandle(final PerformContext performContext) { final ObjectAdapter onAdapter = performContext.getOnAdapter(); final ObjectMember nakedObjectMember = performContext.getObjectMember(); final OneToOneAssociation otoa = (OneToOneAssociation) nakedObjectMember; result = performContext.getPeer().toAdaptedListOfPojos(otoa.getChoices(onAdapter)); }
@Override public List<ObjectAdapter> getChoices( final ScalarModel scalarModel, final ObjectAdapter[] argumentsIfAvailable, final AuthenticationSession authenticationSession, final DeploymentCategory deploymentCategory) { final PropertyMemento propertyMemento = scalarModel.getPropertyMemento(); final OneToOneAssociation property = propertyMemento.getProperty(scalarModel.getSpecificationLoader()); ObjectAdapter parentAdapter = scalarModel.getParentEntityModel().load(ConcurrencyChecking.NO_CHECK); final ObjectAdapter[] choices = property.getChoices( parentAdapter, InteractionInitiatedBy.USER); return choicesAsList(choices); }
@Override public List<ObjectAdapter> getChoices( final ScalarModel scalarModel, final ObjectAdapter[] argumentsIfAvailable, final AuthenticationSession authenticationSession, final DeploymentCategory deploymentCategory) { final PropertyMemento propertyMemento = scalarModel.getPropertyMemento(); final OneToOneAssociation property = propertyMemento.getProperty(scalarModel.getSpecificationLoader()); ObjectAdapter parentAdapter = scalarModel.parentObjectAdapterMemento .getObjectAdapter(ConcurrencyChecking.NO_CHECK, scalarModel.getPersistenceSession(), scalarModel.getSpecificationLoader()); final ObjectAdapter[] choices = property.getChoices( parentAdapter, InteractionInitiatedBy.USER); return choicesAsList(choices); }