Examples of JcrTemplate


Examples of com.btmatthews.atlas.jcr.impl.JCRTemplate

     * @return A {@link JCRTemplate} object.
     */
    @Bean
    @Autowired
    public JCRAccessor jcrTemplate(final SessionFactory sessionFactory) {
        return new JCRTemplate(sessionFactory, credentialsProvider);
    }
View Full Code Here

Examples of com.btmatthews.atlas.jcr.impl.JCRTemplate

     * @return A {@link JCRTemplate} object.
     */
    @Bean
    @Autowired
    public JCRAccessor jcrTemplate(final SessionFactory sessionFactory) {
        return new JCRTemplate(sessionFactory, credentialsProvider);
    }
View Full Code Here

Examples of org.jahia.services.content.JCRTemplate

                ignoredCount++;
                return;
            }

            if ((nodeIdentifier != null) && (ignoreNodeTypes.size() > 0)) {
                final JCRTemplate tpl = JCRTemplate.getInstance();
                String matchingNodeType = null;
                try {
                    matchingNodeType = tpl.doExecuteWithSystemSession(new JCRCallback<String>() {
                        public String doInJCR(JCRSessionWrapper session) throws RepositoryException {
                            JCRNodeWrapper node = session.getNodeByIdentifier(nodeIdentifier);
                            if (node != null) {
                                for (String ignoreNodeType : ignoreNodeTypes) {
                                    if (node.isNodeType(ignoreNodeType)) {
View Full Code Here

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

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

Examples of org.springframework.extensions.jcr.JcrTemplate

  }

  @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

Examples of org.springframework.extensions.jcr.JcrTemplate

    } 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

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" );
    authenticatedAuthorityName = (String) applicationContext.getBean( "singleTenantAuthenticatedAuthorityName" );
    adminAuthorityName = (String) applicationContext.getBean( "singleTenantAdminAuthorityName" );
View Full Code Here

Examples of org.springframework.extensions.jcr.JcrTemplate

  @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

Examples of org.springframework.extensions.jcr.JcrTemplate

  }

  @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
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.