Examples of ObjectAdapter

  • net.sf.myway.ui.ObjectAdapter
    @author Andreas Beckers @version $Revision$
  • org.apache.isis.core.metamodel.adapter.ObjectAdapter
    Adapters to domain objects, where the application is written in terms of domain objects and those objects are represented within the NOF through these adapter, and not directly.
  • org.apache.isis.metamodel.adapter.ObjectAdapter
  • org.apache.isis.noa.adapter.ObjectAdapter
  • org.apache.isis.object.ObjectAdapter

  • Examples of com.sun.corba.se.spi.oa.ObjectAdapter

            RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
            ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(
                oktemp.getSubcontractId() ) ;

            ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
            ObjectAdapter oa = null ;

            try {
                oa = oaf.find( oaid ) ;
            } catch (SystemException exc) {
                // Could not find the OA, so just return null.
                // This usually happens when POAs are being deleted,
                // and the POA always return null for getLocalServant anyway.
                wrapper.getLocalServantFailure( exc, oaid.toString() ) ;
                return null ;
            }

            byte[] boid = oid.getId() ;
            java.lang.Object servant = oa.getLocalServant( boid ) ;
            return servant ;
        }
    View Full Code Here

    Examples of net.sf.myway.ui.ObjectAdapter

      private CalibrationObject _calibrationObject;

      private ObjectListener _listener;

      public CalibratorModel() {
        _listener = new ObjectAdapter() {
          @Override
          public void changed(final ObjectEvent event) {
            if (!(event.getObject() instanceof ScannedMap))
              return;
            if (event.getSource() == this)
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

            final ObjectSpecification domainTypeSpec = getSpecificationLoader().lookupBySpecId(ObjectSpecId.of(domainType));
            if (domainTypeSpec == null) {
                throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.BAD_REQUEST, "Could not determine type of domain object to persist (no class with domainType Id of '%s')", domainType);
            }

            final ObjectAdapter objectAdapter = getResourceContext().getPersistenceSession().createTransientInstance(domainTypeSpec);

            final JsonRepresentation propertiesList = objectRepr.getArrayEnsured("members[memberType=property]");
            if (propertiesList == null) {
                throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.BAD_REQUEST, "Could not find properties list (no members[memberType=property]); got %s", objectRepr);
            }
            if (!DomainResourceHelper.copyOverProperties(getResourceContext(), objectAdapter, propertiesList)) {
                throw RestfulObjectsApplicationException.createWithBody(HttpStatusCode.BAD_REQUEST, objectRepr, "Illegal property value");
            }

            final Consent validity = objectAdapter.getSpecification().isValid(objectAdapter);
            if (validity.isVetoed()) {
                throw RestfulObjectsApplicationException.createWithBody(HttpStatusCode.BAD_REQUEST, objectRepr, validity.getReason());
            }
            getResourceContext().getPersistenceSession().makePersistent(objectAdapter);
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

        @Path("/{domainType}/{instanceId}")
        @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT, RestfulMediaType.APPLICATION_JSON_ERROR })
        public Response object(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId) {
            init(RepresentationType.DOMAIN_OBJECT, Where.OBJECT_FORMS);

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);

            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);
            return helper.objectRepresentation();
        }
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

            final JsonRepresentation argRepr = DomainResourceHelper.readAsMap(objectStr);
            if (!argRepr.isMap()) {
                throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.BAD_REQUEST, "Body is not a map; got %s", argRepr);
            }

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);

            if (!DomainResourceHelper.copyOverProperties(getResourceContext(), objectAdapter, argRepr)) {
                throw RestfulObjectsApplicationException.createWithBody(HttpStatusCode.BAD_REQUEST, argRepr, "Illegal property value");
            }

            final Consent validity = objectAdapter.getSpecification().isValid(objectAdapter);
            if (validity.isVetoed()) {
                throw RestfulObjectsApplicationException.createWithBody(HttpStatusCode.BAD_REQUEST, argRepr, validity.getReason());
            }

            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

        @Consumes({ MediaType.WILDCARD })
        @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_PROPERTY, RestfulMediaType.APPLICATION_JSON_ERROR })
        public Response propertyDetails(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("propertyId") final String propertyId) {
            init(RepresentationType.OBJECT_PROPERTY, Where.OBJECT_FORMS);

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);
            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);

            return helper.propertyDetails(propertyId, MemberMode.NOT_MUTATING, Caching.NONE, getResourceContext().getWhere());
        }
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

        @Consumes({ MediaType.WILDCARD })
        @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ERROR })
        public Response modifyProperty(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("propertyId") final String propertyId, final InputStream body) {
            init(Where.OBJECT_FORMS);

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);
            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);

            final OneToOneAssociation property = helper.getPropertyThatIsVisibleForIntent(propertyId, Intent.MUTATE, getResourceContext().getWhere());

            final ObjectSpecification propertySpec = property.getSpecification();
            final String bodyAsString = DomainResourceHelper.asStringUtf8(body);

            final ObjectAdapter argAdapter = helper.parseAsMapWithSingleValue(propertySpec, bodyAsString);

            final Consent consent = property.isAssociationValid(objectAdapter, argAdapter);
            if (consent.isVetoed()) {
                throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.UNAUTHORIZED, consent.getReason());
            }
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

        @Path("/{domainType}/{instanceId}/properties/{propertyId}")
        @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ERROR })
        public Response clearProperty(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("propertyId") final String propertyId) {
            init(Where.OBJECT_FORMS);

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);
            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);

            final OneToOneAssociation property = helper.getPropertyThatIsVisibleForIntent(propertyId, Intent.MUTATE, getResourceContext().getWhere());

            final Consent consent = property.isAssociationValid(objectAdapter, null);
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

        @Path("/{domainType}/{instanceId}/collections/{collectionId}")
        @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_OBJECT_COLLECTION, RestfulMediaType.APPLICATION_JSON_ERROR })
        public Response accessCollection(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("collectionId") final String collectionId) {
            init(RepresentationType.OBJECT_COLLECTION, Where.PARENTED_TABLES);

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);
            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);

            return helper.collectionDetails(collectionId, MemberMode.NOT_MUTATING, Caching.NONE, getResourceContext().getWhere());
        }
    View Full Code Here

    Examples of org.apache.isis.core.metamodel.adapter.ObjectAdapter

        @Consumes({ MediaType.WILDCARD })
        @Produces({ MediaType.APPLICATION_JSON, RestfulMediaType.APPLICATION_JSON_ERROR })
        public Response addToSet(@PathParam("domainType") String domainType, @PathParam("instanceId") final String instanceId, @PathParam("collectionId") final String collectionId, final InputStream body) {
            init(Where.PARENTED_TABLES);

            final ObjectAdapter objectAdapter = getObjectAdapterElseThrowNotFound(domainType, instanceId);
            final DomainResourceHelper helper = new DomainResourceHelper(getResourceContext(), objectAdapter);

            final OneToManyAssociation collection = helper.getCollectionThatIsVisibleForIntent(collectionId, Intent.MUTATE, getResourceContext().getWhere());

            if (!collection.getCollectionSemantics().isSet()) {
                throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.BAD_REQUEST, "Collection '%s' does not have set semantics", collectionId);
            }

            final ObjectSpecification collectionSpec = collection.getSpecification();
            final String bodyAsString = DomainResourceHelper.asStringUtf8(body);
            final ObjectAdapter argAdapter = helper.parseAsMapWithSingleValue(collectionSpec, bodyAsString);

            final Consent consent = collection.isValidToAdd(objectAdapter, argAdapter);
            if (consent.isVetoed()) {
                throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.UNAUTHORIZED, consent.getReason());
            }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.