01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.core.xml;
15:
16: import org.itsnat.core.ItsNatDocument;
17: import org.itsnat.core.ItsNatException;
18: import org.itsnat.impl.core.MarkupTemplateVersionDelegateImpl;
19: import org.itsnat.impl.core.DocumentTemplateVersionImpl;
20: import org.itsnat.impl.core.ItsNatDocumentImpl;
21: import org.itsnat.impl.core.ItsNatSessionImpl;
22: import org.w3c.dom.Document;
23: import org.w3c.dom.DocumentFragment;
24:
25: /**
26: *
27: * @author jmarranz
28: */
29: public class XMLDocumentTemplateVersionImpl extends
30: DocumentTemplateVersionImpl {
31:
32: /**
33: * Creates a new instance of XMLDocumentTemplateVersionImpl
34: */
35: public XMLDocumentTemplateVersionImpl(
36: XMLDocumentTemplateImpl docTemplate, long timeStamp) {
37: super (docTemplate, timeStamp);
38: }
39:
40: protected void preCacheDocument() {
41: }
42:
43: protected void doCacheDocument() {
44: inspectNodeToCache(templateDoc.getDocumentElement());
45: }
46:
47: public ItsNatDocumentImpl createItsNatDocument(Document doc,
48: ItsNatSessionImpl session) {
49: return new ItsNatXMLDocumentImpl(doc, this , session);
50: }
51:
52: protected MarkupTemplateVersionDelegateImpl createMarkupTemplateVersionDelegate() {
53: return new XMLTemplateVersionDelegateImpl(this );
54: }
55:
56: public DocumentFragment loadFragmentFromSource(String source,
57: ItsNatDocument docTarget) {
58: // No está implementado porque sólo se usa en el caso de mutation events recibidos
59: // del navegador y a día de hoy ésto sólo ocurre con documentos HTML
60: // Si en un futuro documentos XML admitieran eventos se implementaría "fácilmente"
61: throw new ItsNatException("Unexpected error");
62: }
63: }
|