1 31 32 package org.opencms.search.documents; 33 34 import org.opencms.file.CmsFile; 35 import org.opencms.file.CmsObject; 36 import org.opencms.file.CmsResource; 37 import org.opencms.main.CmsException; 38 import org.opencms.search.A_CmsIndexResource; 39 import org.opencms.search.CmsIndexException; 40 import org.opencms.search.extractors.CmsExtractorMsPowerPoint; 41 import org.opencms.search.extractors.I_CmsExtractionResult; 42 43 53 public class CmsDocumentMsPowerPoint extends A_CmsVfsDocument { 54 55 60 public CmsDocumentMsPowerPoint(String name) { 61 62 super(name); 63 } 64 65 70 public I_CmsExtractionResult extractContent(CmsObject cms, A_CmsIndexResource indexResource, String language) 71 throws CmsIndexException, CmsException { 72 73 CmsResource resource = (CmsResource)indexResource.getData(); 74 CmsFile file = readFile(cms, resource); 75 76 try { 77 return CmsExtractorMsPowerPoint.getExtractor().extractText(file.getContents()); 78 } catch (Exception e) { 79 throw new CmsIndexException( 80 Messages.get().container(Messages.ERR_TEXT_EXTRACTION_1, resource.getRootPath()), 81 e); 82 } 83 } 84 } | Popular Tags |