diff options
| author | wei <> | 2006-07-14 06:46:31 +0000 | 
|---|---|---|
| committer | wei <> | 2006-07-14 06:46:31 +0000 | 
| commit | c004bbdf4f0e824e5ccbaef8f98ca4a3d44d3b49 (patch) | |
| tree | 9bbf7122021251617c4fba1163eaa5ee222c57d7 /buildscripts/texbuilder/sqlmap | |
| parent | 61bb16ee2e5f0a66234e1575242169a10fde47b5 (diff) | |
Changed SQLMap manual into a prado app.
Diffstat (limited to 'buildscripts/texbuilder/sqlmap')
| -rw-r--r-- | buildscripts/texbuilder/sqlmap/build.php | 81 | ||||
| -rw-r--r-- | buildscripts/texbuilder/sqlmap/pages.php | 62 | ||||
| -rw-r--r-- | buildscripts/texbuilder/sqlmap/sqlmap.tex | 138 | 
3 files changed, 281 insertions, 0 deletions
| diff --git a/buildscripts/texbuilder/sqlmap/build.php b/buildscripts/texbuilder/sqlmap/build.php new file mode 100644 index 00000000..5717c50c --- /dev/null +++ b/buildscripts/texbuilder/sqlmap/build.php @@ -0,0 +1,81 @@ +<?php
 +
 +// TBD: subsections in Control Reference
 +
 +$pdflatexExec = "C:/Wei/miktex/texmf/MiKTeX/bin/pdflatex.exe";
 +$pdfTex = "$pdflatexExec -interaction=nonstopmode -max-print-line=120 %s";
 +
 +$mainTexFile = dirname(__FILE__).'/sqlmap.tex';
 +
 +//page root location
 +$base = realpath(dirname(__FILE__).'/../protected/pages/');
 +
 +//-------------- END CONFIG ------------------
 +
 +$pages = include('pages.php');
 +
 +include('../../../../prado-3.0/buildscripts/texbuilder/Page2Tex.php');
 +
 +// ---------------- Create the Tex files ---------
 +$count = 1;
 +$j = 1;
 +$current_path = '';
 +echo "Compiling .page files to Latex files\n\n";
 +
 +$parser = new Page2Tex($base, dirname(__FILE__));
 +
 +foreach($pages as $chapter => $sections)
 +{
 +	$content = '\chapter{'.$chapter.'}'.$parser->get_chapter_label($chapter);
 +	echo "Creating ch{$count}.txt => Chapter {$count}: {$chapter}\n";
 +	echo str_repeat('-',60)."\n";
 +	foreach($sections as $section)
 +	{
 +		echo "    Adding $section\n";
 +		$page = $base.'/'.$section;
 +		$current_path = $page;
 +		$parser->setCurrentPage($current_path);
 +
 +		//add id to <h1>, <h2>, <3>
 +		$tmp_content = $parser->set_header_id(file_get_contents($page),$j++);
 +//		file_put_contents($page, $tmp_content);
 +
 +		$content .= $parser->get_section_label($section);
 +		$file_content = file_get_contents($page);
 +		$tex =
 +		$content .= $parser->parse_html($page,$file_content);
 +	}
 +
 +	//var_dump($content);
 +	file_put_contents("ch{$count}.tex", $content);
 +	$count++;
 +	echo "\n";
 +}
 +
 +//$indexer->commit();
 +
 +if($argc <= 1 && $count > 1)
 +{
 +	echo "** Use pdflatex to compile quickstart.tex to obtain PDF version of quickstart tutorial. **\n";
 +	exit;
 +}
 +if($argv[1] == 'pdf')
 +{
 +	if(is_file($pdflatexExec))
 +	{
 +		//build pdfTex
 +		$command=sprintf($pdfTex,$mainTexFile);
 +		system($command);
 +		system($command); //run it twice
 +
 +		echo "\n\n** PDF file quickstart.pdf created **\n\n";
 +
 +	}
 +	else
 +	{
 +		echo " Unable to find pdfLatex executable $pdflatexExec";
 +	}
 +}
 +
 +
 +?>
 diff --git a/buildscripts/texbuilder/sqlmap/pages.php b/buildscripts/texbuilder/sqlmap/pages.php new file mode 100644 index 00000000..411ebc4c --- /dev/null +++ b/buildscripts/texbuilder/sqlmap/pages.php @@ -0,0 +1,62 @@ +<?php
 +
 +$pages['Introduction'] = array(
 +	'Manual/Overview.page',
 +	'Manual/BigPicture.page'
 +);
 +
 +$pages['Installation and Setup'] = array(
 +	'Manual/Installing.page',
 +	'Manual/Configuring.page',
 +//	'Manual/DataMapperConfiguration.page',
 +	'Manual/ConfigurationElements.page'
 +);
 +
 +$pages['SQLMap for PHP Tutorial'] = array(
 +	'Tutorial/TestFirst.page',
 +	'Tutorial/TestSecond.page',
 +	'Tutorial/TestAgain.page'
 +);
 +
 +$pages['Using SQLMap DataMapper'] = array(
 +	'Manual/BuildingTSqlMapper.page',
 +	'Manual/DataMapperAPI.page',
 +	'Manual/CodingExamples.page'
 +);
 +
 +$pages['Working with Data Maps'] = array(
 +	'Manual/WorkingWithDataMaps.page',
 +//	'Manual/DataMapDefinition.page',
 +	'Manual/MappedStatements.page',
 +	'Manual/TheSQL.page',
 +	'Manual/StatementElementAttributes.page'
 +);
 +
 +$pages['Parameter Maps and Inline Parameters'] = array(
 +	'Manual/ParameterMap.page',
 +//	'Manual/Parameter.page',
 +	'Manual/InlineParameterMaps.page',
 +//	'Manual/StandardTypeParameters.page',
 +//	'Manual/ArrayTypeParameters.page'
 +);
 +
 +$pages['Parameter Maps and Inline Parameters'] = array(
 +	'Manual/ResultMaps.page',
 +//	'Manual/ExtendingResultMaps.page',
 +	'Manual/ResultMapAttributes.page',
 +//	'Manual/ResultElements.page',
 +	'Manual/CustomTypeHandlers.page',
 +	'Manual/InheritanceMapping.page',
 +	'Manual/ImplicitResultMaps.page',
 +	'Manual/ComplexProperties.page',
 +	'Manual/CompositeKeys.page'
 +);
 +
 +$pages['Advanced Topics'] = array(
 +	'Manual/CacheModels.page',
 +	'Manual/DynamicSQL.page'
 +);
 +
 +return $pages;
 +
 +?>
\ No newline at end of file diff --git a/buildscripts/texbuilder/sqlmap/sqlmap.tex b/buildscripts/texbuilder/sqlmap/sqlmap.tex new file mode 100644 index 00000000..5000b547 --- /dev/null +++ b/buildscripts/texbuilder/sqlmap/sqlmap.tex @@ -0,0 +1,138 @@ +\documentclass{book}
 +\usepackage[pdftex]{graphicx}
 +\usepackage[pdftex]{hyperref}
 +
 +\usepackage{fancyhdr,url}
 +
 +%---------- fonts Type 1 -----------------
 +%\usepackage{times}
 +%\usepackage[T1]{fontenc}
 +\usepackage{textcomp}
 +
 +%
 +
 +%------------------------Page set-up-----------------------------------------
 +
 +\renewcommand{\baselinestretch}{1.25}
 +\setlength{\hoffset}{-1in}
 +\setlength{\oddsidemargin}{3.5cm}
 +\setlength{\evensidemargin}{3.5cm}
 +\setlength{\topmargin}{0cm}
 +\setlength{\footskip}{2cm}
 +\setlength{\headheight}{14pt}
 +\setlength{\marginparwidth}{0cm}
 +\setlength{\marginparsep}{0cm}
 +\setlength{\marginparpush}{0cm}
 +\setlength{\textwidth}{15cm}
 +\setlength{\parindent}{0cm}
 +\setlength{\parskip}{0.75\baselineskip}
 +
 +%------------------------------------------------------------------------------
 +
 +
 +%---- change link style ----
 +\hypersetup{colorlinks, linkcolor=blue, pdfstartview={FitH}}
 +
 +
 +% Pages and Fancyheadings stuff
 +%-----------------------------------------------------------------------
 +\cfoot{\thepage}
 +\fancyhead[LE,RO]{}
 +\fancyhead[LO]{\nouppercase{\scshape\rightmark}}
 +\fancyhead[RE]{\nouppercase{\scshape\leftmark}}
 +%-----------------------------------------------------------------------
 +
 +% boxes
 +
 +\newsavebox{\fmboxb}
 +\newenvironment{mybox}
 +    {\vspace{-2mm}\begin{center}\begin{lrbox}{\fmboxb}\hspace{2mm}
 +        \begin{minipage}{0.85\textwidth} \vspace{2mm}\small}
 +    {  \vspace{2mm} \end{minipage}
 +    \hspace{2mm}\end{lrbox}\fbox{\usebox{\fmboxb}}\end{center}}
 +
 +
 +
 +%----------------- TITLE --------------
 +
 +\title{\Huge \bfseries SQLMap PHP DataMapper v1.0
 +    \thanks{Copyright 2006. All Rights Reserved.}
 +}
 +\author{Wei Zhuo}
 +\date{\today}
 +
 +
 +%-------------- BEGIN DOCUMENT ------------------
 +
 +
 +\begin{document}
 +
 +\maketitle
 +
 +\pagestyle{plain}
 +\addcontentsline{toc}{chapter}{Contents}
 +\pagenumbering{roman}
 +\tableofcontents
 +
 +\chapter*{Legal Notice}
 +\addcontentsline{toc}{chapter}{Legal Notice}
 +
 +Copies of this document may be made for your own use and for distribution to
 +others, provided that you do not charge any fee for such copies and further
 +provided that each copy contains this Copyright Notice, whether distributed in
 +print or electronically.
 +
 +This document is largely based on the iBATIS.NET -- DataMapper Application
 +Framework Developer Guide.
 +
 +\chapter*{License}
 +\addcontentsline{toc}{chapter}{License}
 +SQLMap for PHP is free software released under the terms of the following BSD license.\\
 +Copyright 2004-2006, PradoSoft (http://www.pradosoft.com)\\
 +All rights reserved.
 +
 +Redistribution and use in source and binary forms, with or without
 +modification, are permitted provided that the following conditions are met:
 +\begin{enumerate}
 +    \item Redistributions of source code must retain the above copyright notice,
 +this list of conditions and the following disclaimer.
 +
 + \item Redistributions in binary form must reproduce the above copyright notice,
 +this list of conditions and the following disclaimer in the documentation
 +and/or other materials provided with the distribution.
 +
 +\item Neither the name of the developer nor the names of its contributors may
 +be used to endorse or promote products derived from this software without
 +specific prior written permission.
 +\end{enumerate}
 +
 +\begin{verbatim}
 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 +\end{verbatim}
 +
 +
 +\newpage
 +
 +\pagestyle{fancyplain}
 +\pagenumbering{arabic}
 +
 +\include{ch1}
 +\include{ch2}
 +\include{ch3}
 +\include{ch4}
 +\include{ch5}
 +\include{ch6}
 +\include{ch7}
 +\include{ch8}
 +\include{ch9}
 +
 +\end{document}
 | 
