Package org.apache.isis.core.metamodel.spec

Examples of org.apache.isis.core.metamodel.spec.ObjectSpecId


        final BookmarkPolicyFacet facet = getBookmarkPolicyFacetIfAny();
        return facet != null && facet.value() == policy;
    }
   
    private BookmarkPolicyFacet getBookmarkPolicyFacetIfAny() {
        final ObjectSpecId specId = getObjectAdapterMemento().getObjectSpecId();
        final ObjectSpecification objectSpec = getSpecificationLoader().lookupBySpecId(specId);
        return objectSpec.getFacet(BookmarkPolicyFacet.class);
    }
View Full Code Here


        setArgumentsIfPossible(pageParameters);
        setContextArgumentIfPossible(pageParameters);
    }

    private static ActionMemento newActionMementoFrom(final PageParameters pageParameters) {
        final ObjectSpecId owningSpec = ObjectSpecId.of(PageParameterNames.ACTION_OWNING_SPEC.getStringFrom(pageParameters));
        final ActionType actionType = PageParameterNames.ACTION_TYPE.getEnumFrom(pageParameters, ActionType.class);
        final String actionNameParms = PageParameterNames.ACTION_ID.getStringFrom(pageParameters);
        return new ActionMemento(owningSpec, actionType, actionNameParms);
    }
View Full Code Here

        database.addService(rootOid.getObjectSpecId(), key);
    }

    @Override
    public RootOid getOidForService(ObjectSpecification serviceSpec) {
        final ObjectSpecId objectSpecId = serviceSpec.getSpecId();
        RootOid oid = servicesByObjectSpecId.get(objectSpecId);
        if (oid == null) {
            final String id = database.getService(objectSpecId);
            if (id == null) {
                oid = null;
View Full Code Here

        final RootOid persistedRootOid;
        if(hintRootOid != null) {
            if(hintRootOid.isTransient()) {
                throw new IsisAssertException("hintRootOid must be persistent");
            }
            final ObjectSpecId hintRootOidObjectSpecId = hintRootOid.getObjectSpecId();
            final ObjectSpecId adapterObjectSpecId = adapter.getSpecification().getSpecId();
            if(!hintRootOidObjectSpecId.equals(adapterObjectSpecId)) {
                throw new IsisAssertException("hintRootOid's objectType must be same as that of adapter " +
                    "(was: '" + hintRootOidObjectSpecId + "'; adapter's is " + adapterObjectSpecId + "'");
            }
            // ok
View Full Code Here

    protected static boolean isApplicationIdentity(final JdoPersistenceCapableFacet jdoPcFacet) {
        return jdoPcFacet != null && jdoPcFacet.getIdentityType() == IdentityType.APPLICATION;
    }

  private static Class<?> objectTypeClassFor(RootOid oid) {
    final ObjectSpecId objectSpecId = oid.getObjectSpecId();
    final ObjectSpecification spec = getSpecificationLoader().lookupBySpecId(objectSpecId);
    final Class<?> correspondingClass = spec.getCorrespondingClass();
    return correspondingClass;
  }
View Full Code Here

        assertFalse(db.hasInstances(ObjectSpecId.of("org.xxx.unknown")));
    }

    @Test
    public void serviceIds() throws Exception {
        final ObjectSpecId osi = ObjectSpecId.of("one");
        db.addService(osi, "123");
        assertEquals("123", db.getService(osi));
    }
View Full Code Here

    private void allowingObjectSpecToReturnSpecIdFor(final Class<?> cls) {
        context.checking(new Expectations() {
            {
                oneOf(mockObjectSpec).getSpecId();
                will(returnValue(new ObjectSpecId(cls.getName())));
            }
        });
    }
View Full Code Here

            }
        });
        context.checking(new Expectations() {
            {
                allowing(mockObjectSpec).getSpecId();
                will(returnValue(new ObjectSpecId(result.getName())));
            }
        });
    }
View Full Code Here

            throw new NoSqlStoreException("Failed to create refence for " + adapter, e);
        }
    }

    public RootOid createRootOid(ObjectSpecification objectSpecification, final String identifier) {
        final ObjectSpecId objectSpecId = objectSpecification.getSpecId();
        return RootOidDefault.create(objectSpecId, identifier);
    }
View Full Code Here

                    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

TOP

Related Classes of org.apache.isis.core.metamodel.spec.ObjectSpecId

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.