oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r979904 [5/5] - in /incubator/oodt/tools/oodtsite.publisher/trunk: ./ docs/ oodtsite/ oodtsite/publisher/ oodtsite/publisher/rules/ oodtsite/publisher/tests/ oodtsite/publisher/tests/data/ oodtsite/publisher/tests/data/oodt/ oodtsite/publis...
Date Tue, 27 Jul 2010 23:03:48 GMT
Added: incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/oodt.css
URL: http://svn.apache.org/viewvc/incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/oodt.css?rev=979904&view=auto
==============================================================================
--- incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/oodt.css (added)
+++ incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/oodt.css Tue Jul
27 23:03:44 2010
@@ -0,0 +1,457 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more contributor
+* license agreements.  See the NOTICE.txt file distributed with this work for
+* additional information regarding copyright ownership.  The ASF licenses this
+* file to you under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.  You may obtain a copy of
+* the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+* License for the specific language governing permissions and limitations under
+* the License.
+*
+* Apache OODT style sheet: we're stylin', baby!
+*/
+
+* { margin: 0; padding: 0; }
+* :link, :visited { text-decoration: none; }
+* a img, :link img, :visited img { border: none; } 
+a { outline: none; }
+table { border-spacing: none; }
+img { vertical-align: text-bottom;}
+
+html { height: 100%; }
+body {
+    font-family: "Lucida Grande", FreeSans, Trebuchet, sans-serif;
+    font-size: 90%;
+    color: rgb(85, 85, 85);
+    background-color: white;
+    text-align: left;
+    height: 100%;
+}
+
+img {
+    border: 0px;
+}
+#content img {
+    max-width: 600px;
+}
+#content table {
+    font-size: 80%;
+    margin: 1em;
+    width: 580px;
+    border-collapse: collapse;
+    text-align: left;
+}
+#content table th {
+    font-size: 120%;
+    font-weight: normal;
+    color: rgb(20, 29, 85);
+    padding: 0.5em 0.8em;
+    border-bottom: 3px solid rgb(24, 38, 118);
+}
+#content table td {
+    border-bottom: 1px solid rgb(204, 204, 204);
+    color: rgb(85, 85, 85);
+    padding: 0.5em 0.5em;
+}
+#content table tbody tr:hover td {
+    color: rgb(19, 29, 84);
+}
+form {
+    margin: 0px;
+    padding: 0px;
+}
+
+a {
+    color: rgb(31, 31, 107);
+    border-bottom: 1px rgb(204, 204, 204) solid;
+}
+a:active {
+    color: red;
+    background-color: transparent;
+}
+a:visited {
+    color: purple;
+    background-color: transparent;
+}
+h1, h2, h3, h4, h5, h6 {
+    margin: 2em 0 0 0;
+    padding: 0px;
+    font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
+}
+
+h1 {
+    font-size: 170%;
+    color: rgb(22, 21, 70);
+    margin-bottom: 0.1em;
+    font-weight: bold;
+}
+
+h2 {
+    font-size: 150%;
+    font-weight: bold;
+    margin-bottom: 0.1em;
+}
+h3 {
+    font-size: 120%;
+    font-weight: bold;
+}
+
+h4 {
+    text-transform: uppercase;
+    font-size: 110%;
+    color: rgb(85, 85, 85);
+    font-weight: bold;
+    margin-bottom: 1em;
+}
+h5 {
+    font-size: 100%;
+    color: rgb(85, 101, 112);
+    font-weight: bold;
+    margin-top: 13px;
+    margin-bottom: 5px;
+}
+p, li, dd {
+    margin: 0 0 1.5em 0;
+    line-height: 1.3em;
+    font-size: 85%;
+}
+dt {
+    font-size: 85%;
+}
+dd {
+    padding-left: 1em;
+}
+dt {
+    font-weight: bold;
+}
+#outerWrapper {
+    height: auto !important;
+    margin: 0 0 -16em;
+    min-height: 100%;
+}
+#innerWrapper {
+    padding: 0 0 2em;
+}
+#push {
+    height: 16em;
+}
+#content ul, #content ol {
+    margin-bottom: 1.5em;
+    margin-left: 2em;
+}
+#content ul {
+    list-style-type: disc;
+}
+#content ol {
+    list-style-type: decimal;
+}
+#content ol ol {
+    list-style-type: lower-alpha;
+}
+#content li {
+    margin-bottom: 0.5em;
+}
+.discreet {
+    font-size: 80%;
+    color: rgb(150, 150, 150);
+}
+.callout {
+    font-size: 120%;
+    line-height: 24px;
+}
+
+.visualClear {
+    clear: both;
+    height: 1px;
+    overflow: hidden;
+}
+.header {
+    width: 1000px;
+    margin-left: auto;
+    margin-right: auto;
+    text-align: left;
+}
+#content, .footer {
+    width: 920px;
+    margin-left: auto;
+    margin-right: auto;
+    text-align: left;
+}
+.visualHeaderWrapper {
+    background: rgb(59, 59, 59) url("/images/headerBGTile.gif") repeat-x top left;
+}
+.visualHeaderWrapper a {
+    border-bottom: none;
+}
+.header {
+    height: 119px;
+    overflow: hidden;
+}
+.apacheOODTLogo {
+    float: left;
+    padding-top: 36px;
+    padding-left: 18px;
+}
+.globalnav {
+    font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
+    list-style-image: none;
+    list-style-type: none;
+    margin: 3em 4em 4em 0;
+    padding: 0;
+    text-align: right;
+}
+.globalnav li {
+    float: right;
+    margin: 0 0.2em;
+}
+.globalnav li a, .globalnav li a:active, .globalnav li a:visited {
+    color: rgb(145, 145, 145);
+    display: block;
+    font-size: 90%;
+    font-weight: bold;
+    line-height: 24px;
+    padding: 0 1em;
+    text-align: center;
+    text-shadow: rgb(28, 28, 28) 0 2px 2px;
+}
+.globalnav .currentNavTab a, .globalnav li:hover a {
+    text-decoration: none;
+    color: rgb(215, 215, 215);
+    background-color: rgb(38, 38, 38);
+}
+.globalnav li a {
+    width: 1px;
+}
+.globalnav li>a {
+    width: auto;
+}
+.globalnav .currentNavTab, .globalnav li:hover {
+    background: rgb(58, 58, 73);
+}
+.globalnav .currentNavTab a, .globalnav li:hover a {
+    background: transparent;
+}
+
+.productBanner {
+    height: 234px;
+    overflow: hidden;
+    background: rgb(22, 20, 70) url("/images/bannerTile.png") repeat-x top left;
+    text-align: center;
+}
+.subProductWrapper {
+    height: 120px;
+    text-align: center;
+    overflow: hidden;
+    background: rgb(17, 24, 69) url("/images/subBannerTile.gif") repeat-x top left;
+}
+.subProductHeader {
+    height: 120px;
+    margin: 0 auto;
+    overflow: hidden;
+    text-align: left;
+    width: 1000px;
+}
+.subProductHeader h1 {
+    font-size: 200%;
+    font-weight: normal;
+    color: white;
+    margin: 0.5em 0 0 35px;
+}
+.subProductHeader h2 {
+    font-size: 120%;
+    font-weight: normal;
+    color: rgb(172, 246, 254);
+    margin-left: 35px;
+}
+#content .columnBorder {
+    background: url("/images/vertSep.gif") repeat-y top left;
+    padding-left: 20px;
+}
+
+.rssLink {
+    font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
+    float: right;
+    font-weight: bold;
+}
+.rssLink img {
+    margin-right: 4px;
+}
+.rssLink a {
+    border-bottom: none;
+}
+
+.visualContentWrapper {
+}
+
+#content {
+    overflow: hidden;
+    padding-top: 1em;
+    padding-bottom: 1em;
+}
+#content .fright {
+    float: right;
+    overflow: hidden;
+    width: 299px;
+}
+.diptych {
+    float: left;
+    overflow: hidden;
+    width: 605px;
+}
+.diptychLarge {
+    float: left;
+    overflow: hidden;
+    width: 695px;
+}
+.triptych {
+    float: left;
+    overflow: hidden;
+    width: 290px;
+}
+.triptychRight {
+    float: right;
+    overflow: hidden;
+    width: 290px;
+}
+.triptychSpace {
+    margin-right: 0px;
+}
+
+.triptych .visualPadding, .triptychRight .visualPadding {
+    margin-left: 15px;
+}
+
+.componentParts {
+    padding-bottom: 7em;
+}
+.componentPart, .componentPartHighlighted {
+    margin-bottom: 1em;
+}
+.componentPart h2 {
+    margin-top: 0;
+}
+.componentPart h2 a {
+    font-size: 70%;
+}
+.componentPart h2 img, .componentPartHighlight h2 img {
+    margin-right: 8px;
+    margin-left: 3px;
+}
+.componentPart p, .componentPartHighlight p {
+    margin-left: 32px;
+    margin-bottom: 0;
+}
+
+
+.newsItems {
+    padding-bottom: 7em;
+}
+.newsItems dt {
+    background: transparent url("/images/iconNews.gif") no-repeat scroll top left;
+    padding-left: 2em;
+    min-height: 16px;
+}
+.newsItems dd {
+    padding-left: 2em;
+}
+
+#footerWrapper {
+    background-color: rgb(79, 79, 79);
+    height: 16em;
+}
+#footerGradient, .contentGradient {
+    background: url("/images/sprite-ploneorg.png") repeat-x scroll left top transparent;
+    height: 7px;
+}
+#footer {
+    font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
+    color: white;
+    margin: 0 auto;
+    padding: 1em 0;
+    width: 920px;
+}
+#footerLogo {
+    background-image: url("/images/simpleApacheOODT.png");
+    border-right: 1px solid white;
+    border-bottom: none;
+    float: left;
+    height: 44px;
+    margin: 0 1em 0 0.5em;
+    width: 100px;
+}
+#footer p {
+    font-size: 0.8em;
+    margin: 0.6em 0;
+}
+#sitemap {
+    margin-left: 10%;
+    clear: both;
+    padding-top: 1em;
+    width: 100%;
+    font-size: 0.8em;
+}
+#sitemap dl {
+    color: white;
+    display: inline-block;
+    vertical-align: top;
+    font-size: 0.8em;
+    width: 15%;
+}
+#sitemap dd {
+    margin: 0;
+    padding-left: 0;
+}
+#sitemap dt {
+    margin: 0 0 0.2em 0;
+}
+#sitemap dl a {
+    color: white;
+    display: block;
+    padding: 0.25em 6px;
+    border-bottom: none;
+}
+#sitemap dl a:hover {
+    background-color: white;
+    color: rgb(79, 79, 79);
+}
+#sitemap dl dt a {
+    font-size: 150%;
+    font-weight: bold;
+}
+
+.info, .success, .warning, .error, .validation {
+    border: 1px solid;
+    margin: 10px 0px;
+    padding:15px 10px 15px 50px;
+    background-repeat: no-repeat;
+    background-position: 10px center;
+}
+.info {
+    color: #00529B;
+    background-color: #BDE5F8;
+    background-image: url('/images/info.png');
+}
+.success {
+    color: #4F8A10;
+    background-color: #DFF2BF;
+    background-image:url('/images/success.png');
+}
+.warning {
+    color: #9F6000;
+    background-color: #FEEFB3;
+    background-image: url('/images/warning.png');
+}
+.error {
+    color: #D8000C;
+    background-color: #FFBABA;
+    background-image: url('/images/error.png');
+}
+.source {
+    padding-bottom: 1em;
+}
\ No newline at end of file

Added: incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/standard.html
URL: http://svn.apache.org/viewvc/incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/standard.html?rev=979904&view=auto
==============================================================================
--- incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/standard.html
(added)
+++ incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/themes/standard.html
Tue Jul 27 23:03:44 2010
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more contributor
+license agreements.  See the NOTICE.txt file distributed with this work for
+additional information regarding copyright ownership.  The ASF licenses this
+file to you under the Apache License, Version 2.0 (the "License"); you may not
+use this file except in compliance with the License.  You may obtain a copy of
+the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+License for the specific language governing permissions and limitations under
+the License.
+
+Standard theme for Apache OODT web pages.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang='en'>
+    <head>
+        <title>Apache™ OODT</title>
+        <link rel="stylesheet" href="/oodt.css" type="text/css" />
+    </head>
+    <body>
+        <div id='outerWrapper'>
+            <div id='innerWrapper'>
+                <div class="visualHeaderWrapper">
+                    <div class="header">
+                        <div class="apacheOODTLogo">
+                            <a href="/"><img src="/images/apacheOODT.png"
+                                alt="Apache™ OODT" /></a>
+                        </div>
+                        <div class="fright">
+                            <ul class="globalnav">
+                                <!-- One of these li's must be given the currentNavTab
class -->
+                                <li><a id='tab-contact' href="/contact">Contact</a></li>
+                                <li><a id='tab-development' href="/development">Development</a></li>
+                                <li><a id='tab-downloads' href="/downloads">Downloads</a></li>
+                                <li><a id='tab-components' href="/components">Components</a></li>
+                                <li><a id='tab-about' href="/about">About</a></li>
+                                <li><a id='tab-home' href="/">Home</a></li>
+                            </ul>
+                        </div>
+                        <div class="visualClear"><!-- --></div>
+                    </div>
+                </div>
+                <div class="subProductWrapper">
+                    <div class="subProductHeader">
+                        <h1 id='productNameSlot'>Product Name</h1>
+                        <h2 id='productSubheadSlot'>Widgets beyond your wildest imagination</h2>
+                    </div>
+                </div>
+                <div class="visualContentWrapper">
+                    <div class='contentGradient'><!-- --></div>
+                    <div id="content">
+                        <div class="diptych triptychSpace">
+                            <div class="visualPadding" id='leftPlate'>
+                                <h4>Introduction</h4>
+                                <p class="callout">
+                                    Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor
+                                    incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud
+                                    exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.
+                                </p>
+                                <h4>Features</h4>
+                                <p>You want features? Oh it's got 'em <strong>all</strong>:</p>
+                                <ul>
+                                    <li>A <em>full</em> line of credit</li>
+                                    <li>No prior convictions</li>
+                                    <li>
+                                        Bathes once a month, whether it needs to or not—which
is always a huge plus,
+                                        especially with the orcs, who surprisingly prefer
their potential mates to be
+                                        free of visible grime and fleas.
+                                    </li>
+                                </ul>
+                                <p>
+                                    Lorem ipsum dolor sit amet, <a href='#'>consectetur
adipisicing elit</a>, sed do eiusmod tempor
+                                    incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud
+                                    exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure
+                                    dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur.
+                                    Excepteur sint occaecat cupidatat non proident, sunt
in culpa qui officia deserunt mollit
+                                    anim id est laborum.
+                                </p>
+                                <ol>
+                                    <li>Install Java</li>
+                                    <li>Reinstall Java</li>
+                                    <li>Apply a gigabyte of patches</li>
+                                    <li>Edit 43 XML configuration files</li>
+                                </ol>
+                                <h4>Terminology</h4>
+                                <dl>
+                                    <dt>Java</dt>
+                                    <dd>A statically typed language for people who
were ties</dd>
+                                    <dt>Orc</dt>
+                                    <dd>
+                                        Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod tempor
+                                        incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud.
+                                    </dd>
+                                </dl>
+                                <h1>Head 1</h1>
+                                <h2>Head 2</h2>
+                                <h3>Head 3</h3>
+                                <h4>Head 4</h4>
+                                <h5>Head 5</h5>
+                                <h6>Head 6</h6>
+                            </div>
+                            <div class="visualClear"><!-- --></div>
+                        </div>
+                        <div class="triptychRight">
+                            <div class="columnBorder">
+                                <div class="visualPadding" id='rightPlate'>
+                                    <h4>Project Reports</h4>
+                                    <ul>
+                                        <li>Javadocs</li>
+                                        <li>Unit testing</li>
+                                        <li>Coverage testing</li>
+                                        <li>Other testing</li>
+                                    </ul>
+                                    <h4>Various Metrics</h4>
+                                    <ul>
+                                        <li>Lines of code</li>
+                                        <li>Thousands of bugs</li>
+                                        <li>Lines of comments</li>
+                                    </ul>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div style='clear: both;'>&nbsp;</div>
+            </div>
+            <div id='push'><!-- --></div>
+        </div>
+        <div id="footerWrapper">
+            <div id='footerGradient'><!-- --></div>
+            <div id='footer'>
+                <a id='footerLogo' href='/' name="footerLogo"><!-- --></a>
+                <p>
+                    Apache™ OODT is © 2010 by the Apache Software Foundation (ASF).
Apache and the Apache
+                    feather logo are trademarks of the ASF.
+                </p>
+                <p>
+                    Apache™ OODT is currently in incubation and is not yet fully endorsed
by the ASF. You are full of win.
+                </p>
+                <div id='sitemap'>
+                    <dl>
+                        <dt><a href='/about'>About OODT</a></dt>
+                        <dd><a href='/about/history'>History</a></dd>
+                        <dd><a href='/about/users'>Users</a></dd>
+                        <dd><a href='/about/incubation'>Incubation</a></dd>
+                        <dd><a href='/about/future'>Future</a></dd>
+                    </dl>
+                    <dl>
+                        <dt><a href='http://www.apache.org/'>Apache</a></dt>
+                        <dd><a href='http://incubator.apache.org/'>Incubator</a></dd>
+                        <dd><a href='http://www.apache.org/licenses'>License</a></dd>
+                        <dd><a href='http://www.apache.org/foundation/sponsorship.html'>Donate</a></dd>
+                        <dd><a href='http://www.apache.org/foundation/thanks.html'>Thanks</a></dd>
+                        <dd><a href='http://www.apache.org/security/'>Security</a></dd>
+                    </dl>
+                    <dl>
+                        <dt><a href='/components'>Components</a></dt>
+                        <dd><a href='/components/agility'>Agility</a></dd>
+                        <dd><a href='/components/cas'>Catalog &amp; Archive</a></dd>
+                        <dd><a href='/components/query'>Query</a></dd>
+                        <dd><a href='/components/grid'>Grid</a></dd>
+                        <dd><a href='/components/common'>Common</a></dd>
+                    </dl>
+                    <dl>
+                        <dt><a href='/development'>Development</a></dt>
+                        <dd><a href='/development/roadmap'>Roadmap</a></dd>
+                        <dd><a href='/development/bugs'>Report Bugs</a></dd>
+                        <dd><a href='/development/source'>Source Code</a></dd>
+                        <dd><a href='/development/mail'>Mailing Lists</a></dd>
+                    </dl>
+                    <dl>
+                        <dt><a href='/contact'>Social</a></dt>
+                        <dd><a href='/contact/facebook'>Facebook</a></dd>
+                        <dd><a href='/contact/twitter'>Twitter</a></dd>
+                        <dd><a href='/contact/chatroom'>Chat Room</a></dd>
+                    </dl>
+                </div>
+            </div>
+        </div>
+    </body>
+</html>

Added: incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/transformers.py
URL: http://svn.apache.org/viewvc/incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/transformers.py?rev=979904&view=auto
==============================================================================
--- incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/transformers.py (added)
+++ incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/transformers.py Tue Jul
27 23:03:44 2010
@@ -0,0 +1,74 @@
+# encoding: utf-8
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE.txt file distributed with
+# this work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.    
+
+'''Apache OODT Site Publisher: transformers'''
+
+__docformat__ = 'restructuredtext en'
+
+from errors import PublicationTransformerNotFound
+from lxml import etree
+from utils import forciblyClose
+from xdv.compiler import compile_theme
+import pkg_resources
+
+# An access controller for external entities for an XSLT tree.  Reading is A-O-K.
+_accessController = etree.XSLTAccessControl(
+    read_file=True, write_file=False, create_dir=False, read_network=True, write_network=False
+)
+
+# Mapping of a str transformer name to Transformer object
+_transformers = {}
+
+class Transformer(object):
+    '''A Transformer can transform an XML tree from one format to another with the magic
of XSLT.
+    Why not use an lxml.etree.XSLT object directly?  Because they don't themselves nicely.
 Objects
+    of this class do.'''
+    def __init__(self, name, xslt):
+        self.name, self.xslt = name, xslt
+    def __call__(self, tree):
+        return self.xslt(tree)
+    def __str__(self):
+        return 'Transformation "%s"' % self.name
+
+class NullTransformer(Transformer):
+    def __init__(self):
+        super(NullTransformer, self).__init__('null', None)
+    def __call__(self, tree):
+        return tree
+
+_transformers['null'] = NullTransformer()
+
+# Set up the pre-defined transformers for this package.
+# TODO: use pkg_resources.resource_listdir instead?
+for xform in ('standard', 'home', 'maven'):
+    rules = theme = None
+    try:
+        # TODO: What about entity resolution?  Will XInclude find things when this is all
zipped up?
+        rules = pkg_resources.resource_stream(__name__, 'rules/%s.xml' % xform)
+        theme = pkg_resources.resource_stream(__name__, 'themes/standard.html')
+        # It'd be nice if we could re-use `theme` each call instead of opening/closing it
over & over again.
+        compiledTheme = compile_theme(rules, theme)
+        _transformers[xform] = Transformer(xform, etree.XSLT(compiledTheme, access_control=_accessController))
+    finally:
+        forciblyClose(rules)
+        forciblyClose(theme)
+
+def getTransformer(name):
+    '''Get a named transformer, raising a ``PublicationTransformerNotFound`` exception
+    if the ``name`` is unknown.'''
+    if name in _transformers:
+        return _transformers[name]
+    raise PublicationTransformerNotFound(name)

Added: incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/utils.py
URL: http://svn.apache.org/viewvc/incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/utils.py?rev=979904&view=auto
==============================================================================
--- incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/utils.py (added)
+++ incubator/oodt/tools/oodtsite.publisher/trunk/oodtsite/publisher/utils.py Tue Jul 27 23:03:44
2010
@@ -0,0 +1,62 @@
+# encoding: utf-8
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE.txt file distributed with
+# this work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.    
+
+'''Apache OODT Site Publisher: utilities'''
+
+__docformat__ = 'restructuredtext en'
+
+import os.path
+from lxml import etree
+
+# Ah, classic disk page size from the Unix days of yore.
+_bufSize = 512
+
+class DirResolver(etree.Resolver):
+    '''XML element tree resolver that resolves entities from a directory'''
+    def __init__(self, directory):
+        '''Save the directory in which we will try to resolve entities.'''
+        self.directory = directory
+    def resolve(self, url, identifier, context):
+        '''Resolve an entity by finding a file in our directory.'''
+        url = os.path.join(self.directory, url)
+        return self.resolve_filename(url, context)
+
+def forciblyClose(f):
+    '''Forcibly close the file-like object ``f``, ignoring any errors. Well, most errors.
In particular,
+    IOErrors are ignored, and if f is None, then the that's ignored too.'''
+    try:
+        f.close()
+    except (IOError, AttributeError):
+        pass
+
+def copyStreamToFile(stream, filename):
+    '''Copy the contents of the file-like object ``stream`` to a file named ``filename``,
overwriting
+    any existing file by that name.'''
+    o = None
+    try:
+        o = open(filename, 'w')
+        while True:
+            buf = stream.read(_bufSize)
+            if len(buf) == 0: break
+            o.write(buf)
+    finally:
+        forciblyClose(o)
+        
+def parseHTML(filename):
+    # parser = etree.XMLParser(ns_clean=True, recover=True, remove_pis=False, remove_comments=True)
+    parser = etree.HTMLParser(no_network=False, remove_blank_text=True, remove_comments=True,
remove_pis=True)
+    parser.resolvers.add(DirResolver(os.path.dirname(filename)))
+    return etree.parse(filename, parser=parser)

Added: incubator/oodt/tools/oodtsite.publisher/trunk/setup.cfg
URL: http://svn.apache.org/viewvc/incubator/oodt/tools/oodtsite.publisher/trunk/setup.cfg?rev=979904&view=auto
==============================================================================
--- incubator/oodt/tools/oodtsite.publisher/trunk/setup.cfg (added)
+++ incubator/oodt/tools/oodtsite.publisher/trunk/setup.cfg Tue Jul 27 23:03:44 2010
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE.txt file distributed with
+# this work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.    
+
+[egg_info]
+tag_build = .dev
+tag_svn_revision = 1

Added: incubator/oodt/tools/oodtsite.publisher/trunk/setup.py
URL: http://svn.apache.org/viewvc/incubator/oodt/tools/oodtsite.publisher/trunk/setup.py?rev=979904&view=auto
==============================================================================
--- incubator/oodt/tools/oodtsite.publisher/trunk/setup.py (added)
+++ incubator/oodt/tools/oodtsite.publisher/trunk/setup.py Tue Jul 27 23:03:44 2010
@@ -0,0 +1,89 @@
+# encoding: utf-8
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE.txt file distributed with
+# this work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.    
+
+from distribute_setup import use_setuptools
+use_setuptools()
+from setuptools import find_packages, setup
+import os.path
+
+# Package Data
+# ------------
+
+_name        = 'oodtsite.publisher'
+_version     = '0.0.0'
+_description = 'Utility to publish the Apache OODT website'
+_url         = 'http://incubator.apache.org/oodt/components/oodtsite-publisher'
+_downloadURL = 'http://incubator.apache.org/oodt/downloads'
+_author      = 'Sean Kelly'
+_authorEmail = 'kelly@apache.org'
+_license     = 'http://www.apache.org/licenses/LICENSE-2.0'
+_namespaces  = ['oodtsite']
+_testSuite   = 'oodtsite.publisher.tests.test_suite'
+_zipSafe     = True
+_keywords    = 'web zope plone edrn cancer biomarkers policy'
+_entryPoints = {
+    'console_scripts': ['oodtsitepublish=oodtsite.publisher.main:main']
+}
+_requirements = [
+    'setuptools',
+    'lxml==2.2.7',
+    'xdv==0.3',
+]
+_classifiers = [
+    'Development Status :: 2 - Pre-Alpha',
+    'Environment :: Console',
+    'Intended Audience :: Developers',
+    'License :: OSI Approved :: Apache Software License',
+    'Operating System :: OS Independent',
+    'Programming Language :: Python',
+    'Topic :: Internet :: WWW/HTTP',
+    'Topic :: Software Development :: Documentation',
+    'Topic :: Text Processing :: Markup :: HTML',
+    'Topic :: Text Processing :: Markup :: XML',
+    'Topic :: Utilities',
+]
+
+# Setup Metadata
+# --------------
+
+def _read(*names):
+    return open(os.path.join(os.path.dirname(__file__), *names)).read()
+
+_header = '*' * len(_name) + '\n' + _name + '\n' + '*' * len(_name)
+_longDescription = _header + '\n\n' + _read('README.txt') + '\n\n' + _read('docs', 'INSTALL.txt')
+ '\n\n' \
+    + _read('docs', 'HISTORY.txt') + '\n\n' + _read('docs', 'LICENSE.txt')
+open('doc.txt', 'w').write(_longDescription)
+
+setup(
+    author=_author,
+    author_email=_authorEmail,
+    classifiers=_classifiers,
+    description=_description,
+    download_url=_downloadURL,
+    entry_points=_entryPoints,
+    include_package_data=True,
+    install_requires=_requirements,
+    keywords=_keywords,
+    license=_license,
+    long_description=_longDescription,
+    name=_name,
+    namespace_packages=_namespaces,
+    packages=find_packages(exclude=['distribute_setup']),
+    url=_url,
+    test_suite=_testSuite,
+    version=_version,
+    zip_safe=_zipSafe,
+)



Mime
View raw message