Examples of ObjectData


Examples of org.apache.chemistry.opencmis.commons.data.ObjectData

        }
        assertEquals(1024, counter);
    }

    protected String getByPath(String id, String path) {
        ObjectData res = null;
        try {
            res = fObjSvc.getObjectByPath(fRepositoryId, path, "*", false, IncludeRelationships.NONE, null, false,
                    false, null);
            assertNotNull(res);
            assertEquals(id, res.getId());
        } catch (Exception e) {
            fail("getObject() failed with exception: " + e);
        }
        return res.getId();
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ObjectData

        path = pd.getFirstValue() + "/" + name;
        return path;
    }

    protected ObjectData getDocumentObjectData(String id) {
        ObjectData res = null;
        try {
            String returnedId = null;
            res = fObjSvc.getObject(fRepositoryId, id, "*", false, IncludeRelationships.NONE, null, false, false, null);
            assertNotNull(res);
            returnedId = res.getId();
            testReturnedProperties(returnedId, res.getProperties().getProperties());
            assertEquals(id, returnedId);
        } catch (Exception e) {
            fail("getObject() failed with exception: " + e);
        }
        return res;
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ObjectData

        }
        return res;
    }

    protected String getDocument(String id) {
        ObjectData res = getDocumentObjectData(id);
        assertNotNull(res);
        return res.getId();
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.data.ObjectData

        ObjectInfo objectInfo = service.getObjectInfo(repositoryId, newObjectId);
        if (objectInfo == null) {
            throw new CmisRuntimeException("Object Info is missing!");
        }

        ObjectData object = objectInfo.getObject();
        if (object == null) {
            throw new CmisRuntimeException("Object is null!");
        }

        JSONObject jsonObject = JSONConverter.convert(object, typeCache);

        response.setStatus(HttpServletResponse.SC_CREATED);
        setCookie(request, response, repositoryId, transaction,
                createCookieValue(HttpServletResponse.SC_CREATED, object.getId(), null, null));

        writeJSON(jsonObject, request, response);
    }
View Full Code Here

Examples of org.apache.isis.objectstore.xml.internal.data.ObjectData

        }
    }

    @Test
    public void testWriteReadTypeOidAndVersion() {
        final ObjectData data = createData(Role.class, 99, FileVersion.create("user", 19));
        manager.insertObject(data);

        final ObjectData read = (ObjectData) manager.loadData(data.getRootOid());

        assertEquals(data.getRootOid(), read.getRootOid());
        assertEquals(data.getObjectSpecId(), read.getObjectSpecId());
        assertEquals(data.getVersion(), read.getVersion());
    }
View Full Code Here

Examples of org.apache.isis.objectstore.xml.internal.data.ObjectData

        assertEquals(first + 3, manager.nextId());
    }

    @Test
    public void testInsertObjectWithFields() throws ObjectPersistenceException {
        final ObjectData data = createData(Role.class, 99, FileVersion.create("user", 13));
        data.set("Person", RootOidDefault.create(ObjectSpecId.of("RLE"), ""+101));
        assertNotNull(data.get("Person"));
        data.set("Name", "Harry");
        assertNotNull(data.get("Name"));

        manager.insertObject(data);

        final ObjectData read = (ObjectData) manager.loadData(data.getRootOid());
        assertEquals(data.getRootOid(), read.getRootOid());
        assertEquals(data.getObjectSpecId(), read.getObjectSpecId());

        assertEquals(data.get("Person"), read.get("Person"));
        assertEquals(data.get("Name"), read.get("Name"));
    }
View Full Code Here

Examples of org.apache.isis.objectstore.xml.internal.data.ObjectData

    // /////////////////////////////////////////////////////////

    @Override
    public boolean hasInstances(final ObjectSpecification cls) {
        LOG.debug("checking instance of " + cls);
        final ObjectData data = new ObjectData(RootOidDefault.create(cls.getSpecId(), "---dummy-value-never-used---"), null);
        return dataManager.numberOfInstances(data) > 0;
    }
View Full Code Here

Examples of org.apache.isis.objectstore.xml.internal.data.ObjectData

        resolveImmediately(reference);
    }

    @Override
    public void resolveImmediately(final ObjectAdapter object) {
        final ObjectData data = (ObjectData) dataManager.loadData((RootOidDefault) object.getOid());
        Assert.assertNotNull("Not able to read in data during resolve", object, data);
        initObject(object, data);
    }
View Full Code Here

Examples of org.apache.isis.objectstore.xml.internal.data.ObjectData

        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        final ObjectSpecification objSpec = builtIn.getSpecification();
        LOG.debug("getInstances of " + objSpec + " where " + builtIn);
        final RootOid oid = RootOidDefault.create(objSpec.getSpecId(), "dummy");
        final ObjectData patternData = new ObjectData(oid, null);
        return getInstances(patternData, builtIn);
    }
View Full Code Here

Examples of org.apache.isis.objectstore.xml.internal.data.ObjectData

    private List<ObjectAdapter> getInstances(final ObjectData patternData, final PersistenceQueryBuiltIn persistenceQuery) {
        final ObjectDataVector data = dataManager.getInstances(patternData);
        final List<ObjectAdapter> instances = Lists.newArrayList();
       
        for (int i = 0; i < data.size(); i++) {
            final ObjectData instanceData = data.element(i);
            if(LOG.isDebugEnabled()) {
                LOG.debug("instance data " + instanceData);
            }

            final RootOid oid = instanceData.getRootOid();

            final ObjectAdapter adapter = getAdapterManager().adapterFor(oid);
            if(LOG.isDebugEnabled()) {
                LOG.debug("recreated instance " + 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.