Examples of LiusField


Examples of lius.config.LiusField

                    Collection toIndex = (Collection) nodeEntry.getValue();
                    Collection toIndex2 = new ArrayList();

          for (Iterator fieldsIt = toIndex.iterator(); fieldsIt.hasNext(); ){
            LiusField lf = (LiusField) fieldsIt.next();

            //Le champs courrant : requ�te sur les enfants du <node> s�lectionn� plus haut
            String fieldXPathQuery = "/jcr:root" + JcrUtil.xmlEncodePath(selectNode) + "/" + lf.getXpathSelect();
                        log.info(fieldXPathQuery);
                       
                        Query fieldQuery = qm.createQuery(fieldXPathQuery, Query.XPATH);
                        QueryResult fieldQueryResults = fieldQuery.execute();
            boolean found = false;
                        //Nodes
                        for (NodeIterator nodesToIndexIterator = fieldQueryResults.getNodes(); nodesToIndexIterator.hasNext(); ) {
                            Node nodeToIndex = nodesToIndexIterator.nextNode();
              if (nodeToIndex.getPrimaryNodeType().getName().equals("nt:file")) {
                               
                                Node jcrContent = nodeToIndex.getNode("jcr:content");
                Property prop = jcrContent.getProperty("jcr:mimeType");
                                String mimeType = prop.getString();
                               
                Property content = jcrContent.getProperty("jcr:data");
                InputStream is = content.getStream();
                                Indexer indexer = IndexerFactory.getIndexer(is, mimeType, getLiusConfig());
                               
                                if (indexer == null) {
                                    System.out.println(prop.getString());
                                    System.out.println(nodeToIndex.getName());
                                }
                                else{
                                    lf.setValue(indexer.getContent());
                                    LiusField newLiusField = new LiusField();
                                    BeanUtils.copyProperties(newLiusField, lf);

                                    toIndex2.add(newLiusField);
                                    found = true;
   
                                }
                               
                                              }
            }
                        if (!found) {
                            //Rows/Properties
                for (RowIterator propertiesToIndexIterator = fieldQueryResults.getRows(); propertiesToIndexIterator.hasNext(); ) {
                  Row row = propertiesToIndexIterator.nextRow();
                                //FIXME Premi�re valeur seulement ??
                                String[] columnNames = fieldQueryResults.getColumnNames();
                                for (int i = 0; i < columnNames.length; i++){

                                    if ((columnNames[i].equals("jcr:path") && columnNames.length != 2) || columnNames[i].equals("jcr:score")) {
                                        continue;
                                    }

                                    Value currentVal = row.getValue(columnNames[i]);
                                    if (currentVal != null) {
                                      lf.setValue(currentVal.getString());
                                    } else {
                                      lf.setValue("");
                                    }
                                   

                                    LiusField newLiusField = new LiusField();
                                    BeanUtils.copyProperties(newLiusField, lf);

                                    toIndex2.add(newLiusField);
                                }
                }
View Full Code Here

Examples of lius.config.LiusField

                System.out.println("No folder found for index value id: " + values[0]);
                continue;
            }
           
            StringBuffer excerptBuffer = new StringBuffer();
            LiusField lf = (LiusField) fields.get("content");
            if (lf != null) {
              String[] excerpt = ((LiusField) fields.get("content")).getValues();
              for (int j = 0; j < excerpt.length; j++) {
                  excerptBuffer.append(excerpt[j]);
              }
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.