Examples of JcrCallback


Examples of org.springmodules.jcr.JcrCallback

    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
        JcrTemplate template = new JcrTemplate(sf);
        template.execute(new JcrCallback() {
          public Object doInJcr(Session se) throws RepositoryException {
            se.save();
            return null;
          }
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

    try {
      tt.execute(new TransactionCallbackWithoutResult() {
        protected void doInTransactionWithoutResult(TransactionStatus status) {
          assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(sf));
          JcrTemplate template = new JcrTemplate(sf);
          template.execute(new JcrCallback() {
            public Object doInJcr(Session session) throws RepositoryException {
              return null;
            }
          });
        }
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

  public void testMultipleCommits() {
    for (int i = 0; i < 100; i++) {
      endTransaction();
      startNewTransaction();
      template.execute(new JcrCallback() {

        public Object doInJcr(Session session) throws IOException, RepositoryException {
          Node rootNode = session.getRootNode();
          Node one = rootNode.addNode("bla-bla-bla");
          one.setProperty("some prop", false);
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

        new TestingAuthenticationToken(new Object(), new Object(), new GrantedAuthority[] {}));

  }

  public void testWriteRights() {
    template.execute(new JcrCallback() {

      public Object doInJcr(Session session) throws IOException, RepositoryException {
        Node rootNode = session.getRootNode();
        Node one = rootNode.addNode("bla-bla-bla");
        one.setProperty("some prop", false);
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

        saveSmth();
        throw new RuntimeException("do rollback");
    }

    public void saveSmth() {
        template.execute(new JcrCallback() {

            public Object doInJcr(Session session) throws RepositoryException {
                Node root = session.getRootNode();
                log.info("starting from root node " + root);
                Node sample = root.addNode("sample node");
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

    saveSmth(nodeName, propertyName);
    throw new RuntimeException("do rollback");
  }

  public String saveSmth(final String nodeName, final String propertyName) {
    return (String) template.execute(new JcrCallback() {

      public Object doInJcr(Session session) throws RepositoryException {
        Node root = session.getRootNode();
        log.info("starting from root node " + root.getPath());
        Node sample = root.addNode(nodeName);
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

  public boolean checkNode(final String absPath) {
    return template.itemExists(absPath);
  }

  public Value getNodeProperty(final String absPath, final String propertyName) {
    return (Value) template.execute(new JcrCallback() {

      public Object doInJcr(Session session) throws RepositoryException {
        Item item = session.getItem(absPath);
        if (item instanceof Node)
          return ((Node) item).getProperty(propertyName).getValue();
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

    @Autowired
    private JcrContentExporter processor = null;

    @Before
    public void init() {
        template.execute(new JcrCallback() {
            public Object doInJcr(Session session) throws RepositoryException,
                    IOException {
                String folderName = "fileFolder";
                List<String> lFiles = Arrays.asList(new String[] { "log4j.xml",
                                                                   "jackrabbit-repository.xml" });      
View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

     */
    @Test
    public void testAddNodeIfDoesntExist() {
        assertNotNull("JCR Template is null.", template);

        template.execute(new JcrCallback() {
            public Object doInJcr(Session session) throws RepositoryException {
                Node root = session.getRootNode();

                logger.debug("Starting from root node.  node={}", root);

View Full Code Here

Examples of org.springmodules.jcr.JcrCallback

     * Adds file to repository.
     */
    @Test
    public void testAddFileIfDoesntExist() {
        @SuppressWarnings("unused")
        Node node = (Node) template.execute(new JcrCallback() {
            @SuppressWarnings("unchecked")
            public Object doInJcr(Session session) throws RepositoryException,
                    IOException {
                Node resultNode = null;

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.