<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="../schema/handout.rnc" type="compact"?>
<?xml-stylesheet type="text/css" href="../stylesheets/admin-tei.css"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" version="P5 1.0.1">
  <teiHeader>
    <fileDesc>
      <titleStmt>
	<title>Creating a Customization with Roma</title>
	<author>Syd Bauman</author>
      </titleStmt>
      <publicationStmt>
	<availability
	    status="free">
	  <p>Copyleft 2006 by Syd Bauman</p>
	</availability>
      </publicationStmt>
      <sourceDesc>
	<p>Based on Sebastian &amp; Lou's talk found at <name
	type="filePath">//TEI/Talks/2006-02-oucs/exercise-roma.xml</name>; the PDF for that talk can
	be found on <ref
	target="http://www.tei-c.org/Talks/OUCS/2005-02/exercise-roma.pdf">the TEI
	website</ref>.</p>
	<biblFull>
	  <titleStmt>
	    <title>Making your own schema with Roma</title>
	    <author>Sebastian Rahtz and Lou Burnard</author>
	  </titleStmt>
	  <publicationStmt>
	    <p>For TEI web site</p>
	  </publicationStmt>
	  <sourceDesc
	      default="false">
	    <p>No source: this the original</p>
	  </sourceDesc>
	</biblFull>
      </sourceDesc>
    </fileDesc>
  </teiHeader>
  <text>
    <body>
      <div type="section">
	<head>Before you start</head>
	<p>In this exercise, you will use <name>Roma</name>, a web
	tool available from <ref
	target="http://www.tei-c.org.uk/Roma/">the TEI web site</ref>
	and also included on the <ref
	target="http://tei.oucs.ox.ac.uk/teideb/tei-Ubuntu.iso">TEI
	Ubuntu CD</ref>, to make an XML schema. If you are not using
	the TEI Ubuntu CD, you will need access to the internet and a
	web browser such as Firefox or Opera. Once you have your
	schema you will also need an XML-aware editor to use it (e.g.,
	oXygen).</p>
	<p>These instructions only cover part of Roma's functionality.
	They describe the steps needed to 
	<list>
	  <item>select modules,</item>
	  <item>delete elements,</item>
	  <item>delete attributes, and</item>
	  <item>constrain attribute values</item> </list>. These
	  instructions do <emph>not</emph> cover some other
	  capabilities of Roma, including adding elements; changing an
	  element's class membership, contents, or description;
	  changing an attribute's permitted values (other than to a
	  closed list of values); changing the language of Roma
	  interface itself or of the elements &amp; attributes
	generated.</p>
      </div>
      <div type="section">
	<head>Getting started</head>
	<list type="ordered">
	  <item>Open the Roma application. If you are on-line, you can
	  point your favorite web browser to <ref
	  target="http://tei.oucs.ox.ac.uk/Roma/">http://www.tei-c.org.uk/Roma/</ref>,
	  or, if you are working from the CD, to <ref
	  target="http://localhost/Roma/">http://localhost/Roma/</ref>
	  (on the TEI Ubuntu CD the recommended web browser is Mozilla
	  Firefox, available on the toolbar; but you can also use
	  Konqueror or even Lynx if you prefer).</item>
	  <item>You should get to the Roma start screen, which says
	  something like <q>Roma: generating validators for the
	  TEI</q> at the top. Check the <q>Build schema</q> radio
	  button (the top button, may be selected by default) and then
	  the <q>Submit</q> button.</item>
	</list>
	<p>Notice that if you already had a customization file
	(typically a <name type="file">.odd</name> file), you could
	have uploaded it to make further changes, rather than starting
	from scratch.</p>
	<p>Subsequent pages have a row of tabs for each of the major
	tasks involved in making a customization (<q>Modules</q>,
	<q>Add elements</q>, <q>Change classes</q>, and
	<q>Language</q>) for creating various outputs from a
	customization (<q>Schema</q> and <q>Documentation</q>) and for
	acting on your customization (<q>New</q>, <q>Customize</q>,
	and <q>Save</q>). <!-- A brief explanation of some of these
	tabs is in <ref target="apndx">an appendix</ref>.-->Several of
	these tabs are explained briefly in the instructions that
	follow.</p>
	<p>The <soCalled>Customize</soCalled> page allows you to change 5 parameters:
	<list type="gloss">
	  <label>Title</label>
	  <item>The name of your customization; used as the
	  <gi>title</gi> in the TEI header of the ODD file, and also
	  as the <gi scheme="HTML">title</gi> and <gi
	  scheme="HTML">h1</gi> of the HTML documentation</item>
	  <label>Filename</label>
	  <item>Used as the base filename for the output schema (with
	  <name type="file">.rnc</name>, <name
	  type="file">.rng</name>, <name type="file">.xsd</name>, or
	  <name type="file">.dtd</name> appended), the output
	  documentation (with <name type="file">_doc.html</name>
	  appended), and the saved ODD file (with <name
	  type="file">.xml</name> appended). It's a good idea to avoid
	  characters that may confuse operating systems like slashes,
	  back-slashes, colons, spaces, etc.</item>
	  <label>Language</label>
	  <item>Allows you to select which language Roma uses on
	  some of its web pages. Not all parts of all pages have
	  been translated.</item>
	  <label>Author</label>
	  <item>The name of the author of the customization; used as the <gi>author</gi> in the
	  TEI header of the ODD file, and also in a <gi
	  scheme="HTML">meta</gi> element of the HTML documentation.</item>
	  <label>Description</label>
	  <item>The contents of this parameter are put inside a
	  <gi>p</gi> inside the <gi>body</gi> of the ODD file, and
	  thus show up as text near the top of the HTML
	  documentation.</item>
	  </list> After changing any parameters, it is necessary to press the <q>Submit</q> button
	  in order for Roma to record the changes. Note, however, that the page may not change when
	the submit is performed.</p>
      </div>
      <div
	  type="section">
	<head>Customizing</head>
	<div
	    type="subsection">
	  <head>Modules</head>
	  <p>Click on the <q>Modules</q> tab (usually a blue tab near
	  the top, under 2 lines of headings). This should bring you
	  to the <soCalled>Modules</soCalled> page.</p>
	  <p>On this page there are two lists: on the left are all
	  available TEI modules; on the right are the modules
	  currently selected for your schema. By default the four
	  required modules are listed on the right. You can add
	  modules from the list on the left by clicking on the word
	  <q>add</q> next to the desired module name. You can remove
	  modules from the list on the right by clicking on the word
	  <q>remove</q> next to the module you no longer wish to
	  include. Note that Roma will permit you to remove three of
	  the four required modules (<name type="module">core</name>,
	  <name type="module">header</name>, <name
	  type="module">textstructure</name>), but you will end up
	  with an invalid schema. (It is not possible to remove <name
	  type="module">tei</name>, because Roma cannot generate a
	  schema at all, valid or invalid, without it.)</p>
	</div>
	<div
	    type="subsection">
	  <head>Elements</head>
	  <p>It is often the case that the modules chosen contain many more elements than are
	  desired. Removal of elements is performed on a module by module basis. First click on a
	  module name from the <title>List of selected Modules</title> (the right column), e.g. <name
	  type="module">core</name>. This should take you to the appropriate <title>Change
	  module</title> page.</p>
	  <p>On this page each element defined by the module is listed along with a radio button
	  indicating whether it is to be included or excluded, a place to change its name, its
	  brief description, and a link to a further page where its attributes are specified.</p>
	  <p>For any element you do not want in your schema, simply select the
	  <title>Exclude</title> radio button. For example, if you know that the material you are
	  encoding does not contain any poetry, you will probably wish to click the
	  <title>Exclude</title> radio buttons for <gi>l</gi> and <gi>lg</gi>. You can include or
	  exclude all elements in the list by clicking the appropriate column heading.</p>
	  <p>It is necessary to press the <q>Submit Query</q> button
	  (white near the bottom of the page) before switching to a
	  different tab, lest all the changes you've made on this page
	  be lost. The only indication that your changes have been
	  recorded is a message near the top of the page. Press the
	  <q>Modules</q> tab or the <q>back</q> link to go back to the
	  list of modules.</p>
	</div>
	<div
	    type="subsection">
	  <head>Attributes</head>
	  <p>For each element in the <title>Change modules</title>
	  page there is a <q>Change attributes</q> link on the right.
	  Clicking on this link will bring you to a page for changing
	  or adding attributes called <title>Added Attributes</title>.
	  Note that Roma will happily allow you to think you are
	  changing the attributes for an element that has been
	  excluded, but this will have no effect on your
	  customization.</p>
	  <p>For each attribute, its canonical name is provided on the
	  left, and radio buttons for inclusion and exclusion just as
	  for elements follow. There is a field that permits you to
	  change the name of the attribute, and a brief description of
	  it.</p>
	  <p>Clicking on an attribute's name from the left column
	  brings you to a page that permits you to customize that
	  attribute <emph>for the given element</emph>. (It is
	  mis-named the <title>Add some attributes</title> page
	  because it is the same page that is used for actually adding
	  a new attribute &#x2014; in this case the fields have been
	  populated with the values for the attribute you are
	  changing.) If you want to change an attribute for all
	  elements on which it occurs, you would need to change it in
	  its class (Roma permits this, but it is not covered in this
	  document).</p>
	  <p>The page for attribute modification permits you <list>
	  <item>Choose whether the attribute is required or optional</item>
	  <item>Select its content, e.g. <name
	  type="class">data.enumerated</name> for a list of particular values</item>
	  <item>Choose a default value (should be left blank unless you know your software
	  handles these)</item>
	  <item>Choose whether a list of values is open (values other than those listed are
	  permitted) or closed (only the listed values are permitted). This should have no
	  effect unless there is a list of values.</item>
	  <item>Specify a list of values: a comma-separated list of XML Names.</item>
	  <item>Write a more detailed or specific description of the attribute. This description
	  will appear in the reference documentation for your schema.</item>
	</list>
	  </p>
	  <p>Remember to click on the <q>Submit Query</q> button at
	  the bottom of the <title>Add some attributes</title> page
	  after you have modified the attribute to your liking. This
	  should bring you back to the <title>Added Attributes</title>
	  page.</p>
	  <p>Clicking <q>Submit Query</q> on the <title>Added
	  Attributes</title> page does not bring you back to the
	  <title>Change module</title> page. The only way I know of to
	  get back is to click on the <q>Modules</q> tab and then the
	  module name again.</p>
	</div>
      </div>
      <div
	  type="section">
	<head>Saving your ODD file</head>
	<p>Clicking the <q>Save</q> tab downloads the ODD file that Roma has generated to your local
	system. The default name is the filename specified in the <title>Customize</title> page
	with <name
	type="file">.xml</name> appended. Some people like to change the <name
	type="file">.xml</name> to <name
	type="file">.odd</name>. Either way, you should <emph>always</emph> save your ODD file,
	or you will have to go through all this work again anytime you want to modify your
	customization.</p>
	<p>Your browser will download files to its default location or
	ask you where they should be put. For our purposes today you
	should put this (and other Roma-generated files) in your <name
	type="path">TEI_seminar/support/</name> folder, which you can
	place wherever you like.</p>
      </div>
      <div
	  type="section">
	<head>Outputs</head>
	<p>To generate reference documentation in HTML, select the
	<q>Documentation</q> tab. Leave the output type at the default
	<q>html</q>, and click <q>Submit</q>. Put the downloaded file
	into your <name type="path">TEI_seminar/support/</name>
	folder. To read it, open it with your web browser.</p>
	<p>To generate an output schema select the <q>Schema</q> tab.
	Here you can change the desired schema language of the schema
	Roma will generate and download when you click <q>Submit</q>.
	For our purposes, leave the default, RELAX NG compact syntax.
	Put the downloaded file into your <name
	type="path">TEI_seminar/support/</name> folder. To use it to constrain
	an XML document you are already editing with oXygen, choose
	<q>XML Document &gt; Associate schema…</q> from the
	<q>Document</q> menu. From the <q>Associate schema…</q> dialog
	box select the <q>RELAX NG Schema</q> tab and the <q>Compact
	syntax</q> radio button; then select the file you just
	downloaded by clicking on the plain folder next to the URL
	box.</p>
      </div>
    </body>
    <!-- back>
      <div
	  xml:id="apndx"
	  type="section">
	<head>Appendix</head>
	<list>
	  <head>tabs</head>
	  <label>New</label>
	  <item>Moves you to the <q>Customize</q> page for a new customizatino</item>
	  <label>Customize</label>
	  <item>Set general parameters like the name &amp; author of the customization; set the
	  language for Roma's interface</item>
	  <label>Modules</label>
	  <item>Select modules; from the module selection page choose which elements to delete</item>
	  <label>Add </label>
	</list>
      </div>
    </back -->
  </text>
</TEI>
