Re: [Hypercontent-users] Adding a custom editor
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2005-12-12 19:43:19
|
Hi John, The most straightforward way of dealing with custom XML files in = =20 HyperContent is to define the format as a DTD, which will then be used =20= to automatically generate the web forms. You can then reference that =20= data from any other page as an XML include, or by using the XSL =20 document() function during the transform. I would recommend starting =20= there; you can add a custom GUI for editing release XML files later, if =20= you feel it would be of some benefit. I will work on some =20 documentation on how to go about creating custom GUIs. Your dtd might look something like <!ELEMENT releases (release*)> <!ELEMENT release (label,date,download,description,type?,md5?,notes?)> <!ATTLIST release version CDATA #REQUIRED stable (true|false) 'false' > <!ELEMENT label (#PCDATA)> <!ELEMENT description (html)> etc . . . and your doc(type) <xml-doc definition=3D"/config/dtd/releases.dtd" root=3D"releases" =20 path=3D"/releases.xml"/> Alex On Dec 12, 2005, at 11:21 AM, John Fereira wrote: > > How difficult would it be to add a custom editor to hypercontent?=A0 =20= > Here's what I have in mind.=A0 One of the cool things about HC is the =20= > navigation editor and I was wondering what it would take to extend =20 > that functionality to allow edition of a more complex xml file.=A0 > > I have a site that contains two or three pages that include some =20 > common content, in this case information about releases that are =20 > available for the project.=A0 Rather than edit each page which = contains =20 > information about releases I thought it would be useful to have an =20 > editor which just edited the release information and then use an =20 > appropriate stylesheet to render the necessary content on each page. > > For example, let's say my xml looks something like this: > > <? xml version =3D "1.0" encoding =3D "UTF-8" ?> > <!DOCTYPE release-template SYSTEM "/config/dtd/releases.dtd"> > <releases> > =A0=A0 <release ve r s ion=3D"2.5.1" s table=3D"tru e"> > =A0=A0=A0=A0 <label>Quic kStart< / l a bel> > =A0=A0=A0=A0=A0 <t ype>GA</ type> > =A0=A0=A0=A0 <date>200 5-10 -19</date > > =A0=A0=A0=A0=A0 <d ownload> > =A0 =A0=A0=A0=A0=A0 ht t p ://www.yale.e du/its/ t p/portal-dist = /251/quic k =20 > star t/uPortal _ rel-2-5-1 -quick-star t .zip > =A0=A0=A0=A0=A0 </do w n load> > =A0=A0=A0=A0=A0 <md5 /> > =A0 =A0=A0=A0=A0 <description> > =A0=A0=A0=A0=A0=A0=A0=A0 General Audience release o f uPortal 2.5. 1 > =A0=A0=A0=A0=A0 < /description > > =A0=A0=A0=A0=A0 <notes> > =A0=A0 =A0=A0=A0=A0 http : // tp.its.yale. e d u /~awp9/publis = hed/jas i =20 > g/up2/rel-2-5 -1/releas e Note s.txt > =A0=A0 =A0 </notes > > =A0=A0 </relea se> > > =A0=A0 <release v e rsion=3D"3.0.0" stable=3D "false"> > =A0=A0=A0=A0=A0 <label>uPortal-only</label> > =A0=A0=A0=A0=A0 <type>M2 </type> > =A0 =A0=A0=A0 <date>2005 -10-12</d ate> > =A0=A0=A0=A0=A0 < download> > =A0=A0=A0=A0 =A0 http://mis105 .mis.ud e l.edu/ja-sig /uportald i = st/u =20 > Portal_re l -3-0-0-M2 .zip > =A0=A0=A0=A0=A0 < /download> > =A0=A0=A0=A0 <m d 5> > =A0=A0=A0=A0=A0=A0=A0=A0 h =20 > (http://mis105.mis.udel.edu/ja-sig/uportaldist/uPortal_rel-3-0-0-=20 > M2.zip.md5) ttp://mi s105.mis.udel.ed u/ja-sig/ u port aldist/uP o =20 > rtal_rel- 3-0-0-M2.zi p .md5 > =20 > (http://mis105.mis.udel.edu/ja-sig/uportaldist/uPortal_rel-3-0-0-=20 > M2.zip.md5)=A0=A0=A0=A0=A0 </ m d 5> > =A0=A0=A0=A0=A0 <des cription > > =A0=A0=A0=A0=A0=A0=A0=A0 Developers Re leas e of uPort al 3 Milestone = 2 > =A0=A0 =A0 </description> > =A0 =A0 <notes> https: //cleari nghouse.ja- sig.org/w i ki/x = /eCw</not e =20 > s> > =A0=A0 </r elease> > > </r eleases> > > If a custom "releases" editor could be created it might present a page = =20 > somewhat like the navigation editor that would allow me to "add" a =20 > release.=A0 Then I would get a form which would let me fill out the =20= > attributes and nodes I described above.=A0 > > Has anyone done anything like this? > =A0=20= |