Package org.springframework.extensions.jcr

Examples of org.springframework.extensions.jcr.JcrTemplate


  }

  public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
    manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean( "backingRepositoryLifecycleManager" );
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );
    repositoryAdminUsername = (String) applicationContext.getBean( "repositoryAdminUsername" );
    authenticatedRoleName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );
    adminRoleName = (String) applicationContext.getBean( "singleTenantAdminAuthorityName" );
View Full Code Here


  }

  public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
    manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean( "backingRepositoryLifecycleManager" );
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );
    repositoryAdminUsername = (String) applicationContext.getBean( "repositoryAdminUsername" );
    authenticatedRoleName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );
    adminRoleName = (String) applicationContext.getBean( "singleTenantAdminAuthorityName" );
View Full Code Here

  }

  @Override
  public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );

    jcrTemplate = (JcrTemplate) applicationContext.getBean("jcrTemplate");
View Full Code Here

    } else {
      tmpMode = Mode.CUSTOM;
    }
    final Mode mode = tmpMode;
    if ( fileName != null ) {
      final JcrTemplate jcrTemplate = PentahoSystem.get( JcrTemplate.class, "jcrTemplate", pentahoSession ); //$NON-NLS-1$
      TransactionTemplate txnTemplate =
          PentahoSystem.get( TransactionTemplate.class, "jcrTransactionTemplate", pentahoSession ); //$NON-NLS-1$
      String repositoryAdminUsername = PentahoSystem.get( String.class, "repositoryAdminUsername", pentahoSession ); //$NON-NLS-1$

      final String ZIP_EXTENSION = ".zip"; //$NON-NLS-1$
      // let the user know this is a zip
      if ( !fileName.endsWith( ZIP_EXTENSION ) ) {
        fileName = fileName + ZIP_EXTENSION;
      }
      logger.debug( String.format( "dumping repository to file \"%s\"", fileName ) ); //$NON-NLS-1$
      ZipOutputStream tmpOut = null;
      try {
        tmpOut = new ZipOutputStream( new BufferedOutputStream( FileUtils.openOutputStream( new File( fileName ) ) ) );
      } catch ( IOException e ) {
        IOUtils.closeQuietly( tmpOut );
        throw new RuntimeException( e );
      }
      final ZipOutputStream out = tmpOut;
      // stash existing session
      IPentahoSession origPentahoSession = PentahoSessionHolder.getSession();
      // run as repo super user
      PentahoSessionHolder.setSession( createRepositoryAdminPentahoSession( repositoryAdminUsername ) );
      try {
        txnTemplate.execute( new TransactionCallbackWithoutResult() {
          public void doInTransactionWithoutResult( final TransactionStatus status ) {
            jcrTemplate.execute( new JcrCallback() {
              public Object doInJcr( final Session session ) throws RepositoryException, IOException {
                switch ( mode ) {
                  case SYS: {
                    final boolean SKIP_BINARY = false;
                    final boolean NO_RECURSE = false;
View Full Code Here


  public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
    manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean( "backingRepositoryLifecycleManager" );
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );
    repositoryAdminUsername = (String) applicationContext.getBean( "repositoryAdminUsername" );
    authenticatedAuthorityName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );
    adminAuthorityName = (String) applicationContext.getBean( "singleTenantAdminAuthorityName" );
View Full Code Here

  @Override
  public void setApplicationContext( final ApplicationContext applicationContext ) throws BeansException {
    manager = (IBackingRepositoryLifecycleManager) applicationContext.getBean( "backingRepositoryLifecycleManager" );
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );
    repositoryAdminUsername = (String) applicationContext.getBean( "repositoryAdminUsername" );
    tenantAuthenticatedAuthorityName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );
    adminAuthorityName = (String) applicationContext.getBean( "singleTenantAdminAuthorityName" );
View Full Code Here

  }

  @Override
  public void setApplicationContext( ApplicationContext applicationContext ) throws BeansException {
    SessionFactory jcrSessionFactory = (SessionFactory) applicationContext.getBean( "jcrSessionFactory" );
    testJcrTemplate = new JcrTemplate( jcrSessionFactory );
    testJcrTemplate.setAllowCreate( true );
    testJcrTemplate.setExposeNativeSession( true );

    jcrTemplate = (JcrTemplate) applicationContext.getBean( "jcrTemplate" );
View Full Code Here

TOP

Related Classes of org.springframework.extensions.jcr.JcrTemplate

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.