Examples of RootOid


Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

        final String oidStr = UrlDecoderUtils.urlDecode(oidEncodedStr);
        return getObjectAdapterForUnencodedElseThrowNotFound(resourceContext, oidStr);
    }

    private static ObjectAdapter getObjectAdapterForUnencodedElseThrowNotFound(final RendererContext resourceContext, final String oidStr) {
        final RootOid rootOid = RootOidDefault.deStringEncoded(oidStr, getOidMarshaller());
        //return resourceContext.getPersistenceSession().loadObject(rootOid);
        return resourceContext.getPersistenceSession().getAdapterManager().adapterFor(rootOid);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

            @Override
            public ObjectAdapterMemento apply(String input) {
                if(NULL_PLACEHOLDER.equals(input)) {
                    return null;
                }
                final RootOid oid = RootOidDefault.deString(input, ObjectAdapterMemento.getOidMarshaller());
                return ObjectAdapterMemento.createPersistent(oid);
            }
        };
        return Collections2.transform(ids, function);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

            if(publishedObjectFacet == null) {
                continue;
            }
            final PublishedObject.PayloadFactory payloadFactory = publishedObjectFacet.value();
       
            final RootOid enlistedAdapterOid = (RootOid) enlistedAdapter.getOid();
            final String oidStr = getOidMarshaller().marshal(enlistedAdapterOid);
            final String title = oidStr;
       
            final EventType eventTypeFor = eventTypeFor(changeKind);
           
            final String enlistedAdapterClass = CommandUtil.targetClassNameFor(enlistedAdapter);
            final Bookmark enlistedTarget = enlistedAdapterOid.asBookmark();
           
            final EventMetadata metadata = newEventMetadata(eventTypeFor, currentUser, timestamp, title, enlistedAdapterClass, null, enlistedTarget, null);
       
            publishingService.publishObject(payloadFactory, metadata, enlistedAdapter, changeKind, objectStringifier());
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

       
        final AuditableFacet auditableFacet = adapter.getSpecification().getFacet(AuditableFacet.class);
        if(auditableFacet == null || auditableFacet.isDisabled()) {
            return;
        }
        final RootOid oid = (RootOid) adapter.getOid();
        final String objectType = oid.getObjectSpecId().asString();
        final String identifier = oid.getIdentifier();
        final PreAndPostValues papv = auditEntry.getValue();
        final String preValue = papv.getPreString();
        final String postValue = papv.getPostString();
       
        final ObjectAssociation property = aap.getProperty();
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

            if(publishedActionFacet == null) {
                return;
            }
            final PublishedAction.PayloadFactory payloadFactory = publishedActionFacet.value();
           
            final RootOid adapterOid = (RootOid) currentInvocation.getTarget().getOid();
            final String oidStr = getOidMarshaller().marshal(adapterOid);
            final Identifier actionIdentifier = action.getIdentifier();
            final String title = oidStr + ": " + actionIdentifier.toNameParmsIdentityString();
           
            final Command command = currentInvocation.getCommand();
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

        this.titleString = titleString;
        return this;
    }

    public PojoAdapter build() {
        final RootOid rootOid = persistence.createOid(objectSpecId, identifier);
        final Oid oid = type.oidFor(rootOid, objectSpecId, aggregatedId);
        final PojoAdapter pojoAdapter = new PojoAdapter(pojo, oid, specificationLoader, objectAdapterLookup, localization, authenticationSession) {
            @Override
            public ObjectSpecification getSpecification() { return objectSpec != null? objectSpec: super.getSpecification(); }
            @Override
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

     */
    private void createServiceAdapters(final List<Object> registeredServices) {
        for (final Object service : registeredServices) {
            final ObjectSpecification serviceSpecification = getSpecificationLoader().loadSpecification(service.getClass());
            serviceSpecification.markAsService();
            final RootOid existingOid = getOidForService(serviceSpecification);
            ObjectAdapter serviceAdapter =
                    existingOid == null
                            ? getAdapterManager().adapterFor(service)
                            : mapRecreatedPojo(existingOid, service);
            if (serviceAdapter.getOid().isTransient()) {
                adapterManager.remapAsPersistent(serviceAdapter, null);
            }

            serviceAdapter.markAsResolvedIfPossible();
            if (existingOid == null) {
                final RootOid persistentOid = (RootOid) serviceAdapter.getOid();
                registerService(persistentOid);
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

        return serviceAdapters;
    }

    private ObjectAdapter getService(final Object servicePojo) {
        final ObjectSpecification serviceSpecification = getSpecificationLoader().loadSpecification(servicePojo.getClass());
        final RootOid oid = getOidForService(serviceSpecification);
        final ObjectAdapter serviceAdapter = mapRecreatedPojo(oid, servicePojo);

        serviceAdapter.markAsResolvedIfPossible();
        return serviceAdapter;
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

        return servicesInjector.getRegisteredServices().size() > 0;
    }

    private RootOid getOidForServiceFromPersistenceLayer(ObjectSpecification serviceSpecification) {
        final ObjectSpecId objectSpecId = serviceSpecification.getSpecId();
        RootOid oid = servicesByObjectType.get(objectSpecId);
        if (oid == null) {
            oid = objectStore.getOidForService(serviceSpecification);
            servicesByObjectType.put(objectSpecId, oid);
        }
        return oid;
View Full Code Here

Examples of org.apache.isis.core.metamodel.adapter.oid.RootOid

        }

        // sync versions of original, with concurrency checking if required
        Oid adapterOid = adapter.getOid();
        if(adapterOid instanceof RootOid) {
            final RootOid recreatedOid = (RootOid) adapterOid;
            final RootOid originalOid = (RootOid) typedOid;
           
            try {
                if(concurrencyChecking.isChecking()) {
                   
                    // check for exception, but don't throw if suppressed through thread-local
                    final Version otherVersion = originalOid.getVersion();
                    final Version thisVersion = recreatedOid.getVersion();
                    if(thisVersion != null &&
                       otherVersion != null &&
                       thisVersion.different(otherVersion)) {
                       
                        if(isConcurrencyCheckingGloballyEnabled() && ConcurrencyChecking.isCurrentlyEnabled()) {
                            LOG.info("concurrency conflict detected on " + recreatedOid + " (" + otherVersion + ")");
                            final String currentUser = getAuthenticationSession().getUserName();
                            throw new ConcurrencyException(currentUser, recreatedOid, thisVersion, otherVersion);
                        } else {
                            LOG.warn("concurrency conflict detected but suppressed, on " + recreatedOid + " (" + otherVersion + ")");
                        }
                    }
                }
            } finally {
                final Version originalVersion = originalOid.getVersion();
                final Version recreatedVersion = recreatedOid.getVersion();
                if(recreatedVersion != null && (
                        originalVersion == null ||
                        recreatedVersion.different(originalVersion))
                    ) {
                    if(LOG.isDebugEnabled()) {
                        LOG.debug("updating version in oid, on " + originalOid + " (" + originalVersion + ") to (" + recreatedVersion +")");
                    }
                    originalOid.setVersion(recreatedVersion);
                }
            }
        }

        return adapter;
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.