Package org.apache.isis.core.metamodel.adapter.oid

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


        for (int i = 0; i < references.length; i++) {
           
            // no longer used
            //final ObjectSpecification specification = keyCreator.specificationFromOidStr(references[i]);
           
            final RootOid oid = keyCreator.unmarshal(references[i]);
            elements[i] = getAdapter(oid);
        }
        return elements;
    }
View Full Code Here


                one(db).nextSerialNumberBatch(sequenceNumbersSpecId, 4);
                will(returnValue(1L));
            }
        });

        RootOid transientRootOid = RootOidDefault.createTransient(sequenceNumbersSpecId, "-998");
        String identifier = identifierGenerator.createPersistentIdentifierFor(sequenceNumbersSpecId, new ExamplePojo(), transientRootOid);
        assertEquals("1", identifier);

        transientRootOid = RootOidDefault.createTransient(sequenceNumbersSpecId, "-997");
        identifier = identifierGenerator.createPersistentIdentifierFor(sequenceNumbersSpecId, new ExamplePojo(), transientRootOid);
View Full Code Here

                one(db).nextSerialNumberBatch(sequenceNumbersSpecId, 4);
                will(returnValue(1L));
            }
        });

        RootOid transientRootOid = RootOidDefault.createTransient(sequenceNumbersSpecId, "-998");
        String identifier = identifierGenerator.createPersistentIdentifierFor(sequenceNumbersSpecId, new ExamplePojo(), transientRootOid);
        assertEquals("1", identifier);

        transientRootOid = RootOidDefault.createTransient(sequenceNumbersSpecId, "-997");
        identifier = identifierGenerator.createPersistentIdentifierFor(sequenceNumbersSpecId, new ExamplePojo(), transientRootOid);
View Full Code Here

     */
    public String getIdentifierForPersistentRoot(final Oid oid) {
        if (!(oid instanceof RootOid)) {
            throw new NoSqlStoreException("Oid is not a RootOid: " + oid);
        }
        RootOid rootOid = (RootOid) oid;
        if (rootOid.isTransient()) {
            throw new NoSqlStoreException("Oid is not for a persistent object: " + oid);
        }
        return rootOid.getIdentifier();
    }
View Full Code Here

        // hack: remove any garbage that might've got stored in 'rootNodes'
        cleanUpGarbage(rootNodes);
       
        final PageParameters candidatePP = bookmarkableModel.getPageParameters();
        RootOid oid = BookmarkTreeNode.oidFrom(candidatePP);
        if(oid == null) {
            // ignore
            return;
        }
View Full Code Here

                   
                    PageParameters pageParameters = node.getPageParameters();
                    final AbstractLink link = Links.newBookmarkablePageLink(ID_BOOKMARKED_PAGE_LINK, pageParameters, pageClass);

                    ObjectSpecification objectSpec = null;
                    RootOid oid = node.getOidNoVer();
                    if(oid != null) {
                        ObjectSpecId objectSpecId = oid.getObjectSpecId();
                        objectSpec = getSpecificationLoader().lookupBySpecId(objectSpecId);
                    }
                    final ResourceReference imageResource = imageCache.resourceReferenceForSpec(objectSpec);
                    final Image image = new Image(ID_BOOKMARKED_PAGE_ICON, imageResource) {
                        private static final long serialVersionUID = 1L;
View Full Code Here

            @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

        return listFrom != null && !listFrom.isEmpty()? Mode.RESULTS: Mode.PARAMETERS;
    }


    private static ObjectAdapterMemento newObjectAdapterMementoFrom(final PageParameters pageParameters) {
        RootOid oid = oidFor(pageParameters);
        if(oid.isTransient()) {
            return null;
        } else {
            return ObjectAdapterMemento.createPersistent(oid);
        }
    }
View Full Code Here

            EncodableFacet encodeable = objSpec.getFacet(EncodableFacet.class);
            return encodeable.fromEncodedString(encoded);
        }
       
        try {
            final RootOid oid = RootOidDefault.deStringEncoded(encoded, getOidMarshaller());
            return getAdapterManager().adapterFor(oid);
        } catch (final Exception e) {
            return null;
        }
    }
View Full Code Here

        // REVIEW: does it make sense to get these directly?  not sure, so for now have decided to fail fast.
        if(oid instanceof AggregatedOid) {
            throw new UnsupportedOperationException("Cannot retrieve aggregated objects directly, oid: " + oid.enString(getOidMarshaller()));
        }
       
        final RootOid rootOid = (RootOid) oid;
       
        Object result = null;
        try {
            final Class<?> cls = clsOf(rootOid);
            final Object jdoObjectId = JdoObjectIdSerializer.toJdoObjectId(rootOid);
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.adapter.oid.RootOid

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.