*/
public Part getRawPart(
ContentTypeManager ctm, String resolvedPartUri, Relationship rel)
throws Docx4JException {
Part part = null;
InputStream is = null;
try {
try {
log.debug("resolved uri: " + resolvedPartUri);
// Get a subclass of Part appropriate for this content type
// This will throw UnrecognisedPartException in the absence of
// specific knowledge. Hence it is important to get the is
// first, as we do above.
part = ctm.getPart("/" + resolvedPartUri, rel);
log.debug("ctm returned " + part.getClass().getName() );
if (part instanceof org.docx4j.openpackaging.parts.ThemePart
|| part instanceof org.docx4j.openpackaging.parts.DocPropsCorePart
|| part instanceof org.docx4j.openpackaging.parts.DocPropsCustomPart
|| part instanceof org.docx4j.openpackaging.parts.DocPropsExtendedPart
|| part instanceof org.docx4j.openpackaging.parts.CustomXmlDataStoragePropertiesPart
|| part instanceof org.docx4j.openpackaging.parts.digitalsignature.XmlSignaturePart
|| part instanceof org.docx4j.openpackaging.parts.JaxbXmlPart) {
// Nothing to do here
} else if (part instanceof org.docx4j.openpackaging.parts.WordprocessingML.BinaryPart) {
log.debug("Detected BinaryPart " + part.getClass().getName() );
// Note that this is done lazily, since the below lines are commented out
// is = partStore.loadPart( resolvedPartUri);
// ((BinaryPart)part).setBinaryData(is);
} else if (part instanceof org.docx4j.openpackaging.parts.CustomXmlDataStoragePart ) {
// ContentTypeManager initially detects them as CustomXmlDataStoragePart;
// the below changes as necessary
// Is it a part we know?
is = partStore.loadPart( resolvedPartUri);
try {
Unmarshaller u = Context.jc.createUnmarshaller();
Object o = u.unmarshal( is );
log.debug(o.getClass().getName());
PartName name = part.getPartName();
if (o instanceof CoverPageProperties) {
part = new DocPropsCoverPagePart(name);
((DocPropsCoverPagePart)part).setJaxbElement(
(CoverPageProperties)o);