public Object call() throws RepositoryException { return service.getIdFactory(); } }, "getIdFactory()", new Object[]{});
public Object call() throws RepositoryException { return service.getIdFactory(); } }, "getIdFactory()", new Object[]{});
public IdFactory getIdFactory() throws RepositoryException { return repositoryService.getIdFactory(); }
public void testGetIdFactory() throws RepositoryException { assertNotNull(service.getIdFactory()); }
private PropertyId getPropertyId(NodeId nId, Name propName) throws RepositoryException { return rs.getIdFactory().createPropertyId(nId, propName); } }
private PropertyId getPropertyId(NodeId nId, Name propName) throws RepositoryException { return rs.getIdFactory().createPropertyId(nId, propName); }
public QNodeDefinition getRootNodeDefinition() throws RepositoryException { if (rootNodeDefinition == null) { IdFactory idFactory = service.getIdFactory(); PathFactory pf = service.getPathFactory(); rootNodeDefinition = service.getNodeDefinition( sessionInfo, idFactory.createNodeId((String) null, pf.getRootPath())); } return rootNodeDefinition; }
public NodeState createRootState(NodeEntry entry) throws ItemNotFoundException, RepositoryException { IdFactory idFactory = service.getIdFactory(); PathFactory pf = service.getPathFactory(); return createNodeState(idFactory.createNodeId((String) null, pf.getRootPath()), entry); }
public QNodeDefinition getRootNodeDefinition() throws RepositoryException { if (rootNodeDefinition == null) { IdFactory idFactory = service.getIdFactory(); PathFactory pf = service.getPathFactory(); rootNodeDefinition = service.getNodeDefinition( sessionInfo, idFactory.createNodeId((String) null, pf.getRootPath())); } return rootNodeDefinition; }
public NodeState createRootState(NodeEntry entry) throws ItemNotFoundException, RepositoryException { IdFactory idFactory = service.getIdFactory(); PathFactory pf = service.getPathFactory(); return createNodeState(idFactory.createNodeId((String) null, pf.getRootPath()), entry); }
private NodeId getNodeId(String path) throws RepositoryException { return rs.getIdFactory().createNodeId((String) null, resolver.getQPath(path)); }
private NodeId getNodeId(String path) throws NamespaceException, RepositoryException { return rs.getIdFactory().createNodeId((String) null, resolver.getQPath(path)); }
private NodeId getNodeId(String path) throws NamespaceException, RepositoryException { return rs.getIdFactory().createNodeId((String) null, resolver.getQPath(path)); }
private NodeId getNodeId(String path) throws RepositoryException { return rs.getIdFactory().createNodeId((String) null, resolver.getQPath(path)); }
private NodeId getNodeId(String path) throws NamespaceException, RepositoryException { return rs.getIdFactory().createNodeId((String) null, resolver.getQPath(path)); }
private NodeId getNodeId(String path) throws RepositoryException { return rs.getIdFactory().createNodeId((String) null, resolver.getQPath(path)); }
public void testPropertiesWithNonLatinCharacters() throws RepositoryException, IOException { Name fileName = resolver.getQName("\u0633\u0634.txt"); createFile(fileName); NodeId nid = getNodeId(testPath + "/\u0633\u0634.txt/jcr:content"); PropertyInfo pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_LASTMODIFIED)); assertEquals(lastModified, pi.getValues()[0]); pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_MIMETYPE)); assertEquals(mimeType, pi.getValues()[0]); pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_ENCODING)); assertEquals(enc, pi.getValues()[0]); pi = rs.getPropertyInfo(si, rs.getIdFactory().createPropertyId(nid, NameConstants.JCR_DATA)); assertEquals("\u0633\u0634", pi.getValues()[0].getString()); }
public WorkspaceManager(RepositoryConfig config, SessionInfo sessionInfo, boolean observationSupported) throws RepositoryException { this.config = config; this.service = config.getRepositoryService(); this.sessionInfo = sessionInfo; this.observationSupported = observationSupported; this.nameFactory = service.getNameFactory(); this.pathFactory = service.getPathFactory(); idFactory = service.getIdFactory(); nsRegistry = new NamespaceRegistryImpl(this); ntRegistry = createNodeTypeRegistry(nsRegistry); definitionProvider = createDefinitionProvider(getEffectiveNodeTypeProvider()); TransientItemStateFactory stateFactory = createItemStateFactory(); this.isf = stateFactory; this.hierarchyManager = createHierarchyManager(stateFactory, idFactory); // If cache behavior is observation register a hierarchy listener which is // notified about all changes. Otherwise just add a hierarchy listener which // is only notified on changes for which client event listeners have been // installed. Note: this listener has to be the first one called in order // for the hierarchy to be consistent with the event (See JCR-2293). InternalEventListener listener = createHierarchyListener(hierarchyManager); CacheBehaviour cacheBehaviour = config.getCacheBehaviour(); if (cacheBehaviour == CacheBehaviour.OBSERVATION) { addEventListener(listener); } else { listeners.add(listener); } }
public void testImport() throws RepositoryException { NodeId nid = getNodeId(testPath); Batch b = rs.createBatch(si, nid); String uuid = UUID.randomUUID().toString(); b.addNode(nid, resolver.getQName("testUUIDNode"), NameConstants.NT_UNSTRUCTURED, uuid); NodeId id = getNodeId(testPath + "/testUUIDNode"); b.setMixins(id, new Name[] {NameConstants.MIX_REFERENCEABLE}); rs.submit(b); NodeInfo nInfo = rs.getNodeInfo(si, id); assertEquals(uuid, nInfo.getId().getUniqueID()); Name[] mixins = nInfo.getMixins(); assertEquals(1, mixins.length); assertEquals(NameConstants.MIX_REFERENCEABLE, mixins[0]); b = rs.createBatch(si, nid); b.remove(rs.getIdFactory().createNodeId(uuid)); rs.submit(b); try { rs.getItemInfos(si, id); fail(); } catch (RepositoryException e) { // success } try { rs.getItemInfos(si, rs.getIdFactory().createNodeId(uuid)); fail(); } catch (RepositoryException e) { // success } }
public void testAddNode() throws RepositoryException { NodeId nid = getNodeId(testPath); Batch b = rs.createBatch(si, nid); b.addNode(nid, resolver.getQName("aNode"), NameConstants.NT_UNSTRUCTURED, null); b.addProperty(nid, resolver.getQName("aString"), rs.getQValueFactory().create("ba", PropertyType.STRING)); b.addProperty(nid, resolver.getQName("aName"), new QValue[] {rs.getQValueFactory().create(NameConstants.JCR_ENCODING), rs.getQValueFactory().create(NameConstants.JCR_DATA)}); b.addProperty(nid, resolver.getQName("aBinary"), rs.getQValueFactory().create(new byte[] { 'a', 'b', 'c'})); rs.submit(b); NodeId id = rs.getIdFactory().createNodeId(nid, resolver.getQPath("aNode")); Iterator<? extends ItemInfo> it = rs.getItemInfos(si, id); while (it.hasNext()) { ItemInfo info = it.next(); if (info.denotesNode()) { NodeInfo nInfo = (NodeInfo) info; assertEquals(NameConstants.NT_UNSTRUCTURED, nInfo.getNodetype()); Iterator<ChildInfo> childIt = nInfo.getChildInfos(); assertTrue(childIt == null || !childIt.hasNext()); assertEquals(id, nInfo.getId()); } } b = rs.createBatch(si, nid); b.remove(id); rs.submit(b); }