Package org.apache.isis.core.metamodel.facets.collections.modify

Examples of org.apache.isis.core.metamodel.facets.collections.modify.CollectionRemoveFromFacet


            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }

        if (facetType == CollectionRemoveFromFacet.class) {
            final CollectionRemoveFromFacet decoratedFacet = (CollectionRemoveFromFacet) facet;
            final Facet decoratingFacet = new CollectionRemoveFromFacetWrapTransaction(decoratedFacet);
            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }
View Full Code Here


    public void removeElement(final ObjectAdapter ownerAdapter, final ObjectAdapter referencedAdapter) {
        if (referencedAdapter == null) {
            throw new IllegalArgumentException("element should not be null");
        }
        if (readWrite()) {
            final CollectionRemoveFromFacet facet = getFacet(CollectionRemoveFromFacet.class);
            facet.remove(ownerAdapter, referencedAdapter);
        }
    }
View Full Code Here

       
        final PropertyOrCollectionAccessorFacet getterFacet = holder.getFacet(PropertyOrCollectionAccessorFacet.class);
        if(getterFacet == null) {
            return null;
        }
        final CollectionRemoveFromFacet collectionRemoveFromFacet = holder.getFacet(CollectionRemoveFromFacet.class);
        if(collectionRemoveFromFacet == null) {
            return null;
        }
        // the collectionRemoveFromFacet will end up as the underlying facet of the PostsCollectionRemovedFromEventFacetAnnotation
View Full Code Here

                        collectionInteractionEventType, getterFacet, collectionAddToFacet, collectionInteractionFacet, holder, servicesInjector);
            }
            FacetUtil.addFacet(replacementFacet);
        }

        final CollectionRemoveFromFacet collectionRemoveFromFacet = holder.getFacet(CollectionRemoveFromFacet.class);
        if (collectionRemoveFromFacet != null) {
            // the current collectionRemoveFromFacet will end up as the underlying facet of the PostsCollectionRemovedFromEventFacetAnnotation
            final CollectionRemoveFromFacetForInteractionAbstract replacementFacet;
            if(collectionInteraction != null) {
                replacementFacet = new CollectionRemoveFromFacetForCollectionInteractionAnnotation(collectionInteractionEventType, getterFacet, collectionRemoveFromFacet, collectionInteractionFacet, servicesInjector, holder);
View Full Code Here

    public void removeElement(final ObjectAdapter ownerAdapter, final ObjectAdapter referencedAdapter) {
        if (referencedAdapter == null) {
            throw new IllegalArgumentException("element should not be null");
        }
        if (readWrite()) {
            final CollectionRemoveFromFacet facet = getFacet(CollectionRemoveFromFacet.class);
            facet.remove(ownerAdapter, referencedAdapter);
        }
    }
View Full Code Here

            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }

        if (facetType == CollectionRemoveFromFacet.class) {
            final CollectionRemoveFromFacet decoratedFacet = (CollectionRemoveFromFacet) facet;
            final Facet decoratingFacet = new CollectionRemoveFromFacetWrapTransaction(decoratedFacet);
            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }
View Full Code Here

        // safe since guaranteed by superclass
        final CellBinding arg0Binding = performContext.getPeer().getArg0Binding();
        final ScenarioCell arg0Cell = argumentCells.get(0);
        final String toRemove = arg0Cell.getText();

        final CollectionRemoveFromFacet removeFromFacet = nakedObjectMember.getFacet(CollectionRemoveFromFacet.class);
        if (removeFromFacet == null) {
            throw ScenarioBoundValueException.current(onMemberBinding, "(cannot remove from collection)");
        }

        final ObjectAdapter toRemoveAdapter = performContext.getPeer().getAliasRegistry().getAliased(toRemove);
        if (toRemoveAdapter == null) {
            throw ScenarioBoundValueException.current(arg0Binding, "(unknown alias)");
        }

        // validate argument
        otma.createValidateAddInteractionContext(getSession(), InteractionInvocationMethod.BY_USER, onAdapter, toRemoveAdapter);
        final Consent validToRemove = otma.isValidToRemove(onAdapter, toRemoveAdapter);
        if (validToRemove.isVetoed()) {
            throw ScenarioBoundValueException.current(onMemberBinding, validToRemove.getReason());
        }

        // remove
        removeFromFacet.remove(onAdapter, toRemoveAdapter);

    }
View Full Code Here

            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }

        if (facetType == CollectionRemoveFromFacet.class) {
            final CollectionRemoveFromFacet collectionRemoveFromFacet = (CollectionRemoveFromFacet) facet;
            final CollectionRemoveFromFacetWrapProxy decoratingFacet = new CollectionRemoveFromFacetWrapProxy(collectionRemoveFromFacet, serverFacade, encoderDecoder, identifiedHolder.getIdentifier().getMemberName());
            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }
View Full Code Here

            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }

        if (facetType == CollectionRemoveFromFacet.class) {
            final CollectionRemoveFromFacet decoratedFacet = (CollectionRemoveFromFacet) facet;
            final Facet decoratingFacet = new CollectionRemoveFromFacetWrapTransaction(decoratedFacet);
            requiredHolder.addFacet(decoratingFacet);
            return decoratingFacet;
        }
View Full Code Here

    public void removeElement(final ObjectAdapter ownerAdapter, final ObjectAdapter referencedAdapter) {
        if (referencedAdapter == null) {
            throw new IllegalArgumentException("element should not be null");
        }
        if (readWrite()) {
            final CollectionRemoveFromFacet facet = getFacet(CollectionRemoveFromFacet.class);
            facet.remove(ownerAdapter, referencedAdapter);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.collections.modify.CollectionRemoveFromFacet

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.