Examples of JcrCallback


Examples of org.springframework.extensions.jcr.JcrCallback

  @Override
  public RepositoryFile getFile( final String relPath, final boolean loadLocaleMaps, final IPentahoLocale locale ) {
    Assert.hasText( relPath );
    Assert.isTrue( relPath.startsWith( RepositoryFile.SEPARATOR ) );

    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        String absPath = pathConversionHelper.relToAbs( relPath );
        return internalGetFile( session, absPath, loadLocaleMaps, locale );
      }
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  }

  private RepositoryFile internalGetFileById( final Serializable fileId, final boolean loadMaps,
      final IPentahoLocale locale ) {
    Assert.notNull( fileId );
    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Node fileNode = session.getNodeByIdentifier( fileId.toString() );
        RepositoryFile file =
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

   */
  @Override
  public RepositoryFile getFileByAbsolutePath( final String absPath ) {
    Assert.hasText( absPath );
    Assert.isTrue( absPath.startsWith( RepositoryFile.SEPARATOR ) );
    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        return internalGetFile( session, absPath, false, null );
      }
    } );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

   */
  @Override
  public RepositoryFile getFile( final String relPath, final boolean loadMaps ) {
    Assert.hasText( relPath );
    Assert.isTrue( relPath.startsWith( RepositoryFile.SEPARATOR ) );
    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        String absPath = pathConversionHelper.relToAbs( relPath );
        return internalGetFile( session, absPath, loadMaps, null );
      }
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  @Override
  @SuppressWarnings( "unchecked" )
  public <T extends IRepositoryFileData> T getData( final Serializable fileId, final Serializable versionId,
      final Class<T> contentClass ) {
    Assert.notNull( fileId );
    return (T) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        IRepositoryFileData data =
            JcrRepositoryFileUtils.getContent( session, pentahoJcrConstants, fileId, versionId, findTransformerForRead(
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

   */
  @Override
  @SuppressWarnings( "unchecked" )
  public List<RepositoryFile> getChildren( final RepositoryRequest repositoryRequest ) {
    Assert.notNull( repositoryRequest.getPath() );
    return (List<RepositoryFile>) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        return JcrRepositoryFileUtils.getChildren( session, pentahoJcrConstants, pathConversionHelper, lockHelper,
            repositoryRequest );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  @Override
  @SuppressWarnings( "unchecked" )
  public List<RepositoryFile> getChildren( final Serializable folderId, final String filter,
      final Boolean showHiddenFiles ) {
    Assert.notNull( folderId );
    return (List<RepositoryFile>) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        return JcrRepositoryFileUtils.getChildren( session, pentahoJcrConstants, pathConversionHelper, lockHelper,
            folderId, filter, showHiddenFiles );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

      throw new RuntimeException( Messages.getInstance().getString( "JcrRepositoryFileDao.ERROR_0006_ACCESS_DENIED" ) ); //$NON-NLS-1$
    }

    Assert.notNull( file );
    Assert.isTrue( !file.isFolder() );
    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        return internalUpdateFile( session, pentahoJcrConstants, file, content, versionMessage );
      }
View Full Code Here

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

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