Examples of JcrCallback


Examples of org.springframework.extensions.jcr.JcrCallback

  @Override
  public List<IPentahoUser> getRoleMembers( final ITenant tenant, final String roleName )
    throws UncategorizedUserRoleDaoException {
    try {
      return (List<IPentahoUser>) adminJcrTemplate.execute( new JcrCallback() {
        @Override
        public Object doInJcr( Session session ) throws IOException, RepositoryException {
          return getRoleMembers( session, tenant, roleName );
        }
      } );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  @Override
  public List<IPentahoRole> getUserRoles( final ITenant tenant, final String userName )
    throws UncategorizedUserRoleDaoException {
    try {
      return (List<IPentahoRole>) adminJcrTemplate.execute( new JcrCallback() {
        @Override
        public Object doInJcr( Session session ) throws IOException, RepositoryException {
          return getUserRoles( session, tenant, userName );
        }
      } );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  /**
   * {@inheritDoc}
   */
  @SuppressWarnings( "unchecked" )
  public List<RepositoryFileAce> getEffectiveAces( final Serializable id, final boolean forceEntriesInheriting ) {
    return (List<RepositoryFileAce>) jcrTemplate.execute( new JcrCallback() {
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        Node node = session.getNodeByIdentifier( id.toString() );

        if ( node == null ) {
          throw new RepositoryException( Messages.getInstance().getString(
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  /**
   * {@inheritDoc}
   */
  public boolean hasAccess( final String relPath, final EnumSet<RepositoryFilePermission> permissions ) {
    return (Boolean) jcrTemplate.execute( new JcrCallback() {
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        DefaultPermissionConversionHelper permissionConversionHelper = new DefaultPermissionConversionHelper( session );
        Privilege[] privs = permissionConversionHelper.pentahoPermissionsToPrivileges( session, permissions );
        try {
          String absPath = pathConversionHelper.relToAbs( relPath );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  public RepositoryFileAcl createAcl( final Serializable fileId, final RepositoryFileAcl acl ) {
    if ( isKioskEnabled() ) {
      throw new RuntimeException( Messages.getInstance().getString( "JcrRepositoryFileDao.ERROR_0006_ACCESS_DENIED" ) ); //$NON-NLS-1$
    }

    return (RepositoryFileAcl) jcrTemplate.execute( new JcrCallback() {
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Node node = session.getNodeByIdentifier( fileId.toString() );
        String absPath = node.getPath();
        AccessControlManager acMgr = session.getAccessControlManager();
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

    }
    throw new IllegalStateException( "no access control list applies or is bound to node" );
  }

  public RepositoryFileAcl getAcl( final Serializable id ) {
    return (RepositoryFileAcl) jcrTemplate.execute( new JcrCallback() {
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        return toAcl( session, pentahoJcrConstants, id );
      }
    } );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

      }
    } );
  }

  protected RepositoryFileAcl getParentAcl( final Serializable id ) {
    return (RepositoryFileAcl) jcrTemplate.execute( new JcrCallback() {
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Node node = session.getNodeByIdentifier( id.toString() );
        if ( !node.getParent().isSame( session.getRootNode() ) ) {
          return toAcl( session, pentahoJcrConstants, node.getParent().getIdentifier() );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  public void setFullControl( Serializable id, RepositoryFileSid sid, RepositoryFilePermission permission ) {
    addAce( id, sid, EnumSet.of( permission ) );
  }

  public RepositoryFileAcl updateAcl( final RepositoryFileAcl acl ) {
    return (RepositoryFileAcl) jcrTemplate.execute( new JcrCallback() {
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        JcrRepositoryFileUtils.checkoutNearestVersionableFileIfNecessary( session, pentahoJcrConstants, acl.getId() );
        RepositoryFileAcl updatedAcl = internalUpdateAcl( session, pentahoJcrConstants, acl.getId(), acl );
        JcrRepositoryFileUtils.checkinNearestVersionableFileIfNecessary( session, pentahoJcrConstants, acl.getId(),
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

    // Assert.notNull(content);
    DataNode emptyDataNode = new DataNode( file.getName() );
    emptyDataNode.setProperty( " ", "content" ); //$NON-NLS-1$ //$NON-NLS-2$
    final IRepositoryFileData emptyContent = new NodeRepositoryFileData( emptyDataNode );

    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        JcrRepositoryFileUtils.checkoutNearestVersionableFileIfNecessary( session, pentahoJcrConstants, parentFolderId );
        Node fileNode =
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrCallback

  public RepositoryFile createFolder( final Serializable parentFolderId, final RepositoryFile folder,
      final RepositoryFileAcl acl, final String versionMessage ) {
    Assert.notNull( folder );
    Assert.isTrue( folder.isFolder() );

    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        return internalCreateFolder( session, parentFolderId, folder, acl, versionMessage );
      }
    } );
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.