Package lius.index.JCR

Examples of lius.index.JCR.JCRIndexer


         DatabaseUtil dbUtil = DatabaseUtil.getSingleton();
         try {
             DatabaseUtil.getSingleton().beginTransaction(SystemPrincipal.getCredentials());
             LiusConfig lc =  LiusConfigBuilder.getSingletonInstance().getLiusConfig(IndexerServlet.getIndexConfigFilePath());
            
             JCRIndexer indexer = new JCRIndexer();
             indexer.setUp(lc);
            
             List folders = FolderDao.createInstance().list();
             for (Iterator it = folders.iterator(); it.hasNext(); ) {
                 Folder folder = (Folder) it.next();
                 Session jcrSession = (Session) DatabaseUtil.getSingleton().getDaoSession();
                
                 indexer.setJcrNode(jcrSession.getNodeByUUID(folder.getId()));
                 try {
                     indexer.index(IndexerServlet.getIndexDir());
                 } catch (Exception e) {
                     e.printStackTrace();
                 }

                 //IndexEventListener.getInstance()
                
             }
            
             indexer.closeIndex();
            
             dbUtil.commitTransaction();
         } catch (Exception e) {
             e.printStackTrace();
             dbUtil.rollbackTransaction();
View Full Code Here


        return folderPath;
    }
   
    private void indexFolder(Node folderNode) {
        // Attention à l'héritage: cause d'erreurs abobinables
        JCRIndexer indexer = null;
        try {
            indexer = new JCRIndexer();
            indexer.setUp(this.lc);
            indexer.setJcrNode(folderNode);
            indexer.index(this.indexDir);

            // FIXME Valeur spéciale, que seul le système peut connaître. Sert à logger l'indexation.
            // node.setProperty(NodesTypes.PREFIX +
            // FolderDao.INDEX_STATE_PROPERTY_NAME, "ok");

            // session.save();

            System.out.println("%%%%%%%%%%%%%%%%%%%%% Indexing done %%%%%%%%%%%%%%%%%%%%%%%");
        } finally {
            if (indexer != null) {
                indexer.closeIndex();
            }
        }
    }
View Full Code Here

                  Node node = (Node) item;
                  // Node added is a folder
                  if (node.getPrimaryNodeType().getName().equals(NodesTypes.PREFIX + FolderDao.NAME)) {
                    // Attention à l'héritage, cause d'erreurs
                    // abobinables
                    JCRIndexer indexer = new JCRIndexer();
                    indexer.setUp(SearchIndexManager_backup.this.lc);

                    indexer.setJcrNode(session.getNodeByUUID(folder.getId()));
 
                    // Attention: ne pas utiliser, car appelle
                    // la mauvaise méthode
                    // indexer.index(SearchIndexManager.this.indexDir);
                   
                    indexer.index(SearchIndexManager_backup.this.indexDir);
                   
                    System.out.println("%%%%%%%%%%%%%%%%%%%%% Indexing done %%%%%%%%%%%%%%%%%%%%%%%");
                    // No need to observe anymore
                    //session.getWorkspace().getObservationManager().removeEventListener(this);
 
View Full Code Here

TOP

Related Classes of lius.index.JCR.JCRIndexer

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.