Class DocxContentImporter
- java.lang.Object
-
- org.ametys.plugins.webcontentio.docx.DocxContentImporter
-
- All Implemented Interfaces:
ContentImporter,Contextualizable,Serviceable
public class DocxContentImporter extends Object implements ContentImporter, Serviceable, Contextualizable
Imports Docx files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classDocxContentImporter.DocxPrefixResolver
-
Field Summary
Fields Modifier and Type Field Description private Context_contextprivate DOMParser_domParserprotected ServiceManager_managerThe service managerprivate SourceResolver_resolverprivate XPathProcessor_xPathProcessor
-
Constructor Summary
Constructors Constructor Description DocxContentImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_getContentType(String contentType)private Document_getDocument(ZipFile zipFile, String entryName, File file)voidcontextualize(Context context)String[]getMimeTypes()Returns all mime types handled by this importer.voidimportContent(File file, ModifiableWebContent content, Map<String,String> params)Extracts file content and populates the givenContent.voidpostTreatment(ModifiablePage page, Content content, File file)Post treatment after import processvoidservice(ServiceManager manager)
-
-
-
Field Detail
-
_manager
protected ServiceManager _manager
The service manager
-
_resolver
private SourceResolver _resolver
-
_domParser
private DOMParser _domParser
-
_xPathProcessor
private XPathProcessor _xPathProcessor
-
-
Constructor Detail
-
DocxContentImporter
public DocxContentImporter()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
importContent
public void importContent(File file, ModifiableWebContent content, Map<String,String> params) throws IOException
Description copied from interface:ContentImporterExtracts file content and populates the givenContent. Typical usage is to provide a newly created empty Content.- Specified by:
importContentin interfaceContentImporter- Parameters:
file- the source.content- theContentto be populated.params- in/out params to set and get additional data to and from the importer.- Throws:
IOException- if an error occurs processing the stream.
-
_getContentType
private String _getContentType(String contentType)
-
getMimeTypes
public String[] getMimeTypes()
Description copied from interface:ContentImporterReturns all mime types handled by this importer.- Specified by:
getMimeTypesin interfaceContentImporter- Returns:
- all mime types handled by this importer.
-
postTreatment
public void postTreatment(ModifiablePage page, Content content, File file) throws IOException
Description copied from interface:ContentImporterPost treatment after import process- Specified by:
postTreatmentin interfaceContentImporter- Parameters:
page- The created pagecontent- The created contentfile- The imported file- Throws:
IOException- if an error occurred
-
_getDocument
private Document _getDocument(ZipFile zipFile, String entryName, File file) throws IOException
- Throws:
IOException
-
-