source: trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/VbaDataPart.java @ 895

Revision 895, 2.0 KB checked in by jharrop, 3 years ago (diff)

Parts which aren't JAXB XML parts now extend XmlPart?, which uses JAXP instead of dom4j, the use of which is deprecated.
CustomXmlDataStorageImpl? extends XmlPart?, rather than duplicating that code.

Line 
1/*
2 *  Copyright 2007-2008, Plutext Pty Ltd.
3 *   
4 *  This file is part of docx4j.
5
6    docx4j is licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8
9    You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18
19 */
20
21package org.docx4j.openpackaging.parts.WordprocessingML;
22
23
24import org.docx4j.openpackaging.exceptions.Docx4JException;
25import org.docx4j.openpackaging.exceptions.InvalidFormatException;
26import org.docx4j.openpackaging.parts.PartName;
27import org.docx4j.openpackaging.parts.XmlPart;
28import org.docx4j.openpackaging.parts.relationships.Namespaces;
29
30
31public final class VbaDataPart extends XmlPart {
32       
33        /*
34         * eg <wne:vbaSuppData xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml">
35                                <wne:mcds>
36                                        <wne:mcd wne:macroName="PROJECT.THISDOCUMENT.AUTOOPEN" wne:name="Project.ThisDocument.AutoOpen" wne:bEncrypt="00" wne:cmg="56"/>
37                                </wne:mcds>
38                        </wne:vbaSuppData>
39
40         *
41         */
42       
43        public VbaDataPart(PartName partName) throws InvalidFormatException {
44                super(partName);
45                init();
46        }               
47
48        public VbaDataPart() throws InvalidFormatException {
49                super( new PartName("/word/vbaData.xml") );
50                init();
51        }               
52       
53       
54        public void init() {
55
56                // Used if this Part is added to [Content_Types].xml
57                setContentType(new org.docx4j.openpackaging.contenttype.ContentType(
58                                org.docx4j.openpackaging.contenttype.ContentTypes.OFFICEDOCUMENT_VBA_DATA));
59
60                // Used when this Part is added to a rels
61                setRelationshipType(Namespaces.VBA_DATA_WORD);
62        }
63
64        @Override
65        public org.w3c.dom.Document getDocument() throws Docx4JException {
66                // Used when saving to JCR
67                return doc;
68        }
69       
70}
Note: See TracBrowser for help on using the repository browser.