lenya/src/java/org/apache/lenya/cms/authoring DefaultCreator.java,1.17,1.18
Christian Egli <[email protected]>
| Newsgroups | gmane.comp.cms.wyona.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /repository/lenya/src/java/org/apache/lenya/cms/authoring
In directory erbium:/tmp/cvs-serv1856/src/java/org/apache/lenya/cms/authoring
Modified Files:
DefaultCreator.java
Log Message:
Now use DocumentHelper for writing.
Index: DefaultCreator.java
===================================================================
RCS file: /repository/lenya/src/java/org/apache/lenya/cms/authoring/DefaultCreator.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** DefaultCreator.java 7 May 2003 16:41:48 -0000 1.17
--- DefaultCreator.java 8 May 2003 15:27:26 -0000 1.18
***************
*** 51,59 ****
import org.apache.lenya.xml.DocumentHelper;
- import org.apache.lenya.xml.DOMWriter;
import java.io.File;
- import java.io.FileOutputStream;
- import java.net.URL;
import java.util.Map;
--- 51,56 ----
***************
*** 171,176 ****
// Read sample file
log.debug("Read sample file: " + doctypeSample);
! Document doc = DocumentHelper.readDocument(new URL("file:" + doctypeSample));
// transform the xml if needed
log.debug("transform sample file: ");
--- 168,174 ----
// Read sample file
log.debug("Read sample file: " + doctypeSample);
! Document doc = DocumentHelper.readDocument(new File(doctypeSample));
+ log.debug("sample document: " + doc);
// transform the xml if needed
log.debug("transform sample file: ");
***************
*** 185,196 ****
// Write file
log.debug("write file: " + filename);
! FileOutputStream out = new FileOutputStream(filename);
! new DOMWriter(out).printWithoutFormatting(doc);
! out.close();
// now do the same thing for the meta document if the
// sampleMetaName is specified
if (sampleMetaName != null) {
! doc = DocumentHelper.readDocument(new URL("file:" + doctypeMeta));
transformMetaXML(doc, id, childType, childName, parameters);
--- 183,192 ----
// Write file
log.debug("write file: " + filename);
! DocumentHelper.writeDocument(doc, new File(filename));
// now do the same thing for the meta document if the
// sampleMetaName is specified
if (sampleMetaName != null) {
! doc = DocumentHelper.readDocument(new File(doctypeMeta));
transformMetaXML(doc, id, childType, childName, parameters);
***************
*** 201,207 ****
}
! out = new FileOutputStream(filenameMeta);
! new DOMWriter(out).printWithoutFormatting(doc);
! out.close();
}
}
--- 197,201 ----
}
! DocumentHelper.writeDocument(doc, new File(filenameMeta));
}
}