Author: michiel
Date: 2010-05-14 23:46:13 +0200 (Fri, 14 May 2010)
New Revision: 42150
Added:
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/applications/Simple.xml
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/builders/
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/builders/simple/
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/builders/simple/rolerel.xml
speeltuin/mihxil/simple/src/main/webapp/style.css.jsp
Removed:
speeltuin/mihxil/simple/src/main/webapp/style.css
Modified:
speeltuin/mihxil/simple/src/main/java/org/meeuw/SimpleUrlConverter.java
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/web.xml
speeltuin/mihxil/simple/src/main/webapp/default.css
speeltuin/mihxil/simple/src/main/webapp/index.jspx
speeltuin/mihxil/simple/src/main/webapp/script.js
speeltuin/mihxil/simple/wget/Makefile
Log:
various improvements
Modified:
speeltuin/mihxil/simple/src/main/java/org/meeuw/SimpleUrlConverter.java
===================================================================
--- speeltuin/mihxil/simple/src/main/java/org/meeuw/SimpleUrlConverter.java
2010-05-14 18:10:27 UTC (rev 42149)
+++ speeltuin/mihxil/simple/src/main/java/org/meeuw/SimpleUrlConverter.java
2010-05-14 21:46:13 UTC (rev 42150)
@@ -18,6 +18,7 @@
import org.mmbase.bridge.util.*;
import org.mmbase.util.logging.*;
import org.mmbase.util.functions.*;
+import org.mmbase.storage.search.*;
import org.apache.commons.lang.StringUtils;
/**
@@ -76,7 +77,7 @@
if (related.getNode(0).getNumber() == n.getNumber()) {
return new BasicUrl(this, BasicUrlConverter.getUrl("/",
parameters, request, escapeAmps));
} else {
- return new BasicUrl(this, BasicUrlConverter.getUrl("/" +
trans.transform(n.getStringValue("title")) + ".html", parameters, request,
escapeAmps));
+ return new BasicUrl(this, BasicUrlConverter.getUrl("/" +
trans.transform(n.getStringValue("title").toLowerCase()) + ".html", parameters,
request, escapeAmps));
}
}
} else {
@@ -104,7 +105,10 @@
NodeManager nm = cloud.getNodeManager(nodeManager);
NodeQuery q = nm.createQuery();
String like = StringUtils.removeEnd(p[1], ".html");
- Queries.addConstraint(q, Queries.createConstraint(q, "title",
Queries.getOperator("LIKE"), like));
+ Constraint cons = Queries.createConstraint(q, "title",
Queries.getOperator("LIKE"), like);
+ q.setCaseSensitive((FieldConstraint) cons, false);
+ Queries.addConstraint(q, cons);
+
NodeList list = nm.getList(q);
Node node;
if (list.size() > 0) {
Added:
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/applications/Simple.xml
===================================================================
---
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/applications/Simple.xml
(rev 0)
+++
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/applications/Simple.xml
2010-05-14 21:46:13 UTC (rev 42150)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//MMBase//DTD application config 1.1//EN"
"http://www.mmbase.org/dtd/application_1_1.dtd">
+<application name="Simple" maintainer="meeuw.org" version="1"
auto-deploy="true">
+ <requirements>
+ <requires name="Resources" maintainer="mmbase.org" />
+ <requires name="RichText" maintainer="mmbase.org" />
+ </requirements>
+
+ <neededbuilderlist>
+ <builder maintainer="meeuw.org" version="1">rolerel</builder>
+ </neededbuilderlist>
+
+ <neededreldeflist>
+ <reldef source="role" target="role" direction="bidirectional"
guisourcename="Related" guitargetname="Related" builder="rolerel" />
+ </neededreldeflist>
+
+ <allowedrelationlist>
+ <relation from="segments" to="images" type="role" />
+ </allowedrelationlist>
+
+ <datasourcelist>
+
+ </datasourcelist>
+
+ <relationsourcelist>
+ </relationsourcelist>
+
+ <contextsourcelist>
+ <contextsource path="Simple/backup.xml" type="depth" goal="backup"/>
+ </contextsourcelist>
+
+ <description>
+ <![CDATA[It .]]>
+ </description>
+
+ <install-notice>
+ <![CDATA[The Simple application is installed. .]]>
+ </install-notice>
+</application>
Added:
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/builders/simple/rolerel.xml
===================================================================
---
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/builders/simple/rolerel.xml
(rev 0)
+++
speeltuin/mihxil/simple/src/main/webapp/WEB-INF/config/builders/simple/rolerel.xml
2010-05-14 21:46:13 UTC (rev 42150)
@@ -0,0 +1,35 @@
+<?xml version="1.0" ?>
+<builder
+ xmlns="http://www.mmbase.org/xmlns/builder"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.mmbase.org/xmlns/builder
http://www.mmbase.org/xmlns/builder.xsd"
+ name="rolerel" maintainer="meeuw.org" version="" extends="insrel">
+
+ <searchage>14</searchage>
+ <names>
+ <singular xml:lang="en">Role</singular>
+ <plural xml:lang="en">Roles</plural>
+ </names>
+ <descriptions>
+ <description xml:lang="en">Role relation, defines what role a person for
example performs for a company</description>
+ </descriptions>
+ <fieldlist>
+ <field name="role">
+ <gui>
+ <guiname xml:lang="en">Role</guiname>
+ <guiname xml:lang="nl">Rol</guiname>
+ </gui>
+ <editor>
+ <positions><list>4</list></positions>
+ </editor>
+ <datatype base="eline" xmlns="http://www.mmbase.org/xmlns/datatypes">
+ <default value="teaser" />
+ <required value="true" />
+ <maxLength value="255" />
+ <enumeration>
+ <entry value="teaser" />
+ </enumeration>
+ </datatype>
+ </field>
+ </fieldlist>
+</builder>
Modified: speeltuin/mihxil/simple/src/main/webapp/WEB-INF/web.xml
===================================================================
--- speeltuin/mihxil/simple/src/main/webapp/WEB-INF/web.xml 2010-05-14
18:10:27 UTC (rev 42149)
+++ speeltuin/mihxil/simple/src/main/webapp/WEB-INF/web.xml 2010-05-14
21:46:13 UTC (rev 42150)
@@ -1,12 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- If you use an application server which does not support web-app version 2.4
(e.g. Tomcat 4.x,
- Orion), then you can use web-2.3.xml in stead of this.
-
- Web-app 2.4 gives the possibility to use EL (Expression Language)
-
- $Id: web.xml 41981 2010-04-20 14:02:03Z michiel $
--->
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
@@ -33,6 +25,11 @@
</context-param>
<context-param>
+ <param-name>google_analytics</param-name>
+ <param-value>UA-1306697-1</param-value>
+ </context-param>
+
+ <context-param>
<param-name>mmbase.taglib.eval_body_include</param-name>
<param-value>true</param-value>
</context-param>
Modified: speeltuin/mihxil/simple/src/main/webapp/default.css
===================================================================
--- speeltuin/mihxil/simple/src/main/webapp/default.css 2010-05-14 18:10:27 UTC
(rev 42149)
+++ speeltuin/mihxil/simple/src/main/webapp/default.css 2010-05-14 21:46:13 UTC
(rev 42150)
@@ -1 +1 @@
-...@import url(style.css)
+...@import url("style.css.jsp");
Modified: speeltuin/mihxil/simple/src/main/webapp/index.jspx
===================================================================
--- speeltuin/mihxil/simple/src/main/webapp/index.jspx 2010-05-14 18:10:27 UTC
(rev 42149)
+++ speeltuin/mihxil/simple/src/main/webapp/index.jspx 2010-05-14 21:46:13 UTC
(rev 42150)
@@ -47,20 +47,29 @@
<script type="text/javascript" src="${_}"><jsp:text>
</jsp:text></script>
</mm:link>
<mm:link page="/mmbase/style/css/mmxf.css">
- <link rel='stylesheet' href='${_}' type='text/css' />
+ <link rel="Stylesheet" href='${_}' type="text/css" />
</mm:link>
<mm:link page="${initParam.style}">
- <link rel='stylesheet' href='${_}' type='text/css' />
+ <link rel="Stylesheet" href="${_}" type="text/css" />
</mm:link>
<mm:link page="/mmbase/kupu/mmbase">
<meta content="${_}" name="org.mmbase.portal.editordir" />
</mm:link>
+ <c:if test="${! empty initParam.google_analytics}">
+ <script src="http://www.google-analytics.com/urchin.js"
type="text/javascript"><jsp:text> </jsp:text></script>
+ <script type="text/javascript">
+ _uacct = "${initParam.google_analytics}";
+ urchinTracker();
+ </script>
+ </c:if>
</head>
<body>
<div class="container">
<mm:node node="start">
<div class="intro editable mm_ea_objectnumber_${_node}">
- <h1><mm:field name="title" /></h1>
+ <div class="head">
+ <h1><mm:field name="title" /></h1>
+ </div>
<h2><mm:field name="subtitle" /></h2>
<mm:field name="intro" escape="p,links" />
<rich:field name="body" />
@@ -68,10 +77,14 @@
</mm:node>
<div id="menu">
<ul>
- <mm:relatednodes referid="segments">
+ <mm:relatednodes referid="segments" varStatus="status">
<mm:link referids="edit?">
<mm:frameworkparam name="n" referid="_node" />
- <li class="${n eq _node.number ? 'active' : ''}"><a
href="${_}"><mm:field name="title" /></a></li>
+ <li
+ id="menu${_node}"
+ class="${n eq _node.number ? 'active' : ''}
${status.last ? 'last' :''}">
+ <a href="${_}"><mm:field name="title" /></a>
+ </li>
</mm:link>
</mm:relatednodes>
</ul>
Modified: speeltuin/mihxil/simple/src/main/webapp/script.js
===================================================================
--- speeltuin/mihxil/simple/src/main/webapp/script.js 2010-05-14 18:10:27 UTC
(rev 42149)
+++ speeltuin/mihxil/simple/src/main/webapp/script.js 2010-05-14 21:46:13 UTC
(rev 42150)
@@ -1,4 +1,4 @@
-$(window).ready(
+$(window).load(
function() {
var resize =
function() {
@@ -7,19 +7,23 @@
var maxWidth = $(".container").width();
$(".content").height(height - $("#menu").height() -
$(".footer").height());
var width = maxWidth - 200;
- if (width < 200) width = 200;
+ if (width < 800) width = 800;
$(".content,#menu").width(width);
$(".footer").width($(".container").width());
$(".footer").css("top", ($(".content").height() +
$("#menu").height()) + "px");
};
+
$(window).resize(resize);
+ resize();
+ $("#menu li").mouseenter(function() { $(this).addClass("hover"); });
+ $("#menu li").mouseleave(function() { $(this).removeClass("hover"); });
$("#menu li").click(
function(ev) {
var li = this;
document.location.href = $(li).find("a").attr("href");
ev.preventDefault();
});
- resize();
+
});
\ No newline at end of file
Deleted: speeltuin/mihxil/simple/src/main/webapp/style.css
===================================================================
--- speeltuin/mihxil/simple/src/main/webapp/style.css 2010-05-14 18:10:27 UTC
(rev 42149)
+++ speeltuin/mihxil/simple/src/main/webapp/style.css 2010-05-14 21:46:13 UTC
(rev 42150)
@@ -1,92 +0,0 @@
-html {
- background-color: #ffa500;
- font-family: Verdana;
- margin: 0;
- padding: 0;
-}
-
-.container {
- top: 0px;
- left: 0px;
- position: relative;
- display: block;
- max-width: 1000px;
- min-width: 200px;
- margin-left: auto;
- margin-right: auto;
- border-top: solid 1px white;
-}
-
-
-div.content,
-div#menu {
- padding: 0;
- position: absolute;
- left: 200px;
- background-color: #fff;
-}
-div.content {
- background-color: white;
- top: 70px;
- overflow: auto;
-}
-
-div#menu {
- top: 0px;
- height: 70px;
-}
-
-
-div.content > * {
- padding-left: 1ex;
- padding-right: 1ex;
-}
-div.content h2 {
- display: none;
-}
-
-div#menu ul {
- display: block;
- padding: 0;
- margin: 0;
-}
-div#menu ul li {
- display: block;
- float: left;
- margin-right: 5px;
- background-color: red;
- width: 200px;
- text-align: center;
- cursor: pointer;
-}
-div#menu ul li.active {
- background-color: white;
-}
-div#menu a {
- text-decoration: none;
-}
-
-
-div.intro {
- padding: 0;
- margin: 0;
- position: absolute;
- left: 0px;
- width: 200px;
- background-color: #ffc722;
-}
-div.footer {
- border-top: solid 1px white;
- position: absolute;
- height: 20px;
- background-color: #ffc722;
- text-align: center;
-}
-div.footer p {
- margin: 0;
- padding: 0;
-}
-
-a.mm_portal_edit {
- position: relative;
-}
\ No newline at end of file
Copied: speeltuin/mihxil/simple/src/main/webapp/style.css.jsp (from rev 42133,
speeltuin/mihxil/simple/src/main/webapp/style.css)
===================================================================
--- speeltuin/mihxil/simple/src/main/webapp/style.css.jsp
(rev 0)
+++ speeltuin/mihxil/simple/src/main/webapp/style.css.jsp 2010-05-14
21:46:13 UTC (rev 42150)
@@ -0,0 +1,214 @@
+/* -*- mode: css -*- */
+<%...@taglib uri="http://www.mmbase.org/mmbase-taglib-2.0" prefix="mm"
+%><%...@page session="false" %><mm:content expires="0" type="text/css">
+<mm:cloud>
+<mm:import id="width" vartype="integer">1000</mm:import>
+<mm:import id="menuitem_height" vartype="integer">150</mm:import>
+<mm:import id="menuitem_margintop" vartype="integer">40</mm:import>
+<mm:import id="intro_width" vartype="integer">200</mm:import>
+<mm:import id="margin_left" vartype="integer">100</mm:import>
+<mm:import id="menuitem_margin" vartype="integer">20</mm:import>
+<mm:import id="menuitem_width" vartype="integer">${(width - intro_width -
margin_left / 2 - menuitem_margin * 4) / 4}</mm:import>
+<mm:import id="radius" vartype="integer">20</mm:import>
+
+
+
+html {
+ background-color: #ffa500;
+ color: #333;
+ font-family: Verdana;
+ margin: 0;
+ padding: 0;
+}
+
+.container {
+ top: 0px;
+ left: 0px;
+ position: relative;
+ display: block;
+ max-width: ${width}px;
+ min-width: ${intro_width}x;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+
+div.content,
+div#menu {
+ position: absolute;
+ left: ${intro_width}px;
+ background-color: #fff;
+}
+div.content {
+ background-color: white;
+ overflow: auto;
+ font-family: Times;
+ top: ${menuitem_height}px;
+ -moz-border-radius-bottomleft: ${radius}px;
+ -webkit-border-bottom-left-radius: ${radius}px;
+ border-bottom-left-radius: ${radius}px;
+ -moz-border-radius-bottomright: ${radius}px;
+ -webkit-border-bottom-right-radius: ${radius}px;
+ border-bottom-right-radius: ${radius}px;
+}
+
+div#menu {
+ top: 0px;
+ height: ${menuitem_height}px;
+ -moz-border-radius-topleft: ${radius}px;
+ -webkit-border-top-left-radius: ${radius}px;
+ border-top-left-radius: ${radius}px;
+ -moz-border-radius-topright: ${radius}px;
+ -webkit-border-top-right-radius: ${radius}px;
+ border-top-right-radius: ${radius}px;
+}
+
+
+div.content > * {
+ padding-left: ${margin_left}px;
+ padding-right: 1ex;
+}
+div.content img.image-left {
+ margin-left: -${margin_left}px;
+ margin-right: 10px;
+}
+div.content h2 {
+ display: none;
+}
+
+div#menu ul {
+ margin-left: ${margin_left / 2}px;
+ display: block;
+ padding: 0;
+ margin-top: ${menuitem_margintop}px;
+}
+div#menu ul li {
+ display: block;
+ float: left;
+ margin-right: ${menuitem_margin}px;
+ background-color: black;
+ text-align: center;
+ cursor: pointer;
+ width: ${menuitem_width}px;
+ height: ${menuitem_height - menuitem_margintop}px;
+}
+div#menu ul li.last {
+ margin-right: 0px;
+}
+
+div.intro .head {
+ margin-left: 15px;
+ margin-top: ${menuitem_margintop}px;
+ height: ${menuitem_height - menuitem_margintop}px;
+ width: ${intro_width - 30}px;
+ color: white;
+ text-align: center;
+
+}
+div.intro > * {
+ margin-left: 15px;
+ margin-right: 15px;
+}
+
+<mm:node number="${initParam.startnode}">
+ <mm:relatednodescontainer type="images" role="role">
+ <mm:constraint field="role.role" value="teaser" />
+ <mm:relatednodes>
+div.intro h1 {
+ display: block;
+ left: 15px; /* IE SUCKS */
+ margin: 0;
+ padding: 0;
+ position: absolute;
+ width: ${intro_width - 30}px;
+ background-position: 0 -${menuitem_height - menuitem_margintop - 30}px;
+ background-image: url(<mm:image template="s(${intro_width -
30})+fill(white)+colorize(50%)" />);
+ height: 30px;
+ top: ${menuitem_height - 30}px;
+ color: #000;
+ font-weight: bold;
+ font-size: 13pt;
+ text-transform: uppercase;
+}
+
+ div.intro .head {
+ background-image: url(<mm:image template="s(${intro_width - 30})" />);
+ }
+ </mm:relatednodes>
+ </mm:relatednodescontainer>
+
+<mm:relatednodescontainer role="index" type="segments">
+<mm:sortorder field="index.pos" />
+<mm:relatednodes id="segment">
+ <mm:relatednodescontainer type="images" role="role">
+ <mm:constraint field="role.role" value="teaser" />
+ <mm:relatednodes>
+ li#menu${segment} {
+ background-image: url(<mm:image template="s(${menuitem_width})+blur(10,
3)" />);
+ }
+ li#menu${segment} a {
+ background-image: url(<mm:image
template="s(${menuitem_width})+fill(white)+colorize(50%)+blur(10, 3)" />);
+ }
+ li#menu${segment}.active,
+ li#menu${segment}.hover {
+ background-image: url(<mm:image template="s(${menuitem_width})" />);
+ }
+ li#menu${segment}.active a,
+ li#menu${segment}.hover a {
+ background-image: url(<mm:image
template="s(${menuitem_width})+fill(white)+colorize(50%)" />);
+ }
+ </mm:relatednodes>
+ </mm:relatednodescontainer>
+ </mm:relatednodes>
+ </mm:relatednodescontainer>
+</mm:node>
+
+div#menu a {
+ background-position: 0px -${menuitem_height - menuitem_margintop - 30}px;
+ text-transform: uppercase;
+ width: ${menuitem_width}px;
+ display: block;
+ position: relative;
+ text-decoration: none;
+ height: 30px;
+ left: 0px;
+ top: ${menuitem_height - menuitem_margintop - 30}px;
+ color: #666;
+ font-weight: bold;
+}
+
+div#menu li.active a,
+div#menu li a:hover {
+ background-color: rgba(255, 255, 255, 0.8);
+ color: #000;
+}
+
+div.intro {
+ padding: 0;
+ margin: 0;
+ position: absolute;
+ left: 0px;
+ width: ${intro_width - 2}px;
+ border-right: #ffa500 solid 2px;
+ background-color: #fff;
+ -moz-border-radius: ${radius}px;
+ -webkit-border-radius: ${radius}px;
+ border-radius: ${radius}px;
+}
+div.footer {
+ border-top: solid 1px white;
+ position: absolute;
+ height: 20px;
+ background-color: #ffc722;
+ text-align: center;
+}
+div.footer p {
+ margin: 0;
+ padding: 0;
+}
+
+a.mm_portal_edit {
+ position: relative;
+}
+</mm:cloud>
+</mm:content>
\ No newline at end of file
Modified: speeltuin/mihxil/simple/wget/Makefile
===================================================================
--- speeltuin/mihxil/simple/wget/Makefile 2010-05-14 18:10:27 UTC (rev
42149)
+++ speeltuin/mihxil/simple/wget/Makefile 2010-05-14 21:46:13 UTC (rev
42150)
@@ -2,7 +2,7 @@
simple-webapp/index.html:
- wget -r -k -nH http://localhost:8080/simple-webapp/
+ wget -r -k -nH --adjust-extension http://localhost:8080/simple-webapp/
bash -c 'for i in `find simple-webapp -name "*.html"`; do xmllint
--nsclean Xb --format $$i > $$i.new ; mv $$i.new $$i ; done'
clean:
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs