Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.MetaInfo


                if (metaNames.contains(metaEntry.getName())) {
                    throw new WGSchemaValidationException("Duplicate meta definition '" + metaEntry.getName() + "' on '" + docDef.getDocumentKey() + "'.");
                }           
                metaNames.add(metaEntry.getName());
               
                MetaInfo metaInfo = WGFactory.getInstance().getMetaInfo(metaEntry.getName(), WGDocument.doctypeNumberToClass(docDef.getDocumentType()));
                if (metaInfo == null) {
                    throw new WGSchemaValidationException("Unknown metadata field '" + metaEntry.getName() + "' predefined for document " + docDef.getDocumentKey());
                }
               
                if (metaEntry.getValues().size() > 0) {
                    Object singleValue = metaEntry.getValues().get(0);
                    if (singleValue != null && !metaInfo.getDataType().isAssignableFrom(singleValue.getClass())) {
                        throw new WGSchemaValidationException("Metadata field '" + metaEntry.getName() + "' predefined with value of wrong type " + singleValue.getClass().getName() + " (Should be " + metaInfo.getDataType() ") for document " + docDef.getDocumentKey());
                    }
                }
               
            }
           
View Full Code Here


       
        // init metakeywords - used during search analysis
        Iterator metaInfos = WGFactory.getInstance().getMetaInfos(WGContent.class).values().iterator();
        _metaKeywordFields = new HashSet();
        while (metaInfos.hasNext()) {
            MetaInfo metaInfo = (MetaInfo) metaInfos.next();
            //B0000485A
            if (metaInfo.getLuceneIndexType() == MetaInfo.LUCENE_INDEXTYPE_KEYWORD) {
              if (!_metaKeywordFields.contains(metaInfo.getName())) {
                  _metaKeywordFields.add(metaInfo.getName());
                  Iterator synonyms = metaInfo.getSynonyms().iterator();
                  while (synonyms.hasNext()) {
                      String synonym = (String) synonyms.next();
                      _metaKeywordFields.add(synonym);
                  }
              }
View Full Code Here

            }
           
            Iterator contentMetaNames = content.getMetaNames().iterator();
            while (contentMetaNames.hasNext()) {
                String metaName = (String) contentMetaNames.next();
                MetaInfo metaInfo = (MetaInfo) content.getMetaInfo(metaName);
                if (metaInfo == null) {
                    throw new WGSystemException("MetaInfo for meta '" + metaName + "' not found.");
                }
                if (!metaInfo.isLuceneSpecialTreatment() && !metaInfo.getLuceneIndexType().equals(MetaInfo.LUCENE_INDEXTYPE_NOINDEX)) {
                    addMeta(document, metaInfo, content.getMetaData(metaName));
                } else {
                    if (metaInfo.getName().equals(WGContent.META_IS_HIDDEN_FROM)) {
                        // split hidden from
                        List isHiddenFrom = content.isHiddenFrom();
                        addKeyword(document, "HIDDENINNAV", Boolean.valueOf(isHiddenFrom.contains(WGContent.DISPLAYTYPE_NAVIGATOR)), metaInfo.getLuceneBoost());
                        addSortField(document, "HIDDENINNAV", Boolean.valueOf(isHiddenFrom.contains(WGContent.DISPLAYTYPE_NAVIGATOR)));
                        addKeyword(document, "HIDDENINSEARCH", Boolean.valueOf(isHiddenFrom.contains(WGContent.DISPLAYTYPE_SEARCH)), metaInfo.getLuceneBoost());
                        addSortField(document, "HIDDENINSEARCH", Boolean.valueOf(isHiddenFrom.contains(WGContent.DISPLAYTYPE_SEARCH)));
                        addKeyword(document, "HIDDENINSITEMAP", Boolean.valueOf(isHiddenFrom.contains(WGContent.DISPLAYTYPE_SITEMAP)), metaInfo.getLuceneBoost());
                        addSortField(document, "HIDDENINSITEMAP", Boolean.valueOf(isHiddenFrom.contains(WGContent.DISPLAYTYPE_SITEMAP)));
                    } else if (metaInfo.getName().equals(WGContent.META_VALID_FROM)) {
                        // bugfix B00003432 by tb 10.03.2006
                        if (content.getValidFrom() != null) {
                            addKeyword(document, WGContent.META_VALID_FROM, content.getValidFrom(), metaInfo.getLuceneBoost());
                            addSortField(document, WGContent.META_VALID_FROM, content.getValidFrom());
                        } else {
                            // index not set validFrom as 00000 ...
                            addKeyword(document, WGContent.META_VALID_FROM, EMPTY_VALID_FROM, metaInfo.getLuceneBoost());
                            addSortField(document, WGContent.META_VALID_FROM, EMPTY_VALID_FROM);
                        }
                    } else if (metaInfo.getName().equals(WGContent.META_VALID_TO)) {
                        // bugfix B00003432 by tb 10.03.2006
                        if (content.getValidTo() != null) {               
                            addKeyword(document, WGContent.META_VALID_TO, content.getValidTo(), metaInfo.getLuceneBoost());
                            addSortField(document, WGContent.META_VALID_TO, content.getValidTo());
                        } else {
                            // index not set validTo as 99999...
                            addKeyword(document, WGContent.META_VALID_TO, EMPTY_VALID_TO, metaInfo.getLuceneBoost());
                            addSortField(document, WGContent.META_VALID_TO, EMPTY_VALID_TO);
                        }
                    }
                }
            }                       
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.MetaInfo

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.