diff options
Diffstat (limited to 'lib/webtool/doc/src')
-rw-r--r-- | lib/webtool/doc/src/Makefile | 127 | ||||
-rw-r--r-- | lib/webtool/doc/src/book.xml | 47 | ||||
-rw-r--r-- | lib/webtool/doc/src/fascicules.xml | 18 | ||||
-rw-r--r-- | lib/webtool/doc/src/make.dep | 20 | ||||
-rw-r--r-- | lib/webtool/doc/src/notes.xml | 112 | ||||
-rw-r--r-- | lib/webtool/doc/src/notes_history.xml | 73 | ||||
-rw-r--r-- | lib/webtool/doc/src/part.xml | 37 | ||||
-rw-r--r-- | lib/webtool/doc/src/part_notes.xml | 39 | ||||
-rw-r--r-- | lib/webtool/doc/src/part_notes_history.xml | 39 | ||||
-rw-r--r-- | lib/webtool/doc/src/ref_man.xml | 38 | ||||
-rw-r--r-- | lib/webtool/doc/src/start_webtool.xml | 103 | ||||
-rw-r--r-- | lib/webtool/doc/src/webtool.xml | 156 | ||||
-rw-r--r-- | lib/webtool/doc/src/webtool_chapter.xml | 248 |
13 files changed, 1057 insertions, 0 deletions
diff --git a/lib/webtool/doc/src/Makefile b/lib/webtool/doc/src/Makefile new file mode 100644 index 0000000000..7b86752738 --- /dev/null +++ b/lib/webtool/doc/src/Makefile @@ -0,0 +1,127 @@ +# ``The contents of this file are subject to the Erlang Public License, +# Version 1.1, (the "License"); you may not use this file except in +# compliance with the License. You should have received a copy of the +# Erlang Public License along with this software. If not, it can be +# retrieved via the world wide web at http://www.erlang.org/. +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See +# the License for the specific language governing rights and limitations +# under the License. +# +# The Initial Developer of the Original Code is Ericsson Utvecklings AB. +# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings +# AB. All Rights Reserved.'' +# +# $Id$ +# +include $(ERL_TOP)/make/target.mk +include $(ERL_TOP)/make/$(TARGET)/otp.mk + +# ---------------------------------------------------- +# Application version +# ---------------------------------------------------- +include ../../vsn.mk +VSN=$(WEBTOOL_VSN) +APPLICATION=webtool + +# ---------------------------------------------------- +# Release directory specification +# ---------------------------------------------------- +RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN) + +# ---------------------------------------------------- +# Target Specs +# ---------------------------------------------------- +XML_APPLICATION_FILES = ref_man.xml + +XML_REF1_FILES = start_webtool.xml + +XML_REF3_FILES = webtool.xml + +XML_PART_FILES = \ + part.xml \ + part_notes.xml \ + part_notes_history.xml + +XML_CHAPTER_FILES = \ + webtool_chapter.xml \ + notes.xml \ + notes_history.xml + +BOOK_FILES = book.xml + +XML_FILES = \ + $(BOOK_FILES) $(XML_CHAPTER_FILES) \ + $(XML_PART_FILES) $(XML_REF3_FILES) \ + $(XML_REF1_FILES) $(XML_APPLICATION_FILES) + +GIF_FILES = + +# ---------------------------------------------------- + +HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \ + $(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html) + +INFO_FILE = ../../info + +MAN1_FILES = $(XML_REF1_FILES:%.xml=$(MAN1DIR)/%.1) +MAN3_FILES = $(XML_REF3_FILES:%.xml=$(MAN3DIR)/%.3) + +HTML_REF_MAN_FILE = $(HTMLDIR)/index.html + +TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf + +# ---------------------------------------------------- +# FLAGS +# ---------------------------------------------------- +XML_FLAGS += +DVIPS_FLAGS += + +# ---------------------------------------------------- +# Targets +# ---------------------------------------------------- +$(HTMLDIR)/%.gif: %.gif + $(INSTALL_DATA) $< $@ + +docs: pdf html man + +$(TOP_PDF_FILE): $(XML_FILES) + +pdf: $(TOP_PDF_FILE) + +html: gifs $(HTML_REF_MAN_FILE) + + +clean clean_docs: + rm -rf $(HTMLDIR)/* + rm -f $(MAN1DIR)/* + rm -f $(MAN3DIR)/* + rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) + rm -f errs core *~ + +man: $(MAN1_FILES) $(MAN3_FILES) + +gifs: $(GIF_FILES:%=$(HTMLDIR)/%) + +debug opt: + +# ---------------------------------------------------- +# Release Target +# ---------------------------------------------------- +include $(ERL_TOP)/make/otp_release_targets.mk + +release_docs_spec: docs + $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf + $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf + $(INSTALL_DIR) $(RELSYSDIR)/doc/html + $(INSTALL_DATA) $(HTMLDIR)/* \ + $(RELSYSDIR)/doc/html + $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR) + $(INSTALL_DIR) $(RELEASE_PATH)/man/man1 + $(INSTALL_DATA) $(MAN1_FILES) $(RELEASE_PATH)/man/man1 + $(INSTALL_DIR) $(RELEASE_PATH)/man/man3 + $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3 + +release_spec: + diff --git a/lib/webtool/doc/src/book.xml b/lib/webtool/doc/src/book.xml new file mode 100644 index 0000000000..ace70b5726 --- /dev/null +++ b/lib/webtool/doc/src/book.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE book SYSTEM "book.dtd"> + +<book xmlns:xi="http://www.w3.org/2001/XInclude"> + <header titlestyle="normal"> + <copyright> + <year>2001</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>WebTool</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev>1.0</rev> + </header> + <insidecover> + </insidecover> + <pagetext>WebTool</pagetext> + <preamble> + </preamble> + <parts lift="no"> + <xi:include href="part.xml"/> + </parts> + <applications> + <xi:include href="ref_man.xml"/> + </applications> + <releasenotes> + <xi:include href="notes.xml"/> + </releasenotes> + <listofterms></listofterms> + <index></index> +</book> + diff --git a/lib/webtool/doc/src/fascicules.xml b/lib/webtool/doc/src/fascicules.xml new file mode 100644 index 0000000000..0678195e07 --- /dev/null +++ b/lib/webtool/doc/src/fascicules.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE fascicules SYSTEM "fascicules.dtd"> + +<fascicules> + <fascicule file="part" href="part_frame.html" entry="no"> + User's Guide + </fascicule> + <fascicule file="ref_man" href="ref_man_frame.html" entry="yes"> + Reference Manual + </fascicule> + <fascicule file="part_notes" href="part_notes_frame.html" entry="no"> + Release Notes + </fascicule> + <fascicule file="" href="../../../../doc/print.html" entry="no"> + Off-Print + </fascicule> +</fascicules> + diff --git a/lib/webtool/doc/src/make.dep b/lib/webtool/doc/src/make.dep new file mode 100644 index 0000000000..87526b3f73 --- /dev/null +++ b/lib/webtool/doc/src/make.dep @@ -0,0 +1,20 @@ +# ---------------------------------------------------- +# >>>> Do not edit this file <<<< +# This file was automaticly generated by +# /home/otp/bin/docdepend +# ---------------------------------------------------- + + +# ---------------------------------------------------- +# TeX files that the DVI file depend on +# ---------------------------------------------------- + +book.dvi: book.tex part.tex ref_man.tex start_webtool.tex \ + webtool.tex webtool_chapter.tex + +# ---------------------------------------------------- +# Source inlined when transforming from source to LaTeX +# ---------------------------------------------------- + +book.tex: ref_man.xml + diff --git a/lib/webtool/doc/src/notes.xml b/lib/webtool/doc/src/notes.xml new file mode 100644 index 0000000000..644cf7f7a8 --- /dev/null +++ b/lib/webtool/doc/src/notes.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE chapter SYSTEM "chapter.dtd"> + +<chapter> + <header> + <copyright> + <year>2004</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>Webtool Release Notes</title> + <prepared>otp_appnotes</prepared> + <docno>nil</docno> + <date>nil</date> + <rev>nil</rev> + <file>notes.xml</file> + </header> + <p>This document describes the changes made to the Webtool + application.</p> + +<section><title>WebTool 0.8.5</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + The documentation is now built with open source tools + (xsltproc and fop) that exists on most platforms. One + visible change is that the frames are removed.</p> + <p> + Own Id: OTP-8201</p> + </item> + </list> + </section> + +</section> + +<section><title>WebTool 0.8.4</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p>The copyright notices have been updated.</p> + <p> + Own Id: OTP-7851</p> + </item> + </list> + </section> + +</section> +<section><title>WebTool 0.8.3.2</title> + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Minor updates.</p> + <p> + Own Id: OTP-6998</p> + </item> + </list> + </section> + +</section> + + <section> + <title>WebTool 0.8.3.1</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>Minor Makefile changes.</p> + <p>Own Id: OTP-6689</p> + </item> + <item> + <p>Obsolete guard tests (such as list()) have been replaced + with the modern guard tests (such as is_list()).</p> + <p>Own Id: OTP-6725</p> + </item> + </list> + </section> + </section> + + <section> + <title>WebTool 0.8.3</title> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>Removed some dead code discovered by Dialyzer.</p> + <p>Own Id: OTP-6041</p> + </item> + </list> + </section> + </section> +</chapter> + diff --git a/lib/webtool/doc/src/notes_history.xml b/lib/webtool/doc/src/notes_history.xml new file mode 100644 index 0000000000..edab54d61f --- /dev/null +++ b/lib/webtool/doc/src/notes_history.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE chapter SYSTEM "chapter.dtd"> + +<chapter> + <header> + <copyright> + <year>2006</year> + <year>2007</year> + <holder>Ericsson AB, All Rights Reserved</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + The Initial Developer of the Original Code is Ericsson AB. + </legalnotice> + + <title>Webtool Release Notes History</title> + <prepared>otp_appnotes</prepared> + <docno>nil</docno> + <date>nil</date> + <rev>nil</rev> + </header> + + <section> + <title>Webtool 0.8.2</title> + + <section> + <title>Fixed Bugs and Malfunctions</title> + <list type="bulleted"> + <item> + <p>Bugfix: <c>webtool</c> crashed when trying to find a free + port number if connection failed with other reason than + <c>econnrefused</c>.</p> + <p>Own Id: OTP-5166</p> + </item> + </list> + </section> + + <section> + <title>Improvements and New Features</title> + <list type="bulleted"> + <item> + <p>Misc improvements:</p> + <list type="bulleted"> + <item>The function <c>debug_app/1</c> and some error + printouts are added to simplify debugging of own + application.</item> + <item>Multiple webtool instances can now be started on + the same host. If the default port (8888) is in use, port + 8889 is tried. If 8889 is also used, 8890 is tried and so + on. Max number of ports tried is 256.</item> + <item><em>Incompatible:</em> If <c>Data</c> is set to + <c>PortNumber</c> in <c>start(Path,Data)</c>, the default + data will be used for ip-number (<c>127.0.0.1</c>) and + server name (<c>localhost</c>).</item> + </list> + <p>*** POTENTIAL INCOMPATIBILITY ***</p> + <p>Own Id: OTP-4724</p> + </item> + </list> + </section> + </section> +</chapter> + diff --git a/lib/webtool/doc/src/part.xml b/lib/webtool/doc/src/part.xml new file mode 100644 index 0000000000..9306ea020e --- /dev/null +++ b/lib/webtool/doc/src/part.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE part SYSTEM "part.dtd"> + +<part xmlns:xi="http://www.w3.org/2001/XInclude"> + <header> + <copyright> + <year>2001</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>WebTool User's Guide</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + </header> + <description> + <p><em>WebTool</em> provides a easy way to use web based tools with + Erlang/OTP. It configures and starts a webserver as well as all + available tools.</p> + </description> + <xi:include href="webtool_chapter.xml"/> +</part> + diff --git a/lib/webtool/doc/src/part_notes.xml b/lib/webtool/doc/src/part_notes.xml new file mode 100644 index 0000000000..7d5592d3aa --- /dev/null +++ b/lib/webtool/doc/src/part_notes.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE part SYSTEM "part.dtd"> + +<part xmlns:xi="http://www.w3.org/2001/XInclude"> + <header> + <copyright> + <year>2004</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>WebTool Release Notes</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + </header> + <description> + <p><em>WebTool</em> provides an easy way to use web based tools with + Erlang/OTP. It configures and starts a webserver as well as all + available tools.</p> + <p>For information about older versions, see + <url href="part_notes_history_frame.html">Release Notes History</url>.</p> + </description> + <xi:include href="notes"/> +</part> + diff --git a/lib/webtool/doc/src/part_notes_history.xml b/lib/webtool/doc/src/part_notes_history.xml new file mode 100644 index 0000000000..c1f6f846f5 --- /dev/null +++ b/lib/webtool/doc/src/part_notes_history.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE part SYSTEM "part.dtd"> + +<part> + <header> + <copyright> + <year>2006</year> + <year>2007</year> + <holder>Ericsson AB, All Rights Reserved</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + The Initial Developer of the Original Code is Ericsson AB. + </legalnotice> + + <title>WebTool Release Notes History</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + </header> + <description> + <p><em>WebTool</em> provides a easy way to use web based tools with + Erlang/OTP. It configures and starts a webserver as well as all + available tools.</p> + </description> + <include file="notes_history"></include> +</part> + diff --git a/lib/webtool/doc/src/ref_man.xml b/lib/webtool/doc/src/ref_man.xml new file mode 100644 index 0000000000..537e8697c9 --- /dev/null +++ b/lib/webtool/doc/src/ref_man.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE application SYSTEM "application.dtd"> + +<application xmlns:xi="http://www.w3.org/2001/XInclude"> + <header> + <copyright> + <year>2001</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>WebTool Reference Manual</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + </header> + <description> + <p><em>WebTool</em> provides an easy way to use web based tools with + Erlang/OTP. It configures and starts a webserver as well as all + available tools.</p> + </description> + <xi:include href="webtool.xml"/> + <xi:include href="start_webtool.xml"/> +</application> + diff --git a/lib/webtool/doc/src/start_webtool.xml b/lib/webtool/doc/src/start_webtool.xml new file mode 100644 index 0000000000..184285c631 --- /dev/null +++ b/lib/webtool/doc/src/start_webtool.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE comref SYSTEM "comref.dtd"> + +<comref> + <header> + <copyright> + <year>2003</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>start_webtool</title> + <prepared></prepared> + <responsible></responsible> + <docno>1</docno> + <approved></approved> + <checked></checked> + <date>2003-06-18</date> + <rev></rev> + <file>start_webtool.sgml</file> + </header> + <com>start_webtool</com> + <comsummary>WebTool Start Script</comsummary> + <description> + <p>The <c>start_webtool</c> script starts WebTool, a WebTool + application and a web browser pointing to this application.</p> + </description> + <funcs> + <func> + <name>start_webtool application [ browser ]</name> + <fsummary>Start a WebTool Application</fsummary> + <desc> + <p>Starts WebTool, the given WebTool Application and a web + browser pointing to this application. + </p> + <p>If no argument is given, a list of available applications + is displayed, e.g.</p> + <pre> +>start_webtool +Starting webtool... +WebTool is available at http://localhost:8888/ +Or http://127.0.0.1:8888/ + +Usage: start_webtool application [ browser ] + +Available applications are: [orber,appmon,crashdump_viewer,webcover] +Default browser is 'iexplore' (Internet Explorer) on Windows or else 'netscape' </pre> + <p>To start any of the listed applications, give the + application name as the first argument, e.g.</p> + <pre> +>start_webtool webcover +Starting webtool... +WebTool is available at http://localhost:8888/ +Or http://127.0.0.1:8888/ +Starting webcover... +Sending URL to netscape...done </pre> + <p>The WebTool application WebCover is then started and the + default browser is used. The default browser is Internet + Explorer on Windows or else Netscape. + </p> + <p>To use another browser, give the browser's start command + as the second argument, e.g.</p> + <pre> +>start_webtool webcover mozilla +Starting webtool... +WebTool is available at http://localhost:8888/ +Or http://127.0.0.1:8888/ +Starting webcover... +Sending URL to mozilla...done </pre> + <p>If the given browser name is not known to WebTool, WebTool + will run it as a command with the start URL as the only + argument, e.g.</p> + <pre> +>start_webtool webcover mybrowser +Starting webtool... +WebTool is available at http://localhost:8888/ +Or http://127.0.0.1:8888/ +Starting webcover... +Starting mybrowser... </pre> + <p>Here the command <c>"mybrowser http://localhost:8888/webcover"</c> is executed. + </p> + </desc> + </func> + </funcs> + + <section> + <title>See Also</title> + <p><seealso marker="webtool">webtool(3)</seealso></p> + </section> +</comref> + diff --git a/lib/webtool/doc/src/webtool.xml b/lib/webtool/doc/src/webtool.xml new file mode 100644 index 0000000000..55bac8bd34 --- /dev/null +++ b/lib/webtool/doc/src/webtool.xml @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE erlref SYSTEM "erlref.dtd"> + +<erlref> + <header> + <copyright> + <year>2001</year> + <year>2007</year> + <holder>Ericsson AB, All Rights Reserved</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + The Initial Developer of the Original Code is Ericsson AB. + </legalnotice> + + <title>webtool</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + </header> + <module>webtool</module> + <modulesummary>WebTool is a tool used to simplify the implementation of web based tools with Erlang/OTP.</modulesummary> + <description> + <p>WebTool makes it easy to use web based tools with Erlang/OTP. WebTool + configures and starts the webserver httpd.</p> + </description> + <funcs> + <func> + <name>start()-> {ok,Pid}| {stop,Reason}</name> + <fsummary>Start WebTool.</fsummary> + <desc> + <p>Start WebTool with default data, i.e. port 8888, ip-number + 127.0.0.1, and server-name <c>localhost</c>. If port 8888 is + in use, port 8889 is tried instead. If 8889 is also in use, + 8890 is tried and so on. Max number of ports tried is 256. + </p> + <p>The <c>mime.types</c> file and WebTool's own HTML files + are assumed to be in the directory + <c><![CDATA[webtool-<vsn>/priv/root/conf]]></c>.</p> + </desc> + </func> + <func> + <name>start(Path,Data)->{ok,Pid}|{stop,Reason}</name> + <fsummary>Start WebTool with default configuration.</fsummary> + <type> + <v>Path = string() | standard_path</v> + <v>Data = [Port,Address,Name] | PortNumber | standard_data</v> + <v>Port = {port,PortNumber}</v> + <v>Address = {bind_address,IpNumber}</v> + <v>Name = {server_name,ServerName}</v> + <v>PortNumber = integer()</v> + <v>IpNumber = tuple(), e.g. {127,0,0,1}</v> + <v>ServerName = string()</v> + <v>Pid = pid()</v> + </type> + <desc> + <p>Use this function to start WebTool if the default port, + ip-number,servername or path can not be used.</p> + <p><c>Path</c> is the directory where the <c>mime.types</c> + file and WebTool's own HTML files are located. By default + this is <c><![CDATA[webtool-<vsn>/priv]]></c>, and in most cases there + is no need to change this. If <c>Path</c> is set to + <c>standard_path</c> the default will be used.</p> + <p>If <c>Data</c> is set to <c>PortNumber</c>, the default data + will be used for ip-number (<c>127.0.0.1</c>) and server + name (<c>localhost</c>).</p> + </desc> + </func> + <func> + <name>stop()->void</name> + <fsummary>Stop WebTool.</fsummary> + <desc> + <p>Stop WebTool and the tools started by WebTool.</p> + </desc> + </func> + <func> + <name>debug_app(Module)->void</name> + <fsummary>Debug a WebTool application.</fsummary> + <type> + <v>Module = atom()</v> + </type> + <desc> + <p>Debug a WebTool application by tracing all functions in the + given module which are called from WebTool.</p> + </desc> + </func> + <func> + <name>stop_debug()->void</name> + <fsummary>Stop debugging an application and format the trace log.</fsummary> + <desc> + <p>Stop the tracing started by <c>debug_app/1</c>, and format + the trace log.</p> + </desc> + </func> + </funcs> + + <section> + <title>CALLBACK FUNCTIONS</title> + <p>The following callback function must be implemented by each web + based tool that will be used via WebTool. When started, WebTool + searches the Erlang code path for *.tool files to locate all web + based tools and their callback functions. See the <seealso marker="webtool_chapter">WebTool User's Guide</seealso> for more + information about the *.tool files.</p> + </section> + <funcs> + <func> + <name>Module:Func(Data)-> {Name,WebData}|error</name> + <fsummary>Returns configuration data needed by WebTool to configure and start a tool.</fsummary> + <type> + <v>Data = term()</v> + <v>Name = atom()</v> + <v>WebData = [WebOptions]</v> + <v>WebOptions = LinkData | Alias | Start</v> + <v>LinkData = {web_data,{ToolName,Url}}</v> + <v>Alias = {alias,{VirtualPath,RealPath}} | {alias,{erl_alias,Path,[Modules]}</v> + <v>Start = {start,StartData}</v> + <v>ToolName = Url = VirtualPath = RealPath = Path = string()</v> + <v>Modules = atom()</v> + <v>StartData = AppData | ChildSpec | Func</v> + <v>AppData = {app,AppName}</v> + <v>ChildSpec = {child,child_spec()}</v> + <d>See the Reference Manual for the module supervisor in the STDLIB application for details about child_spec().</d> + <v>Func = {func,{StartMod,StartFunc,StartArg}, {StopMod,StopFunc,StopArg}}</v> + <v>AppName = StartMod = StartFunc = StopMod = StopFunc =atom()</v> + <v>StartArg = StopArg = [term()]</v> + </type> + <desc> + <p>This is the configuration function (<c>config_func</c>) + which must be stated in the <c>*.tool</c> file.</p> + <p>The function is called by WebTool at startup to retrieve the + data needed to start and configure the tool. <c>LinkData</c> is + used by WebTool to create the link to the tool. <c>Alias</c> is + used to create the aliases needed by the webserver. <c>Start</c> + is used to start and stop the tool.</p> + </desc> + </func> + </funcs> + + <section> + <title>See Also</title> + <p><seealso marker="start_webtool">start_webtool(1)</seealso>, + <seealso marker="webtool_chapter">WebTool User's Guide</seealso></p> + </section> +</erlref> + diff --git a/lib/webtool/doc/src/webtool_chapter.xml b/lib/webtool/doc/src/webtool_chapter.xml new file mode 100644 index 0000000000..ceadce382d --- /dev/null +++ b/lib/webtool/doc/src/webtool_chapter.xml @@ -0,0 +1,248 @@ +<?xml version="1.0" encoding="latin1" ?> +<!DOCTYPE chapter SYSTEM "chapter.dtd"> + +<chapter> + <header> + <copyright> + <year>2001</year><year>2009</year> + <holder>Ericsson AB. All Rights Reserved.</holder> + </copyright> + <legalnotice> + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + </legalnotice> + + <title>WebTool User Guide</title> + <prepared></prepared> + <docno></docno> + <date></date> + <rev></rev> + <file>webtool_chapter.xml</file> + </header> + + <section> + <title>Introduction </title> + <p>WebTool provides an easy and efficient way to implement web + based tools with Erlang/OTP. WebTool configures and starts the + webserver and the various web based tools.</p> + <p>All tools that shall run under WebTool must have a *.tool + file in the code path or in its priv directory. When WebTool + starts it searches the code path for such files. For each + <c>ebin</c> directory in the path, the <c>priv</c> directory is + also searched. The *.tool files contain the configuration data + for each web based tool.</p> + </section> + + <section> + <title>Starting WebTool</title> + <p>Start WebTool by calling the function <c>webtool:start/0</c> or + <c>webtool:start/2</c>. If <c>webtool:start/0</c> is used the + start page of WebTool is available at + <em>http://localhost:8888/</em> or + <em>http://127.0.0.1:8888/</em>, and the directory containing + the root directory for the webserver, is assumed to be + <c><![CDATA[webtool-<vsn>/priv]]></c>.</p> + <p>Use <c>webtool:start/2</c> if the default path for the root + directory, port, ip-number or server name can not be used. See + the Reference Manual for <seealso marker="webtool">webtool</seealso> for more information.</p> + <p>WebTool, with the default configuration as in <c>start/0</c>, + can also be started with the <c>start_webtool</c> script which + is available in the <c>priv</c> directory of the WebTool + application. See the Reference Manual for <seealso marker="start_webtool">start_webtool</seealso> for further + information about this script. For Windows users, the batch file + <c>start_webtool.bat</c> can be used for the same purpose.</p> + </section> + + <section> + <title>Using WebTool</title> + <p>Start WebTool and point the browser to the corresponding URL. + At the top of the page there is a frame with a link named + <em>WebTool</em>. Click that link and a page where it is + possible to start the available tools will appear in the main + frame.</p> + </section> + + <section> + <title>Start a web based tool</title> + <p>Click on the link labeled <em>WebTool</em> in the topmost frame, + select the checkbox for each tool to start and + click on the button labeled <em>Start</em>. A link to each tool + that WebTool succeeded to start will appear in the topmost frame.</p> + </section> + + <section> + <title>Stop a web based tool</title> + <p>Click on the link labeled <em>WebTool</em> in the topmost + frame. Select <em>Stop Tools</em> in the left frame. Select the + checkbox for each tool to stop and click on the button labeled + <em>Stop</em>.</p> + </section> + + <section> + <title>Develop new web based tools</title> + <p>WebTool can be used as a framework when developing new web based + tools.</p> + <p>A web based tool running under WebTool will typically consist of + three parts.</p> + <list type="bulleted"> + <item>A *.tool file which defines how WebTool can find the tool's + configuration data</item> + <item>The Erlang code generating the web interface to the tool (HTML + code)</item> + <item>The tool itself.</item> + </list> + <p>In most cases it is a good idea to separate the code for + creation of the html-pages and the code for the logic. This + increases the readability of the code and the logic might be + possible to reuse.</p> + + <section> + <title>The *.tool file</title> + <p>When WebTool starts it searches the current path for + <c>*.tool</c> files to find all available tools. The *.tool + file contains a version identifier and a list of tuples which + is the configuration data. The version identifier specifies + the *.tool file version, i.e. not the version of + webtool. Currently the only valid version is "1.2" and the + only valid configuration tag is + <c>config_func</c>. <c>config_func</c> specifies which + function WebTool must call to get further configuration data + for the tool. This means that a *.tool file generally must + look like this:</p> + <code type="none"> + {version,"1.2"}. + [{config_func,{Module,Function,Arguments}}]. </code> + <p><c>Module</c> is the name of the module where the callback + function is defined. <c>Function</c> is the name of the + callback function, and <c>Arguments</c> is the list of + arguments to the callback function.</p> + </section> + + <section> + <title>The configuration function</title> + <p>The *.tool file points out a configuration function. This + function must return a list of configuration parameters (see + the Reference Manual for <seealso marker="webtool">webtool</seealso>).</p> + <p>The <c>web_data</c> parameter is mandatory and it specifies + the name of the tool and the link to the tool's start + page. All other parameters are optional.</p> + <p>If the tool requires any processes to run, the <c>start</c> + parameter specifies the function that WebTool must call in + order to start the process(es).</p> + <p>The <c>alias</c> parameters are passed directly on to the + webserver (INETS). The webserver has three ways to create + dynamic web pages CGI, Eval Scheme and Erl Scheme. All tools + running under WebTool must use Erl Scheme.</p> + <p>Erl Scheme tries to resemble plain CGI. The big difference is + that Erl Scheme can only execute Erlang code. The code will + furthermore be executed on the same instance as the webserver.</p> + <p>An URL which calls an Erlang function with Erl Scheme can have + the following syntax:</p> + <code type="none"><![CDATA[ +http://Servername:Port/ErlScriptAlias/Mod/Func<?QueryString> ]]></code> + <p>An <c>alias</c> parameter in the configuration function can be + an ErlScriptAlias as used in the above URL. The definition of + an ErlScripAlias shall be like this:</p> + <p><c>{alias,{erl_alias,Path,[Modules]}}</c>, e.g.</p> + <p><c>{alias,{erl_alias,"/testtool",[helloworld]}}</c></p> + <p>The following URL will then cause a call to the function + helloworld:helloworld/2 (if WebTool is started with default + settings i.e. servername "localhost" and port 8888):</p> + <p><c>http://localhost:8888/testtool/helloworld/helloworld</c></p> + <p>Note that the module <c>helloworld</c> must be in the code + path of the node running WebTool.</p> + <p>Functions that are called via the Erl Scheme must take two + arguments, <c>Environment</c> and <c>Input</c>. + </p> + <list type="bulleted"> + <item><c>Environment</c> is a list of key/value tuples.</item> + <item><c>Input</c> is the part of the URL after the "?", i.e. the + part of the URL containing name-value pairs. If the page was + called with the URL: + <br></br> +<c><![CDATA[http://localhost:8888/testtool/helloworld/helloworld?input1=one&input2=two]]></c> <br></br> +<c>Input</c> will be the string + <c><![CDATA["input1=one&input2=two"]]></c>. In the module + <c>httpd</c> in the INETS application there is a function + <c>parse_query</c> which will parse such a string and return + a list of key-value tuples.</item> + </list> + <p>An <c>alias</c> parameter in the configuration function can + also be a normal path alias. This can e.g. be used to point + out a directory where HTML files are stored. The following + definition states that the URL + <c>http://localhost:8888/mytool_home/</c> really points to the + directory <c>/usr/local/otp/lib/myapp-1.0/priv</c>:</p> + <p><c>{alias,{"/mytool_home","/usr/local/otp/lib/myapp-1.0/priv"}}</c></p> + <p>See the INETS documentation, especially the module + <c>mod_esi</c>, for a more in depht coverage of Erl Scheme.</p> + </section> + + <section> + <title>A small example</title> + <p>A Hello World example that uses Erl Scheme would look like + this. Note that this example does not have a process running + and thus does not need a <c>start</c> parameter in the + configuration function. + </p> + <p><em>helloworld.erl:</em></p> + <pre> + -module(helloworld). + -export([config_data/0]). + -export([helloworld/2]). + + config_data()-> + {testtool, + [{web_data,{"TestTool","/testtool/helloworld/helloworld"}}, + {alias,{erl_alias,"/testtool",[helloworld]}}]}. + + helloworld(_Env,_Input)-> + [header(),html_header(),helloworld_body(),html_end()]. + + header() -> + header("text/html"). + + header(MimeType) -> + "Content-type: " ++ MimeType ++ "\\r\ +\\r\ +". + + html_header() -> + "<HTML> + <HEAD> + <TITLE>Hello world Example </TITLE> + </HEAD>\ +". + + helloworld_body()-> + "<BODY>Hello World</BODY>". + + html_end()-> + "</HTML>". + </pre> + <p>To use this example with WebTool a *.tool file must be created + and added to a directory in the current path, e.g. the same + directory as the compiled <c>helloworld.beam</c>.</p> + <p><em>testtool.tool:</em></p> + <code type="none"> + {version,"1.2"}. + [{config_func, {helloworld,config_data,[]}}]. + </code> + <p>When <c>helloworld.erl</c> is compiled, start WebTool by + calling the function <c>webtool:start()</c> and point your + browser to <em>http://localhost:8888/</em>. Select WebTool in + the topmost frame and start TestTool from the web page. Click + on the link labeled <em>TestTool</em> in the topmost frame.</p> + </section> + </section> +</chapter> + |