Examples of PackagePropertiesPart


Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

    POIXMLProperties props = workbook.getProperties();
    assertNotNull(props);
    //the Application property must be set for new workbooks, see Bugzilla #47559
    assertEquals("Apache POI", props.getExtendedProperties().getUnderlyingProperties().getApplication());

    PackagePropertiesPart opcProps = props.getCoreProperties().getUnderlyingProperties();
    assertNotNull(opcProps);

    opcProps.setTitleProperty("Testing Bugzilla #47460");
    assertEquals("Apache POI", opcProps.getCreatorProperty().getValue());
    opcProps.setCreatorProperty("poi-dev@poi.apache.org");

    workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
    assertEquals("Apache POI", workbook.getProperties().getExtendedProperties().getUnderlyingProperties().getApplication());
    opcProps = workbook.getProperties().getCoreProperties().getUnderlyingProperties();
    assertEquals("Testing Bugzilla #47460", opcProps.getTitleProperty().getValue());
    assertEquals("poi-dev@poi.apache.org", opcProps.getCreatorProperty().getValue());
  }
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

  /**
   * Returns the core document properties, eg author
   */
  public String getCorePropertiesText() {
    StringBuffer text = new StringBuffer();
    PackagePropertiesPart props =
      getDocument().getProperties().getCoreProperties().getUnderlyingProperties();

    text.append("Category = " + props.getCategoryProperty().getValue() + "\n");
    text.append("ContentStatus = " + props.getContentStatusProperty().getValue() + "\n");
    text.append("ContentType = " + props.getContentTypeProperty().getValue() + "\n");
    text.append("Created = " + props.getCreatedProperty().getValue() + "\n");
    text.append("CreatedString = " + props.getCreatedPropertyString() + "\n");
    text.append("Creator = " + props.getCreatorProperty().getValue() + "\n");
    text.append("Description = " + props.getDescriptionProperty().getValue() + "\n");
    text.append("Identifier = " + props.getIdentifierProperty().getValue() + "\n");
    text.append("Keywords = " + props.getKeywordsProperty().getValue() + "\n");
    text.append("Language = " + props.getLanguageProperty().getValue() + "\n");
    text.append("LastModifiedBy = " + props.getLastModifiedByProperty().getValue() + "\n");
    text.append("LastPrinted = " + props.getLastPrintedProperty().getValue() + "\n");
    text.append("LastPrintedString = " + props.getLastPrintedPropertyString() + "\n");
    text.append("Modified = " + props.getModifiedProperty().getValue() + "\n");
    text.append("ModifiedString = " + props.getModifiedPropertyString() + "\n");
    text.append("Revision = " + props.getRevisionProperty().getValue() + "\n");
    text.append("Subject = " + props.getSubjectProperty().getValue() + "\n");
    text.append("Title = " + props.getTitleProperty().getValue() + "\n");
    text.append("Version = " + props.getVersionProperty().getValue() + "\n");

    return text.toString();
  }
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

          .addContentType(PackagingURIHelper
              .createPartName("/default.xml"),
              ContentTypes.PLAIN_OLD_XML);

      // Init some PackageBase properties
      pkg.packageProperties = new PackagePropertiesPart(pkg,
          PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
      pkg.packageProperties.setCreatorProperty("Generated by OpenXML4J");
      pkg.packageProperties.setCreatedProperty(new Nullable<Date>(
          new Date()));
    } catch (InvalidFormatException e) {
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

  public PackageProperties getPackageProperties()
      throws InvalidFormatException {
    this.throwExceptionIfWriteOnly();
    // If no properties part has been found then we create one
    if (this.packageProperties == null) {
      this.packageProperties = new PackagePropertiesPart(this,
          PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
    }
    return this.packageProperties;
  }
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

          .addContentType(PackagingURIHelper
              .createPartName("/default.xml"),
              ContentTypes.PLAIN_OLD_XML);

      // Init some Package properties
      pkg.packageProperties = new PackagePropertiesPart(pkg,
          PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
      pkg.packageProperties.setCreatorProperty("Generated by OpenXML4J");
      pkg.packageProperties.setCreatedProperty(new Nullable<Date>(
          new Date()));
    } catch (InvalidFormatException e) {
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

          .addContentType(PackagingURIHelper
              .createPartName("/default.xml"),
              ContentTypes.PLAIN_OLD_XML);

      // Init some PackageBase properties
      pkg.packageProperties = new PackagePropertiesPart(pkg,
          PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
      pkg.packageProperties.setCreatorProperty("Generated by OpenXML4J");
      pkg.packageProperties.setCreatedProperty(new Nullable<Date>(
          new Date()));
    } catch (InvalidFormatException e) {
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

  public PackageProperties getPackageProperties()
      throws InvalidFormatException {
    this.throwExceptionIfWriteOnly();
    // If no properties part has been found then we create one
    if (this.packageProperties == null) {
      this.packageProperties = new PackagePropertiesPart(this,
          PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
    }
    return this.packageProperties;
  }
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

  /**
   * Returns the core document properties, eg author
   */
  public String getCorePropertiesText() {
    StringBuffer text = new StringBuffer();
    PackagePropertiesPart props =
      getDocument().getProperties().getCoreProperties().getUnderlyingProperties();

    appendIfPresent(text, "Category", props.getCategoryProperty().getValue());
    appendIfPresent(text, "Category", props.getCategoryProperty().getValue());
    appendIfPresent(text, "ContentStatus", props.getContentStatusProperty().getValue());
    appendIfPresent(text, "ContentType", props.getContentTypeProperty().getValue());
    appendIfPresent(text, "Created", props.getCreatedProperty().getValue());
    appendIfPresent(text, "CreatedString", props.getCreatedPropertyString());
    appendIfPresent(text, "Creator", props.getCreatorProperty().getValue());
    appendIfPresent(text, "Description", props.getDescriptionProperty().getValue());
    appendIfPresent(text, "Identifier", props.getIdentifierProperty().getValue());
    appendIfPresent(text, "Keywords", props.getKeywordsProperty().getValue());
    appendIfPresent(text, "Language", props.getLanguageProperty().getValue());
    appendIfPresent(text, "LastModifiedBy", props.getLastModifiedByProperty().getValue());
    appendIfPresent(text, "LastPrinted", props.getLastPrintedProperty().getValue());
    appendIfPresent(text, "LastPrintedString", props.getLastPrintedPropertyString());
    appendIfPresent(text, "Modified", props.getModifiedProperty().getValue());
    appendIfPresent(text, "ModifiedString", props.getModifiedPropertyString());
    appendIfPresent(text, "Revision", props.getRevisionProperty().getValue());
    appendIfPresent(text, "Subject", props.getSubjectProperty().getValue());
    appendIfPresent(text, "Title", props.getTitleProperty().getValue());
    appendIfPresent(text, "Version", props.getVersionProperty().getValue());

    return text.toString();
  }
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

    POIXMLProperties props = workbook.getProperties();
    assertNotNull(props);
    //the Application property must be set for new workbooks, see Bugzilla #47559
    assertEquals("Apache POI", props.getExtendedProperties().getUnderlyingProperties().getApplication());

    PackagePropertiesPart opcProps = props.getCoreProperties().getUnderlyingProperties();
    assertNotNull(opcProps);

    opcProps.setTitleProperty("Testing Bugzilla #47460");
    assertEquals("Apache POI", opcProps.getCreatorProperty().getValue());
    opcProps.setCreatorProperty("poi-dev@poi.apache.org");

    workbook = XSSFTestDataSamples.writeOutAndReadBack(workbook);
    assertEquals("Apache POI", workbook.getProperties().getExtendedProperties().getUnderlyingProperties().getApplication());
    opcProps = workbook.getProperties().getCoreProperties().getUnderlyingProperties();
    assertEquals("Testing Bugzilla #47460", opcProps.getTitleProperty().getValue());
    assertEquals("poi-dev@poi.apache.org", opcProps.getCreatorProperty().getValue());
  }
View Full Code Here

Examples of org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart

          .addContentType(PackagingURIHelper
              .createPartName("/default.xml"),
              ContentTypes.PLAIN_OLD_XML);

      // Init some PackageBase properties
      pkg.packageProperties = new PackagePropertiesPart(pkg,
          PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
      pkg.packageProperties.setCreatorProperty("Generated by OpenXML4J");
      pkg.packageProperties.setCreatedProperty(new Nullable<Date>(
          new Date()));
    } catch (InvalidFormatException e) {
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.