Package org.exoplatform.services.jcr.impl.core

Examples of org.exoplatform.services.jcr.impl.core.PropertyImpl


      {
         Node testRoot = csession.getRootNode().getNode(TestConcurrentItems.TEST_ROOT);
         Node ntFile = testRoot.addNode(nodeName, "nt:file");
         Node contentNode = ntFile.addNode("jcr:content", "nt:resource");
         dataStream = new FileInputStream(TEST_FILE);
         PropertyImpl data = (PropertyImpl)contentNode.setProperty("jcr:data", dataStream);
         contentNode.setProperty("jcr:mimeType", "video/avi");
         contentNode.setProperty("jcr:lastModified", Calendar.getInstance());
         csession.save();
         log.info("Create node: " + ntFile.getPath() + ", data: " + data.getInternalIdentifier());
      }
      finally
      {
         if (dataStream != null)
            try
View Full Code Here


         //check properties path
         PropertyIterator pit = n.getProperties();
         while (pit.hasNext())
         {
            PropertyImpl p = (PropertyImpl)pit.nextProperty();
            assertEquals(expectedPath, p.getInternalPath().makeParentPath());
         }
      }
   }
View Full Code Here

   public void testEquals() throws ItemExistsException, PathNotFoundException, VersionException,
      ConstraintViolationException, LockException, RepositoryException
   {
      Node testNode = root.addNode("testNode");
      PropertyImpl testProperty = (PropertyImpl)testNode.setProperty("testProperty", "someText");
      assertFalse(testProperty.equals(new Object()));

   }
View Full Code Here

            {
               String propertyName = resolver.createJCRName(properties[i]).getAsString();
               node = (NodeImpl)getNode();
               if (node.hasProperty(propertyName))
               {
                  PropertyImpl prop = (PropertyImpl)node.getProperty(propertyName);
                  if (!prop.getDefinition().isMultiple())
                  {
                     if (prop.getDefinition().getRequiredType() == PropertyType.UNDEFINED)
                     {
                        tmp[i] = valueFactory.createValue(prop.getString());
                     }
                     else
                     {
                        tmp[i] = prop.getValue();
                     }
                  }
                  else
                  {
                     // mvp values cannot be returned
View Full Code Here

      }

      PropertyIterator props = session.getRootNode().getProperties();
      while (props.hasNext())
      {
         PropertyImpl prop = (PropertyImpl)props.nextProperty();
         if (!prop.isMultiValued())
         {
            Value value = prop.getValue();
            nodesSize += ((ByteArrayInputStream)value.getStream()).available();
         }
         else
         {
            for (Value value : prop.getValues())
            {
               nodesSize += ((ByteArrayInputStream)value.getStream()).available();
            }
         }
      }
View Full Code Here

      assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(path)));
      Node node = session.getRootNode().getNode(TextUtil.relativizePath(path));
      assertTrue(node.hasNode("jcr:content"));
      Node node2 = node.getNode("jcr:content");
      assertTrue(node2.hasProperty("jcr:mimeType"));
      PropertyImpl property = (PropertyImpl)node2.getProperty("jcr:mimeType");
      assertEquals(headers.getFirst(HttpHeaders.CONTENT_TYPE), property.getString());
   }
View Full Code Here

      Node node = session.getRootNode().getNode(TextUtil.relativizePath(filename));
      assertTrue(node.hasNode("jcr:content"));
      Node node2 = node.getNode("jcr:content");
      assertTrue(node2.hasProperty("jcr:mimeType"));
      PropertyImpl property = (PropertyImpl)node2.getProperty("jcr:mimeType");
      assertEquals(MediaType.TEXT_HTML, property.getString());

      containerResponse = service(WebDAVMethods.GET, getPathWS() + "/" + filename, "", null, null);
      assertEquals(MediaType.TEXT_HTML, containerResponse.getHttpHeaders().getFirst(HttpHeaders.CONTENT_TYPE));
   }
View Full Code Here

      catalog.clear();

      // test by path

      Node testNode = root.addNode("testNode");
      PropertyImpl prop = (PropertyImpl)testNode.setProperty("test", "test");
      root.save();

      SessionEventMatcher matcher =
         new SessionEventMatcher(ExtendedEvent.READ, new QPath[]{prop.getData().getQPath()}, true, null,
            new InternalQName[]{Constants.NT_UNSTRUCTURED}, ntHolder);
      DummyAction dAction = new DummyAction();

      catalog.addAction(matcher, dAction);
View Full Code Here

   public void testCleanupSwapDirectory() throws Exception
   {
      Session s = (SessionImpl)repo.login(credentials, wsEntry.getName());
      Node testNode = s.getRootNode().getNode("TestWriteOperations");
      PropertyImpl property = (PropertyImpl)testNode.setProperty("name", new ByteArrayInputStream("test".getBytes()));
      testNode.save();
      WorkspaceContainerFacade wsc = repo.getWorkspaceContainer(s.getWorkspace().getName());
      JDBCWorkspaceDataContainer dataContainer =
         (JDBCWorkspaceDataContainer)wsc.getComponent(JDBCWorkspaceDataContainer.class);
      WorkspaceStorageConnection wscon = dataContainer.openConnection();
      if (wscon instanceof StatisticsJDBCStorageConnection)
      {
         wscon = ((StatisticsJDBCStorageConnection)wscon).getNestedWorkspaceStorageConnection();
      }
      JDBCStorageConnection con = (JDBCStorageConnection) wscon;
      File file =
         new File(dataContainer.containerConfig.spoolConfig.tempDirectory, con.getInternalId(property
            .getInternalIdentifier()) + "0.0");
      con.close();

      assertTrue(file.exists());
View Full Code Here

      }

      PropertyIterator props = session.getRootNode().getProperties();
      while (props.hasNext())
      {
         PropertyImpl prop = (PropertyImpl)props.nextProperty();
         if (!prop.isMultiValued())
         {
            Value value = prop.getValue();
            nodesSize += ((ByteArrayInputStream)value.getStream()).available();
         }
         else
         {
            for (Value value : prop.getValues())
            {
               nodesSize += ((ByteArrayInputStream)value.getStream()).available();
            }
         }
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.core.PropertyImpl

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.