Re: [Hypercontent-users] Problem with setting up dtd definition
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2005-05-13 18:55:13
|
Philip, That is an interesting question, interesting enough that I've = spent =20 several hours today working on it, instead of finishing the packaging =20= of the 2.0 beta ;-) The DTD parser that sits behind the XML editor =20 hasn't been touched much since I first wrote it 3 years ago; it works =20= fine for simple DTDs, but lacked support for public identifiers, =20 NMTOKENS, and had a couple little bugs that showed up trying to parse =20= the docbook dtd (which has some very messy formatting in parts). So =20 after some coding, and installing local copies of the docbook DTDs and =20= wiring in the docbook XML catalog, it works. However, it takes almost =20= 2 minutes to parse the DTD, because it has to load all those modules =20 and replace many thousands of entities that are there to make it =20 possible for the same DTD to support SGML and XML. The good news is it takes only about 5 seconds to parse the Simplified =20= DocBook DTD: http://www.oasis-open.org/docbook/xml/simple/1.0/sdocbook.dtd All that said, there are some good reasons to consider alternatives to =20= Docbook for building documentation in HyperContent. Building one giant =20= DocBook document can become unwieldy in the XML editor (though that =20 might improve with a post-2.0 redesign of that editor), and more =20 importantly doesn't leave you any way to break the document down into a =20= set of say hundreds of hyperlinked web pages. The sample project in =20 hypercontent shows an alternative approach, where you store each =20 division, chapter, etc. in a separate XML file, which are then all =20 bundled together to generate one giant PDF, but are also published =20 separately as interlinked HTML pages. This approach also has the =20 advantage that, since permissions and locking are done at the level of =20= individual files, you can assign different permissions on different =20 sections of the documentation, and allow different users to be =20 simultaneously working on different sections of the documentation. If =20= you still need DocBook format to feed into another system, you could =20 create a form of output which would bundle all the files together and =20= transform them into a single DocBook XML document. Anyhow, the beta won't be out today now, but I'll try to wrap it up =20 this weekend, and you will at least have the option of using DocBook at =20= that point. -Alex On May 13, 2005, at 8:49 AM, Philip Rinehart wrote: > Great, fixed that problem. Now, to the more interesting question. For =20= > our initial project, we wanted to use the docbook =20 > dtd,=A0http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd. = However, =20 > it uses modules. Here's the question, I can upload the docbook.dtd =20 > file into the repository, it now sees it, but now throws errors =20 > because it doesn't know where the .mod files are. If I specify the =20 > oasis URL above, it causes the channel to time out, and I get nowhere. = =20 > How would I go about using the docbook dtd, and have it find the =20 > included modules from the dtd? > > Philip > > On May 12, 2005, at 9:52 PM, Alex Vigdor wrote: > >> Philip, >> =A0 Based on the error, it looks like the system was trying to = resolve =20 >> the dtd location as a relative path - by default, it will try and =20 >> resolve relative paths to the working directory, which is wherever =20= >> you started the JVM - in other words, the uPortal directory. This =20 >> means that the file you're editing still is missing the leading slash = =20 >> in its doctype - changing the doctype in the project definition does =20= >> not change the doctype of existing files, it only affects files =20 >> created after the change. >> =A0 You can either delete the file and recreate it, or download it = and =20 >> manually change the doctype to also add the leading slash (you would =20= >> need to enable the upload editor to upload your change). If you have =20= >> a number of files that need the change, you can use the download zip =20= >> function to download all the files to your local disk, where you can =20= >> use your favorite editor to do a global search and replace. Zip the =20= >> changes up and use upload zip to put them back in the repository. >> >> Alex >> >> On May 12, 2005, at 9:28 PM, Philip Rinehart wrote: >> >> >>> Thanks Alex, >>> >>> Tried that, didn't solve the problem. It seems as if what is =20 >>> happening is that the dtd reference is trying to refer to the root =20= >>> of the uPortal instance, *not* the dtd contained within the =20 >>> repository. Here's the snippet from the error log: >>> >>> org.jasig.portal.PortalException: PortalException has no ErrorID >>> =A0 at =20 >>> = edu.columbia.hypercontent.editors.EditorServant.setStaticData(EditorS=20 >>> ervant.java:90) >>> =A0 at =20 >>> = edu.columbia.hypercontent.contentmanager.commands.ChangeEditor.execut=20 >>> e(ChangeEditor.java:58) >>> =A0 at =20 >>> = edu.columbia.hypercontent.contentmanager.CContentManager.setRuntimeDa=20 >>> ta(CContentManager.java:192) >>> =A0 at =20 >>> = org.jasig.portal.MultithreadedChannelAdapter.setRuntimeData(Multithre=20 >>> adedChannelAdapter.java:61) >>> =A0 at =20 >>> org.jasig.portal.ChannelRenderer$Worker.run(ChannelRenderer.java:=20 >>> 417) >>> =A0 at org.jasig.portal.utils.threading.Worker.run(Worker.java:88) >>> Caused by: edu.columbia.hypercontent.CMSException: There was an =20 >>> error while processing this directive; =20 >>> /home/local/tomcat5_instances/dev/susan/dtd/docbook.dtd (No such =20 >>> file or directory) >>> =A0 at =20 >>> = edu.columbia.hypercontent.DocumentFactory.getDocumentFromStream(Docum=20 >>> entFactory.java:434) >>> =A0 at =20 >>> = edu.columbia.hypercontent.editors.xml.XmlEditor.startSession(XmlEdito=20 >>> r.java:66) >>> =A0 at =20 >>> = edu.columbia.hypercontent.editors.EditorServant.setStaticData(EditorS=20 >>> ervant.java:86) >>> =A0 ... 5 more >>> >>> >>> This directory: /home/local/tomcat5_instances/dev/susan is the root =20= >>> of the uPortal instance. Shouldn't it be referring to the dtd? >>> >>> Philip >>> >>> On May 12, 2005, at 4:08 PM, Alex Vigdor wrote: >>> >>> >>>> Hi Philip, >>>> =A0 My first suggestion is to add the leading "/" on the dtd =20 >>>> location: "/dtd/docbook.dtd". You can check the portal log for =20 >>>> stack traces, which are handy. What version of uPortal are you =20 >>>> running? A doctype does not need to have any forms of output =20 >>>> associated with it, and if there is an error parsing the DTD or XML = =20 >>>> it should display the parsing error. The root can be any element in = =20 >>>> your DTD. >>>> >>>> The sitemap is optional - it's just a specific XML document type =20= >>>> that the system applies special processing to before it's included, = =20 >>>> which you can use to set up templates for the site map or =20 >>>> navigation structures. You can have none of them, one of them, or =20= >>>> as many as you want. You can use your own custom includes & xslt to = =20 >>>> set up navigation structures, in fact that was the only way prior =20= >>>> to version 1.4. The navigation document type was specifically =20 >>>> designed to make it easy to do manual sorting of navigation =20 >>>> elements in the drag & drop navigation editor, as well as move the =20= >>>> logic of sorting and labeling navigation elements out of XSL. We =20= >>>> actually use this document type to manage pushed bookmarks channels = =20 >>>> at Columbia - it is displayed as a nested list of bookmarks, which =20= >>>> can be added, updated and re-ordered using the same navigation =20 >>>> editor by non-technical users. >>>> >>>> -Alex >>>> >>>> On May 12, 2005, at 2:49 PM, Philip Rinehart wrote: >>>> >>>> >>>> >>>>> I'm having a problem setting up the definition of a particular =20 >>>>> section of my test website. I've specified the dtd I want to use, =20= >>>>> which is in the repository, as well as the editor key. Here's what = =20 >>>>> the line looks like: >>>>> >>>>> =A0 <xml-doctype definition=3D"dtd/docbook.dtd" label=3D"First = Section" =20 >>>>> path=3D"/*/index.xml" root=3D"body"> >>>>> =A0 <editor key=3D"xml"/> >>>>> =A0 </xml-doctype> >>>>> >>>>> However, when I attempt to do anything to the index.xml file I end = =20 >>>>> up with the following error: >>>>> >>>>> Error performing changeEditor: PortalException has no ErrorID =20 >>>>> (org.jasig.portal.PortalException) >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> >>>>> >>>>> It's not clear to me why this is happening. Should I be using a =20= >>>>> different root? does it have to have a transform associated with =20= >>>>> it? Everything else makes sense to me, and I've been able to get =20= >>>>> resource directories working without issue, etc. >>>>> >>>>> Also, does every hypercontent site need a sitemap, or can that be =20= >>>>> omitted? >>>>> >>>>> Philip >>>>> >>>>> Philip Rinehart >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> Academic Media & Technology >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> Cluster Support Services >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> 203-432-6573 >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> clu...@ya... >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> phi...@ya... >> >> >>>>> >>>>> >>>> >>>> >>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>> >>> Philip Rinehart >> >> >>> >>> Academic Media & Technology >> >> >>> >>> Cluster Support Services >> >> >>> >>> 203-432-6573 >> >> >>> >>> clu...@ya... >> >> >>> >>> phi...@ya... >> >> >>> >>> >>> >>> > > Philip Rinehart > Academic Media & Technology > Cluster Support Services > 203-432-6573 > clu...@ya... > phi...@ya... > > > |