/* Insert some custom properties into the container. */
customProperties.put("Key 1", "Value 1");
- customProperties.put("Schlüssel 2", "Wert 2");
+ customProperties.put("Schl\u00fcssel 2", "Wert 2");
customProperties.put("Sample Number", new Integer(12345));
customProperties.put("Sample Boolean", new Boolean(true));
customProperties.put("Sample Date", new Date());
import org.apache.poi.util.LittleEndian;
/**
- * XCT \96 CRN Count <P>
+ * XCT - CRN Count <P>
*
* REFERENCE: 5.114<P>
*
*
* @author Andrew C. Oliver (acoliver at apache dot org)
* @author Glen Stampoultzis (glens at apache.org)
- * @author Rolf-Jürgen Moll
+ * @author Rolf-J\u00f6rgen Moll
*
* @see org.apache.poi.hssf.record.MulRKRecord
* @see org.apache.poi.hssf.record.RKRecord
if(corePart.getContentType().equals(XSSFRelation.WORKBOOK.getContentType())) {
return new XSSFExcelExtractor(pkg);
}
- if(corePart.getContentType().equals(XWPFRelation.MAIN_CONTENT_TYPE)) {
+ if(corePart.getContentType().equals(XWPFRelation.DOCUMENT.getContentType())) {
return new XWPFWordExtractor(pkg);
}
if(corePart.getContentType().equals(XSLFSlideShow.MAIN_CONTENT_TYPE)) {
* <blockquote>
* <pre>
* If (tint < 0)
- * Lum\92 = Lum * (1.0 + tint)
+ * Lum' = Lum * (1.0 + tint)
*
* For example: Lum = 200; tint = -0.5; Darken 50%
- * Lum\91 = 200 * (0.5) => 100
+ * Lum' = 200 * (0.5) => 100
* For example: Lum = 200; tint = -1.0; Darken 100% (make black)
- * Lum\91 = 200 * (1.0-1.0) => 0
+ * Lum' = 200 * (1.0-1.0) => 0
* If (tint > 0)
- * Lum\91 = Lum * (1.0-tint) + (HLSMAX \96 HLSMAX * (1.0-tint))
+ * Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint))
* For example: Lum = 100; tint = 0.75; Lighten 75%
*
- * Lum\91 = 100 * (1-.75) + (HLSMAX \96 HLSMAX*(1-.75))
- * = 100 * .25 + (255 \96 255 * .25)
- * = 25 + (255 \96 63) = 25 + 192 = 217
+ * Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75))
+ * = 100 * .25 + (255 - 255 * .25)
+ * = 25 + (255 - 63) = 25 + 192 = 217
* For example: Lum = 100; tint = 1.0; Lighten 100% (make white)
- * Lum\91 = 100 * (1-1) + (HLSMAX \96 HLSMAX*(1-1))
- * = 100 * 0 + (255 \96 255 * 0)
- * = 0 + (255 \96 0) = 255
+ * Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1))
+ * = 100 * 0 + (255 - 255 * 0)
+ * = 0 + (255 - 0) = 255
* </pre>
* </blockquote>
*
* <blockquote>
* <pre>
* If (tint < 0)
- * Lum\92 = Lum * (1.0 + tint)
+ * Lum' = Lum * (1.0 + tint)
*
* For example: Lum = 200; tint = -0.5; Darken 50%
- * Lum\91 = 200 * (0.5) => 100
+ * Lum' = 200 * (0.5) => 100
* For example: Lum = 200; tint = -1.0; Darken 100% (make black)
- * Lum\91 = 200 * (1.0-1.0) => 0
+ * Lum' = 200 * (1.0-1.0) => 0
* If (tint > 0)
- * Lum\91 = Lum * (1.0-tint) + (HLSMAX \96 HLSMAX * (1.0-tint))
+ * Lum' = Lum * (1.0-tint) + (HLSMAX - HLSMAX * (1.0-tint))
* For example: Lum = 100; tint = 0.75; Lighten 75%
*
- * Lum\91 = 100 * (1-.75) + (HLSMAX \96 HLSMAX*(1-.75))
- * = 100 * .25 + (255 \96 255 * .25)
- * = 25 + (255 \96 63) = 25 + 192 = 217
+ * Lum' = 100 * (1-.75) + (HLSMAX - HLSMAX*(1-.75))
+ * = 100 * .25 + (255 - 255 * .25)
+ * = 25 + (255 - 63) = 25 + 192 = 217
* For example: Lum = 100; tint = 1.0; Lighten 100% (make white)
- * Lum\91 = 100 * (1-1) + (HLSMAX \96 HLSMAX*(1-1))
- * = 100 * 0 + (255 \96 255 * 0)
- * = 0 + (255 \96 0) = 255
+ * Lum' = 100 * (1-1) + (HLSMAX - HLSMAX*(1-1))
+ * = 100 * 0 + (255 - 255 * 0)
+ * = 0 + (255 - 0) = 255
* </pre>
* </blockquote>
*
}\r
\r
public POIXMLDocumentPart createDocumentPart(PackageRelationship rel, PackagePart part){\r
- XSSFRelation descriptor = XSSFRelation.getInstance(rel.getRelationshipType());\r
+ POIXMLRelation descriptor = XSSFRelation.getInstance(rel.getRelationshipType());\r
if(descriptor == null || descriptor.getRelationClass() == null){\r
logger.log(POILogger.DEBUG, "using default POIXMLDocumentPart for " + rel.getRelationshipType());\r
return new POIXMLDocumentPart(part, rel);\r
}
/**
- * Use the printerÕs defaults settings for page setup values and don't use the default values
+ * Use the printer's defaults settings for page setup values and don't use the default values
* specified in the schema. For example, if dpi is not present or specified in the XML, the
* application shall not assume 600dpi as specified in the schema as a default and instead
* shall let the printer specify the default dpi.
* <pre>
* 10 - 10%
* 20 - 20%
- * \85
+ * ...
* 100 - 100%
- * \85
+ * ...
* 400 - 400%
* </pre>
*
for(POIXMLDocumentPart p : getRelations()){
String relation = p.getPackageRelationship().getRelationshipType();
- if(relation.equals(XWPFRelation.COMMENT_RELATION_TYPE)){
+ if(relation.equals(XWPFRelation.COMMENT.getRelation())){
CommentsDocument cmntdoc = CommentsDocument.Factory.parse(p.getPackagePart().getInputStream());
for(CTComment ctcomment : cmntdoc.getComments().getCommentArray()) {
comments.add(new XWPFComment(ctcomment));
// TODO: make me optional/separated in private function
try {
Iterator <PackageRelationship> relIter =
- getPackagePart().getRelationshipsByType(XWPFRelation.HYPERLINK_RELATION_TYPE).iterator();
+ getPackagePart().getRelationshipsByType(XWPFRelation.HYPERLINK.getRelation()).iterator();
while(relIter.hasNext()) {
PackageRelationship rel = relIter.next();
hyperlinks.add(new XWPFHyperlink(rel.getId(), rel.getTargetURI().toString()));
public CTStyles getStyle() throws XmlException, IOException {
PackagePart[] parts;
try {
- parts = getRelatedByType(XWPFRelation.STYLES_RELATION_TYPE);
+ parts = getRelatedByType(XWPFRelation.STYLES.getRelation());
} catch(InvalidFormatException e) {
throw new IllegalStateException(e);
}
* @author Yegor Kozlov\r
*/\r
public class XWPFRelation extends POIXMLRelation {\r
- public static final String MAIN_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";\r
- public static final String HEADER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";\r
- public static final String HEADER_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";\r
- public static final String FOOTER_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";\r
- public static final String FOOTER_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";\r
- public static final String STYLES_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";\r
- public static final String STYLES_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";\r
- public static final String HYPERLINK_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";\r
- public static final String COMMENT_RELATION_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";\r
\r
/**\r
* A map to lookup POIXMLRelation by its relation type\r
"/word/webSettings.xml",\r
null\r
);\r
+ public static final XWPFRelation HEADER = new XWPFRelation(\r
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",\r
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",\r
+ "/word/header#.xml",\r
+ null\r
+ );\r
+ public static final XWPFRelation FOOTER = new XWPFRelation(\r
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",\r
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",\r
+ "/word/footer#.xml",\r
+ null\r
+ );\r
+ public static final XWPFRelation HYPERLINK = new XWPFRelation(\r
+ null,\r
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",\r
+ null,\r
+ null\r
+ );\r
+ public static final XWPFRelation COMMENT = new XWPFRelation(\r
+ null,\r
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",\r
+ null,\r
+ null\r
+ );\r
\r
\r
private XWPFRelation(String type, String rel, String defaultName, Class<? extends POIXMLDocumentPart> cls) {\r
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;\r
\r
/**\r
- * XWPFRun object defines a region of text with a common set of properties\r
+ * XWPFRun object defines a region of text with a common set of properties\r
*\r
* @author Yegor Kozlov\r
*/\r
boolean found = false;
for(PackagePart part : pack.getParts()) {
- if(part.getContentType().equals(XWPFRelation.MAIN_CONTENT_TYPE)) {
+ if(part.getContentType().equals(XWPFRelation.DOCUMENT.getContentType())) {
found = true;
}
System.out.println(part);
* Basing on: src/examples/src/org/apache/poi/hpsf/examples/ModifyDocumentSummaryInformation.java
* This class tests reading and writing of meta data. No actual document is created. All information
* is stored in a virtal document in a ByteArrayOutputStream
- * @author Matthias Günter
+ * @author Matthias G\u00fcnter
* @since 2006-03-03
* @version $Id: TestEmptyProperties.java 353563 2004-06-22 16:16:33Z klute $
*/
/* Insert some custom properties into the container. */
customProperties.put("Key1", "Value1");
- customProperties.put("Schlüssel2", "Wert2");
+ customProperties.put("Schl�ssel2", "Wert2");
customProperties.put("Sample Integer", new Integer(12345));
customProperties.put("Sample Boolean", new Boolean(true));
Date date=new Date();
/* Insert some custom properties into the container. */
String a1=(String) customProperties.get("Key1");
assertEquals("Key1","Value1",a1);
- String a2=(String) customProperties.get("Schlüssel2");
- assertEquals("Schlüssel2","Wert2",a2);
+ String a2=(String) customProperties.get("Schl�ssel2");
+ assertEquals("Schl�ssel2","Wert2",a2);
Integer a3=(Integer) customProperties.get("Sample Integer");
assertEquals("Sample Number",new Integer(12345),a3);
Boolean a4=(Boolean) customProperties.get("Sample Boolean");
String a1=(String) customProperties.get(k1);
assertEquals("Key1",p1,a1);
String a2=(String) customProperties.get(k2);
- assertEquals("Schlüssel2",p2,a2);
+ assertEquals("Schl�ssel2",p2,a2);
Integer a3=(Integer) customProperties.get("Sample Number");
assertEquals("Sample Number",new Integer(12345),a3);
Boolean a4=(Boolean) customProperties.get("Sample Boolean");
*/
public String strangize(String s){
StringBuffer sb=new StringBuffer();
- String[] umlaute= {"ä","ü","ö","Ü","$","Ö","Ü","É","Ö","@","ç","&"};
+ String[] umlaute= {"�","�","�","�","$","�","�","�","�","@","�","&"};
char j=0;
Random rand=new Random();
for (int i=0;i<5;i++){
String a1=(String) customProperties.get(k1);
assertEquals("Key1",p1,a1);
String a2=(String) customProperties.get(k2);
- assertEquals("Schlüssel2",p2,a2);
+ assertEquals("Schl�ssel2",p2,a2);
Integer a3=(Integer) customProperties.get("Sample Number");
assertEquals("Sample Number",new Integer(12345),a3);
Boolean a4=(Boolean) customProperties.get("Sample Boolean");
public String strangizeU(String s){
StringBuffer sb=new StringBuffer();
- String[] umlaute= {"ä","ü","ö","Ü","$","Ö","Ü","É","Ö","@","ç","&"};
+ String[] umlaute= {"�","�","�","�","$","�","�","�","�","@","�","&"};
char j=0;
Random rand=new Random();
for (int i=0;i<5;i++){
sb.append(umlaute[rand.nextInt(umlaute.length)]);
sb.append("<");
}
- sb.append("äöü\uD840\uDC00");
+ sb.append("���\uD840\uDC00");
return sb.toString();
}
/**
String a1=(String) customProperties.get(k1);
assertEquals("Key1",p1,a1);
String a2=(String) customProperties.get(k2);
- assertEquals("Schlüssel2",p2,a2);
+ assertEquals("Schl�ssel2",p2,a2);
Integer a3=(Integer) customProperties.get("Sample Number");
assertEquals("Sample Number",new Integer(12345),a3);
Boolean a4=(Boolean) customProperties.get("Sample Boolean");
CustomProperties customProperties = dsi.getCustomProperties();
if (customProperties == null)
customProperties = new CustomProperties();
- customProperties.put("Schlüssel ä", "Wert ä");
- customProperties.put("Schlüssel äö", "Wert äö");
- customProperties.put("Schlüssel äöü", "Wert äöü");
- customProperties.put("Schlüssel äöüß", "Wert äöüß");
+ customProperties.put("Schl\u00fcssel �", "Wert �");
+ customProperties.put("Schl\u00fcssel ��", "Wert ��");
+ customProperties.put("Schl\u00fcssel ���", "Wert ���");
+ customProperties.put("Schl\u00fcssel ����", "Wert ����");
customProperties.put("positive_Integer", POSITIVE_INTEGER);
customProperties.put("positive_Long", POSITIVE_LONG);
customProperties.put("positive_Double", POSITIVE_DOUBLE);
final CustomProperties cps = dsi.getCustomProperties();
assertEquals(customProperties, cps);
assertNull(cps.get("No value available"));
- assertEquals("Wert ä", cps.get("Schlüssel ä"));
- assertEquals("Wert äö", cps.get("Schlüssel äö"));
- assertEquals("Wert äöü", cps.get("Schlüssel äöü"));
- assertEquals("Wert äöüß", cps.get("Schlüssel äöüß"));
+ assertEquals("Wert �", cps.get("Schl\u00fcssel �"));
+ assertEquals("Wert ��", cps.get("Schl\u00fcssel ��"));
+ assertEquals("Wert ���", cps.get("Schl\u00fcssel ���"));
+ assertEquals("Wert ����", cps.get("Schl\u00fcssel ����"));
assertEquals(POSITIVE_INTEGER, cps.get("positive_Integer"));
assertEquals(POSITIVE_LONG, cps.get("positive_Long"));
assertEquals(POSITIVE_DOUBLE, cps.get("positive_Double"));
*/
public void testCustomerProperties()
{
- final String KEY = "Schlüssel ä";
+ final String KEY = "Schl\u00fcssel �";
final String VALUE_1 = "Wert 1";
final String VALUE_2 = "Wert 2";
{
final int ID_1 = 2;
final int ID_2 = 3;
- final String NAME_1 = "Schlüssel ä";
+ final String NAME_1 = "Schl\u00fcssel �";
final String VALUE_1 = "Wert 1";
final Map dictionary = new HashMap();