Package org.springmodules.jcr

Examples of org.springmodules.jcr.JcrCallback


    /**
     * @see org.springmodules.jcr.mapping.JcrMappingOperations#execute(org.springmodules.jcr.mapping.JcrMappingCallback, boolean)
     */
    public Object execute(final JcrMappingCallback action, boolean exposeNativeSession) throws DataAccessException {
        return execute(new JcrCallback() {
            /**
             * @see org.springmodules.jcr.JcrCallback#doInJcr(javax.jcr.Session)
             */
            public Object doInJcr(Session session) throws RepositoryException {
                try {
View Full Code Here


    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 se) throws RepositoryException {
              se.save();
              throw new RuntimeException();
            }
View Full Code Here

    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

    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

  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

        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

        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

    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

  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

    @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

TOP

Related Classes of org.springmodules.jcr.JcrCallback

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.