Example usage for org.apache.poi.hpsf.wellknown PropertyIDMap PID_LASTSAVE_DTM

List of usage examples for org.apache.poi.hpsf.wellknown PropertyIDMap PID_LASTSAVE_DTM

Introduction

In this page you can find the example usage for org.apache.poi.hpsf.wellknown PropertyIDMap PID_LASTSAVE_DTM.

Prototype

int PID_LASTSAVE_DTM

To view the source code for org.apache.poi.hpsf.wellknown PropertyIDMap PID_LASTSAVE_DTM.

Click Source Link

Document

ID of the property that denotes the date and time the document was saved

Usage

From source file:org.jlibrary.core.search.extraction.MSOfficeExtractor.java

License:Open Source License

/**
 * Returns a map with the extracted meta information from the document.<p>
 * //from ww w .java  2s.  c  o m
 * @return a map with the extracted meta information from the document
 */
protected HeaderMetaData extractMetaInformation() {

    HeaderMetaData metadata = new HeaderMetaData();
    String meta;
    if (m_summary != null) {
        // can't use convenience methods on summary since they can't deal with multiple sections
        Section section = (Section) m_summary.getSections().get(0);

        meta = (String) section.getProperty(PropertyIDMap.PID_TITLE);
        if ((meta != null) && !meta.equals("")) {
            metadata.setTitle(meta);
            metadata.setDescription(meta);
        }
        meta = (String) section.getProperty(PropertyIDMap.PID_KEYWORDS);
        if ((meta != null) && !meta.equals("")) {
            metadata.setKeywords(meta);
        }
        meta = (String) section.getProperty(PropertyIDMap.PID_SUBJECT);
        if ((meta != null) && !meta.equals("")) {
            metadata.setDescription(meta);
        }
        meta = (String) section.getProperty(PropertyIDMap.PID_COMMENTS);
        if ((meta != null) && !meta.equals("")) {
            // Not handled
        }
        // extract other available meta information
        meta = (String) section.getProperty(PropertyIDMap.PID_AUTHOR);
        if ((meta != null) && !meta.equals("")) {
            metadata.setAuthor(meta);
        }
        Date date;
        date = (Date) section.getProperty(PropertyIDMap.PID_CREATE_DTM);
        if ((date != null) && (date.getTime() > 0)) {
            // Not handled            
        }
        date = (Date) section.getProperty(PropertyIDMap.PID_LASTSAVE_DTM);
        if ((date != null) && (date.getTime() > 0)) {
            // Not handled
        }
    }
    if (m_documentSummary != null) {
        // can't use convenience methods on document since they can't deal with multiple sections
        Section section = (Section) m_documentSummary.getSections().get(0);

        // extract available meta information from document summary
        meta = (String) section.getProperty(PropertyIDMap.PID_COMPANY);
        if ((meta != null) && !meta.equals("")) {
            // Not handled
        }
        meta = (String) section.getProperty(PropertyIDMap.PID_MANAGER);
        if ((meta != null) && !meta.equals("")) {
            // Not handled
        }
        meta = (String) section.getProperty(PropertyIDMap.PID_CATEGORY);
        if ((meta != null) && !meta.equals("")) {
            // Not handled
        }
    }

    return metadata;
}