Package org.springframework.extensions.jcr

Examples of org.springframework.extensions.jcr.JcrCallback


  private void executeOperation( final SessionOperation op ) {
    try {
      if ( node.getSession().isLive() ) {
        op.execute( node.getSession() );
      } else {
        template.execute( new JcrCallback() {
          @Override
          public Object doInJcr( Session session ) throws IOException, RepositoryException {
            node = (Node) session.getItem( absPath );
            op.execute( node.getSession() );
            return null;
View Full Code Here


    // this line necessary for Spring Security's MethodSecurityInterceptor
    SecurityContextHolder.getContext().setAuthentication( auth );
  }

  private void setAclManagement() {
    testJcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( Session session ) throws IOException, RepositoryException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Workspace workspace = session.getWorkspace();
        PrivilegeManager privilegeManager = ( (JackrabbitWorkspace) workspace ).getPrivilegeManager();
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public RoleBindingStruct getRoleBindingStruct( final String locale ) {
    return (RoleBindingStruct) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        return getRoleBindingStruct( session, null, locale );
      }
    } );
View Full Code Here

  @Override
  public RoleBindingStruct getRoleBindingStruct( final ITenant tenant, final String locale ) {
    if ( ( tenant != null ) && !TenantUtils.isAccessibleTenant( tenant ) ) {
      return new RoleBindingStruct( new HashMap<String, String>(), new HashMap<String, List<String>>(), new HashSet<String>() );
    }
    return (RoleBindingStruct) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        return getRoleBindingStruct( session, tenant, locale );
      }
    } );
View Full Code Here

    }
    if ( !TenantUtils.isAccessibleTenant( tempTenant ) ) {
      throw new NotFoundException( "Tenant " + tenant.getId() + " not found" );
    }
    Assert.notNull( logicalRoleNames );
    jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        setRoleBindings( session, tenant, runtimeRoleName, logicalRoleNames );
        return null;
      }
View Full Code Here

   */
  @Override
  @SuppressWarnings( "unchecked" )
  public List<String> getBoundLogicalRoleNames( final List<String> runtimeRoleNames ) {
    // what runtimeRoleNames are in the cache; we don't need to fetch them
    return (List<String>) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        return getBoundLogicalRoleNames( session, runtimeRoleNames );
      }
    } );
View Full Code Here

  public List<String> getBoundLogicalRoleNames( final ITenant tenant, final List<String> runtimeRoleNames ) {
    if ( ( tenant != null ) && !TenantUtils.isAccessibleTenant( tenant ) ) {
      return new ArrayList<String>();
    }
    // what runtimeRoleNames are in the cache; we don't need to fetch them
    return (List<String>) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException, IOException {
        return getBoundLogicalRoleNames( session, tenant, runtimeRoleNames );
      }
    } );
View Full Code Here

  }

  private void createCustomPrivilege() {
    txnTemplate.execute( new TransactionCallbackWithoutResult() {
      public void doInTransactionWithoutResult( final TransactionStatus status ) {
        adminJcrTemplate.execute( new JcrCallback() {
          @Override
          public Object doInJcr( Session session ) throws IOException, RepositoryException {
            PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
            Workspace workspace = session.getWorkspace();
            PrivilegeManager privilegeManager = ( (JackrabbitWorkspace) workspace ).getPrivilegeManager();
View Full Code Here

  public String getTenantAdminRoleName() {
    return tenantAdminRoleName;
  }

  private void setAclManagement() {
    testJcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( Session session ) throws IOException, RepositoryException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Workspace workspace = session.getWorkspace();
        PrivilegeManager privilegeManager = ( (JackrabbitWorkspace) workspace ).getPrivilegeManager();
View Full Code Here

    this.jcrTemplate = jcrTemplate;
  }

  private RepositoryFile createTenantFolder( final ITenant parentTenant, final String tenantName,
      final String tenantCreatorId ) {
    return (RepositoryFile) jcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( final Session session ) throws RepositoryException {
        Tenant tenant = null;
        RepositoryFile parentFolder = null;
        if ( parentTenant == null ) {
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.