Package org.springframework.extensions.jcr

Examples of org.springframework.extensions.jcr.JcrCallback


    if ( isKioskEnabled() ) {
      throw new RuntimeException( Messages.getInstance().getString( "JcrRepositoryFileDao.ERROR_0006_ACCESS_DENIED" ) ); //$NON-NLS-1$
    }
    Assert.notNull( fileId );
    Assert.notNull( versionId );
    jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        Node fileNode = session.getNodeByIdentifier( fileId.toString() );
        session.getWorkspace().getVersionManager().restore( fileNode.getPath(), versionId.toString(), true );
        return null;
View Full Code Here


  /**
   * {@inheritDoc}
   */
  @Override
  public boolean canUnlockFile( final Serializable fileId ) {
    return (Boolean) 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() );
        Lock lock = session.getWorkspace().getLockManager().getLock( fileNode.getPath() );
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public RepositoryFileTree getTree( final RepositoryRequest repositoryRequest ) {
    Assert.hasText( repositoryRequest.getPath() );
    return (RepositoryFileTree) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        String absPath = pathConversionHelper.relToAbs( repositoryRequest.getPath() );
        return JcrRepositoryFileUtils.getTree( session, pentahoJcrConstants, pathConversionHelper, lockHelper, absPath,
View Full Code Here

  @Deprecated
  public RepositoryFileTree getTree( final String relPath, final int depth, final String filter,
      final boolean showHidden ) {
    Assert.hasText( relPath );
    final RepositoryRequest repositoryRequest = new RepositoryRequest( relPath, showHidden, depth, filter );
    return (RepositoryFileTree) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        String absPath = pathConversionHelper.relToAbs( relPath );
        return JcrRepositoryFileUtils.getTree( session, pentahoJcrConstants, pathConversionHelper, lockHelper, absPath,
View Full Code Here

  public List<RepositoryFile> getReferrers( final Serializable fileId ) {
    if ( fileId == null ) {
      return new ArrayList<RepositoryFile>();
    }

    return (List<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() );
View Full Code Here

  public void setFileMetadata( final Serializable fileId, final Map<String, Serializable> metadataMap ) {
    if ( isKioskEnabled() ) {
      throw new RuntimeException( Messages.getInstance().getString( "JcrRepositoryFileDao.ERROR_0006_ACCESS_DENIED" ) ); //$NON-NLS-1$
    }
    Assert.notNull( fileId );
    jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        JcrRepositoryFileUtils.setFileMetadata( session, fileId, metadataMap );
        return null;
      }
View Full Code Here

  @Override
  @SuppressWarnings( "unchecked" )
  public Map<String, Serializable> getFileMetadata( final Serializable fileId ) {
    Assert.notNull( fileId );
    return (Map<String, Serializable>) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( Session session ) throws IOException, RepositoryException {
        return JcrRepositoryFileUtils.getFileMetadata( session, fileId );
      }
    } );
View Full Code Here

    }

    Assert.notNull( repositoryFile );
    Assert.notNull( locale );
    Assert.notNull( properties );
    jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        String versionMessage =
            Messages.getInstance().getString( "JcrRepositoryFileDao.LOCALE_0001_UPDATE_PROPERTIES",
View Full Code Here

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

    Assert.notNull( repositoryFile );
    Assert.notNull( locale );
    jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        String versionMessage =
            Messages.getInstance().getString( "JcrRepositoryFileDao.LOCALE_0002_DELETE_PROPERTIES",
View Full Code Here

      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 internalUpdateFolder( session, pentahoJcrConstants, file, versionMessage );
      }
View Full Code Here

TOP

Related Classes of org.springframework.extensions.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.