You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(233) |
Sep
(199) |
Oct
(206) |
Nov
(185) |
Dec
(270) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(232) |
Feb
(426) |
Mar
(623) |
Apr
(592) |
May
(506) |
Jun
(389) |
Jul
(160) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(5) |
2007 |
Jan
(1) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(5) |
Oct
(9) |
Nov
(6) |
Dec
(6) |
2008 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(3) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(2) |
Sep
(12) |
Oct
(10) |
Nov
(54) |
Dec
(49) |
2009 |
Jan
(19) |
Feb
(13) |
Mar
(20) |
Apr
(24) |
May
(44) |
Jun
(29) |
Jul
(32) |
Aug
(10) |
Sep
(7) |
Oct
(10) |
Nov
(4) |
Dec
(17) |
2010 |
Jan
(14) |
Feb
(5) |
Mar
(23) |
Apr
(50) |
May
(31) |
Jun
(9) |
Jul
(5) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(12) |
Feb
(5) |
Mar
(5) |
Apr
(3) |
May
(4) |
Jun
(3) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jbo...@li...> - 2005-09-14 15:35:59
|
Author: szimano Date: 2005-09-14 11:35:46 -0400 (Wed, 14 Sep 2005) New Revision: 1111 Modified: trunk/forge/portal-extensions/forge-wiki/maven.xml Log: switching off forge-wiki Modified: trunk/forge/portal-extensions/forge-wiki/maven.xml =================================================================== --- trunk/forge/portal-extensions/forge-wiki/maven.xml 2005-09-14 15:30:01 UTC (rev 1110) +++ trunk/forge/portal-extensions/forge-wiki/maven.xml 2005-09-14 15:35:46 UTC (rev 1111) @@ -5,7 +5,7 @@ --> <project xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:u="jelly:util" > <goal name="build"> - +<!-- <attainGoal name="copy-tld" /> <ant:copy todir="target/classes/org/jboss/wiki" flatten="true"> <ant:fileset dir="src/java/org/jboss/wiki"> @@ -29,11 +29,11 @@ </ant:fileset> </ant:copy> <attainGoal name="jar" /> - + --> </goal> <goal name="deploy"> - <ant:copy + <!--<ant:copy tofile="${local.deploy.dir}/wiki.ear/META-INF/application.xml" file="src/etc/application.xml" /> <!--<ant:copy @@ -49,7 +49,8 @@ file="target/ejb3/wiki-1.0.jar" /> <ant:touch file="${local.deploy.dir}/wiki.ear/META-INF/application.xml" /> - </goal> + --> + </goal> <goal name="all"> <attainGoal name="build" /> |
Author: szimano Date: 2005-09-14 11:30:01 -0400 (Wed, 14 Sep 2005) New Revision: 1110 Added: trunk/forge/portal-extensions/jbosswiki/build.properties.sample trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java Removed: trunk/forge/portal-extensions/jbosswiki/build.properties Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp trunk/forge/portal-extensions/jbosswiki/maven.xml trunk/forge/portal-extensions/jbosswiki/project.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java Log: jboss wiki to work on forge.sicore.org Deleted: trunk/forge/portal-extensions/jbosswiki/build.properties =================================================================== --- trunk/forge/portal-extensions/jbosswiki/build.properties 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/build.properties 2005-09-14 15:30:01 UTC (rev 1110) @@ -1,15 +0,0 @@ -# Path to where JBoss AS is to be copied. -local.server.dir=/home/tomek/jboss/jboss - -# Path to where your portal extensions are to be deployed - you shouldn't -# have to change that. -local.deploy.dir=${local.server.dir}/server/all/deploy - -# Path to your local maven repository - you can comment this out if you use -# the default location. You can also create a build.properties in your home -# directory to set the maven.repo.local for all projects. -# maven.repo.local= - -# URL of your content repository. You don't have to specify this if you don't -# plan to update the content by maven (it's need for CruiseControl). -maven.scm.url= Copied: trunk/forge/portal-extensions/jbosswiki/build.properties.sample (from rev 1109, trunk/forge/portal-extensions/jbosswiki/build.properties) Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml 2005-09-14 15:30:01 UTC (rev 1110) @@ -84,13 +84,6 @@ </dependency> <dependency> - <groupId>informa</groupId> - <artifactId>informa</artifactId> - <version>0.6.0</version> - <jar>informa-0.6.0.jar</jar> - </dependency> - - <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6</version> Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp 2005-09-14 15:30:01 UTC (rev 1110) @@ -4,7 +4,6 @@ See terms of license at gnu.org. --> -<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <%@ page isELIgnored ="false" %> <% Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-14 15:30:01 UTC (rev 1110) @@ -4,7 +4,6 @@ See terms of license at gnu.org. --> -<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <%@ page isELIgnored ="false" %> <% Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-14 15:30:01 UTC (rev 1110) @@ -4,7 +4,6 @@ See terms of license at gnu.org. --> -<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <%@ page isELIgnored ="false" %> <% Modified: trunk/forge/portal-extensions/jbosswiki/maven.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/maven.xml 2005-09-14 15:30:01 UTC (rev 1110) @@ -9,14 +9,14 @@ --> <goal name="build"> - <!--<attainGoal name="wiki:build" />--> + <attainGoal name="wiki:build" /> </goal> <goal name="prj-install"> </goal> <goal name="deploy"> - <!--<attainGoal name="wiki:deploy" />--> + <attainGoal name="wiki:deploy" /> </goal> <goal name="wiki:build"> Modified: trunk/forge/portal-extensions/jbosswiki/project.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/project.xml 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/project.xml 2005-09-14 15:30:01 UTC (rev 1110) @@ -5,5 +5,14 @@ See terms of license at gnu.org. --> <project> +<pomVersion>3</pomVersion> + <id>jbosswiki</id> + <name>JBoss Wiki</name> + <currentVersion>1.0</currentVersion> + <organization> + <name>Tomasz Szymanski</name> + <url>http://mamut.net.pl</url> + </organization> + <description></description> </project> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml 2005-09-14 15:30:01 UTC (rev 1110) @@ -83,13 +83,6 @@ <jar>commons-fileupload-1.0.jar</jar> </dependency> - <dependency> - <groupId>informa</groupId> - <artifactId>informa</artifactId> - <version>0.6.0</version> - <jar>informa-0.6.0.jar</jar> - </dependency> - <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-14 15:30:01 UTC (rev 1110) @@ -56,5 +56,9 @@ <name>RSSPlugin</name> <class>org.jboss.wiki.plugins.RSSPlugin</class> </plugin> + <plugin> + <name>HTMLPartTranslator</name> + <class>org.jboss.wiki.plugins.HTMLTranslatorParts</class> + </plugin> </wikiType> </wikiTypes> \ No newline at end of file Added: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslatorParts.java 2005-09-14 15:30:01 UTC (rev 1110) @@ -0,0 +1,1052 @@ +/************************************************** + * * + * JBoss Labs: Creating Professional Open Source * + * * + * Distributable under LGPL license. * + * See terms of license at gnu.org. * + * * + *************************************************/ + +/* + Copyright (C) 2005 Damon Sicore, + Rali Genova, + Tomasz Szymanski, + Adam Warski, + JBoss, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + */ + +/** + * Portions of this work are based on the work + * of Janne Jalkanen of the JSPWiki project. + * + * Marked Portions are Copyright (C) 2001-2002 Janne Jalkanen (Jan...@ik...) + * + * Those portions are marked by the 'author' javadoc tag + * and list Janne Jalkanen as the author of that method. + * + * This class is based on the JSPWiki 2.0 version + * of the TranslatorReader.java class. The original + * version of that class can be found here: + * + * http://anonsvn.labs.jboss.com/branches/forge/archives/jspwiki/src/com/ecyrd/jspwiki/TranslatorReader.java + * + */ +package org.jboss.wiki.plugins; + +/** + * @author <a href="mailto:ral...@jb...">Rali Genova </a> + * @author <a href="mailto:tom...@jb...">Tomasz Szymanski </a> + * + */ +import java.io.*; +import java.util.regex.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.StringTokenizer; +import java.util.Vector; + +import org.jboss.wiki.WikiEngine; +import org.jboss.wiki.WikiPage; +import org.jboss.wiki.WikiPlugin; +import org.jboss.wiki.WikiSession; + +public class HTMLTranslatorParts extends WikiPlugin { + + /* URL components, later to be configurable */ + private String portalHome = ""; + + public final static String pagePartRegexStart = "<!--page:start-->"; + + public final static String pagePartRegexEnd = "<!--page:end-->"; + + private final String pagePartRegex = pagePartRegexStart + ".*" + + pagePartRegexEnd; + + private String wikiHome = ""; + + // private String actionType = "&ctrl:type="; + + private String page = "&page="; + + private String mediaPatterns; + + private String imagePath; + + private String[] mediaFormats = { "*.png", "*.jpeg", "*.gif" }; + + /* formatting variables */ + + private boolean m_allowHTML = false; + + private boolean m_isbold = false; + + private boolean m_isitalic = false; + + private boolean m_isTypedText = false; + + private boolean m_istable = false; + + private boolean m_isPre = false; + + private boolean m_isdefinition = false; + + private int m_listlevel = 0; + + private int m_numlistlevel = 0; + + private boolean m_camelCaseLinks = true; // camelCase enabled + + /** Tag that gets closed at EOL. */ + private String m_closeTag = null; + + /** Allow this many characters to be pushed back in the stream. */ + private static final int PUSHBACK_BUFFER_SIZE = 8; + + /** + * These characters constitute word separators when trying to find CamelCase + * links. + */ + private static final String WORD_SEPARATORS = ",.|:;+=&"; + + private PushbackReader m_in; + + // stores the name of the wiki page we are currently processing + private String pageName = ""; + + public HTMLTranslatorParts() { + + } + + /** + * Push back any character to the current input. Does not push back a read + * EOF, though. + * + * @author Janne Jalkanen + */ + private void pushBack(int c) throws IOException { + if (c != -1) { + m_in.unread(c); + } + } + + /** + * Wiki to HTML transformation method, plain URIs transformation not + * implemented + * + * @param page + * The String representation of a wiki page's content + * @return The final transformed into HTML string + * @author Janne Jalkanen + * @author Rali Genova + */ + public String parseLinks(String page) throws IOException { + m_in = new PushbackReader(new StringReader(page), PUSHBACK_BUFFER_SIZE); + StringBuffer buf = new StringBuffer(); + StringBuffer word = null; + int previousCh = -2; + int start = 0; + boolean quitReading = false; + boolean newLine = true; // FIXME: not true if reading starts in middle + // of buffer + + while (!quitReading) { + int ch = nextToken(); + String s = null; + + // begin of HTML transformation + if (m_isPre) { + if (ch == '}') { + buf.append(handleClosebrace()); + } else if (ch == '<') { + buf.append("<"); + } else if (ch == '>') { + buf.append(">"); + } else if (ch == -1) { + quitReading = true; + } else { + buf.append((char) ch); + } + + continue; + } + // + // CamelCase detection, a non-trivial endeavour. + // We keep track of all white-space separated entities, which we + // hereby refer to as "words". We then check for an existence + // of a CamelCase format text string inside the "word", and + // if one exists, we replace it with a proper link. + // + + if (m_camelCaseLinks) { + // Quick parse of start of a word boundary. + + if (word == null + && (Character.isWhitespace((char) previousCh) + || WORD_SEPARATORS.indexOf((char) previousCh) != -1 || newLine) + && !Character.isWhitespace((char) ch)) { + word = new StringBuffer(); + } + + // Are we currently tracking a word? + if (word != null) { + // + // Check for the end of the word. + // + + if (Character.isWhitespace((char) ch) || ch == -1 + || WORD_SEPARATORS.indexOf((char) ch) != -1) { + String potentialLink = word.toString(); + + String camelCase = parseCamelCase(potentialLink); + + if (camelCase != null) { + start = buf.toString().lastIndexOf(camelCase); + buf.replace(start, start + camelCase.length(), + handleHyperlinks(camelCase)); + } + + // We've ended a word boundary, so time to reset. + word = null; + } else { + // This should only be appending letters and digits. + word.append((char) ch); + } // if end of word + } // if word's not null + + // Always set the previous character to test for word starts. + previousCh = ch; + + } // if m_camelCaseLinks + // + // Check if any lists need closing down. + // + + if (newLine && ch != '*' && ch != ' ' && m_listlevel > 0) { + buf.append("</LI>\n"); + for (; m_listlevel > 0; m_listlevel--) { + buf.append("</UL>\n"); + } + } + + if (newLine && ch != '#' && ch != ' ' && m_numlistlevel > 0) { + buf.append("</LI>\n"); + for (; m_numlistlevel > 0; m_numlistlevel--) { + buf.append("</OL>\n"); + } + } + + if (newLine && ch != '|' && m_istable) { + buf.append("</TABLE>\n"); + m_istable = false; + m_closeTag = null; + } + + switch (ch) { + case '\r': + // DOS linefeeds we forget + s = null; + break; + + case '\n': + // + // Close things like headings, etc. + // + if (m_closeTag != null) { + buf.append(m_closeTag); + m_closeTag = null; + } + + m_isdefinition = false; + + if (newLine) { + // Paragraph change. + + buf.append("<P />\n"); + } else { + buf.append("\n"); + newLine = true; + } + /* + * wiki syntax handling, later to be refactored so multiple wiki + * syntax is supported + */ + + break; + case '\\': + s = handleBackslash(); + break; + + case '_': + s = handleUnderscore(); + break; + + case '\'': + s = handleApostrophe(); + break; + + case '{': + s = handleOpenbrace(); + break; + + case '}': + s = handleClosebrace(); + break; + + case '-': + s = handleDash(); + break; + + case '!': + if (newLine) { + s = handleHeading(); + } else { + s = "!"; + } + break; + + case ';': + if (newLine) { + s = handleDefinitionList(); + } else { + s = ";"; + } + break; + + case ':': + if (m_isdefinition) { + s = "</DT><DD>"; + m_isdefinition = false; + } else { + s = ":"; + } + break; + + case '[': + s = handleOpenbracket(); + break; + + case '*': + if (newLine) { + s = handleUnorderedList(); + } else { + s = "*"; + } + break; + + case '#': + if (newLine) { + s = handleOrderedList(); + } else { + s = "#"; + } + break; + + case '|': + s = handleBar(newLine); + break; + + case '<': + s = m_allowHTML ? "<" : "<"; + break; + + case '>': + s = m_allowHTML ? ">" : ">"; + break; + + case '\"': + s = m_allowHTML ? "\"" : """; + break; + + case '~': + s = handleTilde(); + break; + case -1: + quitReading = true; + break; + + default: + buf.append((char) ch); + newLine = false; + break; + } + if (s != null) { + buf.append(s); + + newLine = false; + } + + } + + return buf.toString(); + } + + /** + * @param link - + * potential camel case link to be tested + * @return the string itself if not a camel case, and a proper link + * otherwise + * @author Rali Genova + * @author Janne Jalkanen + */ + public String parseCamelCase(String link) { + String camelCasepattern = "^([^\\p{Alnum}]*|\\~)([\\p{Upper}]+[\\p{Lower}]+[\\p{Upper}]+[\\p{Alnum}]*)[^\\p{Alnum}]*$"; + Pattern camelCase = Pattern.compile(camelCasepattern); + Matcher camelMatch = camelCase.matcher(link); + if (camelMatch.matches()) { + String result = camelMatch.group(2); // get the camel case words + if (camelMatch.group(1) != null) { + if ((camelMatch.group(1).equals("~")) + || (camelMatch.group(1).indexOf('[') != -1)) { + return null; // this is camelCase escape or [...] link + } + } + return result; + + }// if match + return null; + } + + /* a collection of all media formats allowed on wiki */ + private Collection getImagePatterns() { + ArrayList patt = new ArrayList(); + String imagepattern = mediaPatterns; + String[] elem = imagepattern.split(","); + for (int i = 0; i < elem.length; i++) { + patt.add(elem[i].trim()); + } + + return patt; + } + + private boolean checkImageLink(String text) { + ArrayList ptrns = (ArrayList) getImagePatterns(); + for (int i = 0; i < ptrns.size(); i++) { + if (text.endsWith((String) ptrns.get(i))) { + return true; + } + } + + return false; + } + + /** + * Generic escape of next character or entity. + */ + private String handleTilde() throws IOException { + int ch = nextToken(); + + if (ch == '|') + return "|"; + + if (Character.isUpperCase((char) ch)) { + return String.valueOf((char) ch); + } + + // No escape. + pushBack(ch); + + return "~"; + } + + private String handleUnderscore() throws IOException { + int ch = nextToken(); + String res = "_"; + + if (ch == '_') { + res = m_isbold ? "</B>" : "<B>"; + m_isbold = !m_isbold; + } else { + pushBack(ch); + } + + return res; + } + + /** + * For example: italics. + */ + private String handleApostrophe() throws IOException { + int ch = nextToken(); + String res = "'"; + + if (ch == '\'') { + res = m_isitalic ? "</I>" : "<I>"; + m_isitalic = !m_isitalic; + } else { + m_in.unread(ch); + } + + return res; + } + + private String handleDash() throws IOException { + int ch = nextToken(); + + if (ch == '-') { + int ch2 = nextToken(); + + if (ch2 == '-') { + int ch3 = nextToken(); + + if (ch3 == '-') { + // Empty away all the rest of the dashes. + // Do not forget to return the first non-match back. + while ((ch = nextToken()) == '-') + ; + + pushBack(ch); + return "<HR />"; + } + + pushBack(ch3); + } + pushBack(ch2); + } + + pushBack(ch); + + return "-"; + } + + private String handleHeading() throws IOException { + StringBuffer buf = new StringBuffer(); + + int ch = nextToken(); + + if (ch == '!') { + int ch2 = nextToken(); + + if (ch2 == '!') { + buf.append("<H2>"); + m_closeTag = "</H2>"; + } else { + buf.append("<H3>"); + m_closeTag = "</H3>"; + pushBack(ch2); + } + } else { + buf.append("<H4>"); + m_closeTag = "</H4>"; + pushBack(ch); + } + + return buf.toString(); + } + + private String handleUnorderedList() throws IOException { + StringBuffer buf = new StringBuffer(); + + if (m_listlevel > 0) { + buf.append("</LI>\n"); + } + + int numBullets = countChars(m_in, '*') + 1; + + if (numBullets > m_listlevel) { + for (; m_listlevel < numBullets; m_listlevel++) + buf.append("<UL>\n"); + } else if (numBullets < m_listlevel) { + for (; m_listlevel > numBullets; m_listlevel--) + buf.append("</UL>\n"); + } + + buf.append("<LI>"); + + return buf.toString(); + } + + private String handleOrderedList() throws IOException { + StringBuffer buf = new StringBuffer(); + + if (m_numlistlevel > 0) { + buf.append("</LI>\n"); + } + + int numBullets = countChars(m_in, '#') + 1; + + if (numBullets > m_numlistlevel) { + for (; m_numlistlevel < numBullets; m_numlistlevel++) + buf.append("<OL>\n"); + } else if (numBullets < m_numlistlevel) { + for (; m_numlistlevel > numBullets; m_numlistlevel--) + buf.append("</OL>\n"); + } + + buf.append("<LI>"); + + return buf.toString(); + + } + + private int countChars(PushbackReader in, char c) throws IOException { + int count = 0; + int ch; + + while ((ch = in.read()) != -1) { + if ((char) ch == c) { + count++; + } else { + in.unread(ch); + break; + } + } + + return count; + } + + private String handleBar(boolean newLine) throws IOException { + StringBuffer sb = new StringBuffer(); + + if (!m_istable && !newLine) { + return "|"; + } + + if (newLine) { + if (!m_istable) { + sb.append("<TABLE CLASS=\"wikitable\" BORDER=\"1\">\n"); + m_istable = true; + } + + sb.append("<TR>"); + m_closeTag = "</TD></TR>"; + } + + int ch = nextToken(); + + if (ch == '|') { + if (!newLine) { + sb.append("</TH>"); + } + sb.append("<TH>"); + m_closeTag = "</TH></TR>"; + } else { + if (!newLine) { + sb.append("</TD>"); + } + sb.append("<TD>"); + pushBack(ch); + } + + return sb.toString(); + } + + private String handleDefinitionList() throws IOException { + if (!m_isdefinition) { + m_isdefinition = true; + + m_closeTag = "</DD>\n</DL>"; + + return "<DL>\n<DT>"; + } + + return ";"; + } + + private String handleBackslash() throws IOException { + int ch = nextToken(); + + if (ch == '\\') { + int ch2 = nextToken(); + + if (ch2 == '\\') { + return "<BR clear=\"all\" />"; + } + + pushBack(ch2); + + return "<BR />"; + } + + pushBack(ch); + + return "\\"; + } + + private String handleOpenbracket() throws IOException { + StringBuffer sb = new StringBuffer(); + int ch; + boolean isPlugin = false; + + while ((ch = nextToken()) == '[') { + sb.append((char) ch); + } + + if (sb.length() > 0) { + return sb.toString();// not a link + } + + // + // Find end of hyperlink + // + pushBack(ch); + ch = nextToken(); + + while (ch != -1) { + if (ch == ']')// && (!isPlugin || sb.charAt( sb.length()-1 ) == + // '}' + // ) ) + { + break; + } + + sb.append((char) ch); + + ch = nextToken(); + } + + if (ch == -1) { + + return sb.toString(); + } + + return handleHyperlinks(sb.toString()); + } + + private String handleOpenbrace() throws IOException { + int ch = nextToken(); + String res = "{"; + + if (ch == '{') { + int ch2 = nextToken(); + + if (ch2 == '{') { + res = "<PRE>"; + m_isPre = true; + } else { + pushBack(ch2); + + res = "<TT>"; + m_isTypedText = true; + } + } else { + pushBack(ch); + } + + return res; + } + + /** + * Handles both }} and }}} + */ + private String handleClosebrace() throws IOException { + String res = "}"; + + int ch2 = nextToken(); + + if (ch2 == '}') { + int ch3 = nextToken(); + + if (ch3 == '}') { + if (m_isPre) { + m_isPre = false; + res = "</PRE>"; + } else { + res = "}}}"; + } + } else { + pushBack(ch3); + + if (!m_isPre) { + res = "</TT>"; + m_isTypedText = false; + } else { + pushBack(ch2); + } + } + } else { + pushBack(ch2); + } + + return res; + } + + /** + * Returns true if the link is really command to insert a plugin. + * <P> + * Currently we just check if the link starts with "{INSERT", or just plain + * "{" but not "{$". + * + * @author Janne Jalkanen + * + * @param link + * Link text, i.e. the contents of text between []. + * @return True, if this link seems to be a command to insert a plugin here. + */ + public static boolean isPluginLink(String link) { + return link.startsWith("{INSERT") + || (link.startsWith("{") && !link.startsWith("{$")); + } + + /** + * method to create links for external pages of Wiki pages + * + * @param string + * @return the HTML link representation of the wiki page/external link + * @author Rali Genova + */ + private String handleHyperlinks(String link) { + String result = ""; + String text = ""; + String wikiPage = ""; + + if (isPluginLink(link)) { + return null; // we do not include plugin links for now + } + int border = link.indexOf('|'); + if (border != -1) // [text|link] case + { + text = link.substring(0, border); + link = link.substring(border + 1); + + } else // [link] case + { + text = link; + + } + + // external link + if (isExternalLink(link)) { + if (checkImageLink(link)) { + result = "<img src=\"" + link + "\"alt=\"" + text + "\">";// external + // image + } else + result = "<a href=\"" + + link + + "\" target=\"_blank\">" + + text + + "</a><img src=\"/file-access/default/members/jbosswiki/images/out.png\"/>"; + } + // internal link + else { + // check if a footnote + if (link.startsWith("#"))// footnote reference + { + // http://labs.jboss.com/JSPWiki/Wiki.jsp?page=TextFormattingRules#ref-TextFormattingRules-1 + result = "<a name=\"ref-" + pageName + "-" + link.substring(1) + + "\">[" + text + "]</A>"; + + } else if (isNumber(link))// defines footnote + { + result = "<a href=\"" + portalHome + wikiHome + page + pageName + + "#ref-" + pageName + "-" + link + "\">[" + text + + "]</A>"; + } + + // check if not an image link as well + else if (checkImageLink(link)) { + result = "<img src=\"" + imagePath + "/" + pageName + "/" + + link + "\" alt=\"" + text + "\">"; + + } + // check for attachments later on + else { + wikiPage = cleanLink(link); + if (wikiEngine.pageExists(wikiPage)) { + result = "<a href=\"" + portalHome + wikiHome + page + + wikiPage + "\">" + text + "</a>"; + } else + result = "<u>" + text + "</u>" + "<a href=\"" + portalHome + + wikiHome + page + wikiPage + "\">" + "?" + "</a>"; + } + } + + return result; + } + + /** + * Figures out if a link is an off-site link. This recognizes the most + * common protocols by checking how it starts. (clears all white space in + * case the link starts with '\n' or [space] + * + * @author Janne Jalkanen + */ + private boolean isExternalLink(String link) { + link = link.trim(); + return link.startsWith("http:") || link.startsWith("ftp:") + || link.startsWith("https:") || link.startsWith("mailto:") + || link.startsWith("news:") || link.startsWith("file:"); + } + + private int nextToken() throws IOException { + return m_in.read(); + } + + /** + * Push back any character to the current input. Does not push back a read + * EOF, though. + */ + + /** + * Cleans a Wiki name. + * <P>[ This is a link ] -> ThisIsALink + * + * @param link + * Link to be cleared. Null is safe, and causes this to return + * null. + * @return A cleaned link. + * + * @since 2.0 + * @author Janne Jalkanen + */ + public String cleanLink(String link) { + StringBuffer clean = new StringBuffer(); + + if (link == null) + return null; + + // + // Compress away all whitespace and capitalize + // all words in between. + // + + StringTokenizer st = new StringTokenizer(link, " -"); + + while (st.hasMoreTokens()) { + StringBuffer component = new StringBuffer(st.nextToken()); + + component.setCharAt(0, Character.toUpperCase(component.charAt(0))); + + // + // We must do this, because otherwise compiling on JDK 1.4 causes + // a downwards incompatibility to JDK 1.3. + // + clean.append(component.toString()); + } + + // + // Remove non-alphanumeric characters that should not + // be put inside WikiNames. Note that all valid + // Unicode letters are considered okay for WikiNames. + // It is the problem of the WikiPageProvider to take + // care of actually storing that information. + // + + for (int i = 0; i < clean.length(); i++) { + if (!(Character.isLetterOrDigit(clean.charAt(i)) + || clean.charAt(i) == '_' || clean.charAt(i) == '.')) { + clean.deleteCharAt(i); + --i; // We just shortened this buffer. + } + } + + return clean.toString(); + } + + /** + * Returns true, if the argument contains a number, otherwise false. In a + * quick test this is roughly the same speed as Integer.parseInt() if the + * argument is a number, and roughly ten times the speed, if the argument is + * NOT a number. + */ + + private boolean isNumber(String s) { + if (s == null) + return false; + + if (s.length() > 1 && s.charAt(0) == '-') + s = s.substring(1); + + for (int i = 0; i < s.length(); i++) { + if (!Character.isDigit(s.charAt(i))) + return false; + } + + return true; + } + + // not sure what it is supposed to do but neccessary to compile + public void next() { + } + + public WikiPage process(final WikiPage wikiPage, WikiSession wikiSession) { + WikiPage newPage = null; + m_allowHTML = false; + m_isbold = false; + m_isitalic = false; + m_isTypedText = false; + m_istable = false; + m_isPre = false; + m_isdefinition = false; + m_listlevel = 0; + m_numlistlevel = 0; + m_camelCaseLinks = true; // camelCase enabled + /** Tag that gets closed at EOL. */ + m_closeTag = null; + + portalHome = (String) wikiSession.getAttribute("hostURL") + + (String) wikiSession.getAttribute("actionURL"); + wikiHome = ""; + imagePath = (String) wikiSession.getAttribute("hostURL") + "/wiki"; + + try { + newPage = (WikiPage) wikiPage.clone(); + } catch (CloneNotSupportedException cnse) { + System.out.println("cannot clone the page: " + cnse); + } + + pageName = newPage.getName(); + String newContent = parseParts(newPage.getContent()); + + newPage.setPageContent(newContent); + + return newPage; + } + + private String parseParts(String pageContent) { + String newPageContent = pageContent; + + try { + int lastBegIndx = 0; + while ((lastBegIndx = newPageContent.indexOf(pagePartRegexStart, + lastBegIndx)) != -1) { + int endIndx = newPageContent.indexOf(pagePartRegexEnd, + lastBegIndx); + + if (endIndx != -1) { + String pagePart = newPageContent.substring(lastBegIndx + pagePartRegexStart.length(), + endIndx); + String replace = parseLinks(pagePart).replaceAll("&", "&"); + + newPageContent = newPageContent.substring(0, lastBegIndx + + pagePartRegexStart.length()) + + replace + + newPageContent.substring(endIndx + + pagePartRegexEnd.length()); + + lastBegIndx += replace.length(); + } + + } + + } catch (IOException e) { + System.out.println(e); + newPageContent = "error on page"; + } + + return newPageContent; + + } + + @Override + public void init() { + mediaPatterns = getProperty("imagePatterns"); + + } + +} Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 15:07:40 UTC (rev 1109) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-14 15:30:01 UTC (rev 1110) @@ -13,6 +13,8 @@ public class RSSPlugin extends WikiPlugin { + private DifferenceEngine differenceEngine; + private void addItem(StringBuilder rssFeed, String title, String link, String description) { rssFeed.append("<item>\n"); @@ -29,7 +31,7 @@ "<!-- name=\"generator\" content=\"JBoss Wiki RSSPlugin\" -->\n"); rssFeed.append("<rss version=\"0.92\">\n"); rssFeed.append("<channel>\n"); - rssFeed.append("<title>JBoss Forge Wiki</title>\n"); + rssFeed.append("<title>JBoss Forge Wiki: "+wikiPage.getName()+"</title>\n"); rssFeed.append("<link>" + (String) wikiSession.getAttribute("hostURL") + "/wiki/" + wikiPage.getName() + "</link>\n"); rssFeed.append("<description>JBoss Wiki: " + wikiPage.getName() @@ -37,24 +39,36 @@ rssFeed.append("<language>en</language>\n"); for (int i = wikiPage.getLastVersion(); i > 0; i--) { + String content = HTMLTranslatorParts.pagePartRegexStart + + wikiPage.getPageAtVersion(true, i).getPageContent() + + HTMLTranslatorParts.pagePartRegexEnd; + + if (i > 1) { + try { + content = differenceEngine.colorizeDiff(differenceEngine.makeDiff(wikiPage.getPageAtVersion(true, i).getPageContent(), wikiPage.getPageAtVersion(true, i-1).getPageContent())) + "<br />\n<br />\n"+ content; + } + catch (IOException ioe) { + System.err.println("Couldn't get diff from pages: "+ioe); + } + } + addItem(rssFeed, wikiPage.getName() + " rev: " + i, (String) wikiSession.getAttribute("hostURL") + getProperty("wikiHome").replaceAll("&", "&") - + "&page=" + wikiPage.getName() + "&version=" + i, - wikiPage.getPageAtVersion(true, i).getPageContent()); + + "&page=" + wikiPage.getName() + + "&version=" + i, content); } rssFeed.append("</channel>\n</rss>\n"); - + wikiPage.setPageContent(rssFeed.toString()); - + return wikiPage; } @Override public void init() { - // TODO Auto-generated method stub - + differenceEngine = new DifferenceEngine("ISO-8859-1"); } } |
From: <jbo...@li...> - 2005-09-14 15:08:04
|
Author: szimano Date: 2005-09-14 11:07:40 -0400 (Wed, 14 Sep 2005) New Revision: 1109 Modified: trunk/forge/portal-extensions/forge-login/maven.xml Log: copying login-conf.xml fixed Modified: trunk/forge/portal-extensions/forge-login/maven.xml =================================================================== --- trunk/forge/portal-extensions/forge-login/maven.xml 2005-09-14 13:36:48 UTC (rev 1108) +++ trunk/forge/portal-extensions/forge-login/maven.xml 2005-09-14 15:07:40 UTC (rev 1109) @@ -22,15 +22,11 @@ <ant:filename name="target/*.jar" /> </ant:fileset> </ant:copy> - <ant:copy todir="${local.deploy.dir}/jboss-portal.sar/conf" flatten="true"> - <ant:fileset dir="."> - <ant:filename name="to-copy/login-config.xml" /> - </ant:fileset> - </ant:copy> - <ant:copy todir="${local.deploy.dir}" flatten="true"> - <ant:fileset dir="."> - <ant:filename name="to-copy/portal-login-ds.xml" /> - </ant:fileset> - </ant:copy> + <ant:copy + todir="${local.deploy.dir}/jboss-portal.sar/conf" + file="to-copy/login-config.xml" overwrite="true" /> + <ant:copy + todir="${local.deploy.dir}" + file="to-copy/portal-login-ds.xml" overwrite="true" /> </goal> </project> |
From: <jbo...@li...> - 2005-09-14 13:37:02
|
Author: adamw Date: 2005-09-14 09:36:48 -0400 (Wed, 14 Sep 2005) New Revision: 1108 Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml Log: Bringing back the blog. Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-14 05:39:23 UTC (rev 1107) +++ trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-14 13:36:48 UTC (rev 1108) @@ -88,6 +88,8 @@ feedAddress = replaceProperty(feedAddress, "${host.address}", request .getServerName()); + feedAddress = replaceProperty(feedAddress, "${scheme.name}", request + .getScheme()); feedAddress = replaceProperty(feedAddress, "${host.port}", Integer .toString(request.getServerPort())); if (projectId != null) @@ -101,6 +103,8 @@ .getServerName()); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.port}", Integer .toString(request.getServerPort())); + remoteFeedAddress = replaceProperty(remoteFeedAddress, "${scheme.name}", request + .getScheme()); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${project.name}", projectId); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${portal.name}", portalName); String feedTypeFreeAddress = remoteFeedAddress; Modified: trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-14 05:39:23 UTC (rev 1107) +++ trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-14 13:36:48 UTC (rev 1108) @@ -29,12 +29,12 @@ <init-param> <description>Address of the blog's local feed.</description> <name>feedAddress</name> - <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> + <value>${scheme.name}://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <init-param> <description>Address of the blog's remote feed.</description> <name>remoteFeedAddress</name> - <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> + <value>${scheme.name}://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <portlet-info> <title>JBoss Blog Portlet</title> |
From: <jbo...@li...> - 2005-09-14 05:39:51
|
Author: mla...@jb... Date: 2005-09-14 01:39:23 -0400 (Wed, 14 Sep 2005) New Revision: 1107 Modified: trunk/labs/jbossweb/xdocs/project.xml trunk/labs/jbossweb/xdocs/resources/mail.xml trunk/labs/jbossweb/xdocs/resources/project.xml Log: Add links to JBoss forums Modified: trunk/labs/jbossweb/xdocs/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 22:55:19 UTC (rev 1106) +++ trunk/labs/jbossweb/xdocs/project.xml 2005-09-14 05:39:23 UTC (rev 1107) @@ -14,7 +14,7 @@ <menu name="Resources"> <item name="FAQs" href="resources/faq.html"/> <item name="Tutorial" href="resources/tut.html"/> - <item name="Mailing Lists" href="resources/mail.html"/> + <item name="Lists & Forums" href="resources/mail.html"/> </menu> <menu name="News"> <item name="News & Status" href="news/2005.html"/> Modified: trunk/labs/jbossweb/xdocs/resources/mail.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/mail.xml 2005-09-13 22:55:19 UTC (rev 1106) +++ trunk/labs/jbossweb/xdocs/resources/mail.xml 2005-09-14 05:39:23 UTC (rev 1107) @@ -8,11 +8,29 @@ <properties> <author email="mla...@jb...">Mladen Turk</author> - <title>Mailing lists</title> + <title>Mailing lists and Forums</title> </properties> <body> +<section name="JBoss Web"> +<br/> +<subsection name="User Forum"> +<p>User discussions and questions about JBoss Web. +<ul> +<li><a href="http://jboss.com/index.html?module=bb&op=viewforum&f=230">JBoss Web</a></li> +</ul> +</p> +</subsection> +<subsection name="Developer Forum"> +<p>Forum for discussions concerning the design of JBoss Web. +<ul> +<li><a href="http://jboss.com/index.html?module=bb&op=viewforum&f=229">Design of JBoss Web</a></li> +</ul> +</p> +</subsection> +</section> + <section name="Apache Tomcat"> <br/> <subsection name="Tomcat User List"> @@ -41,7 +59,7 @@ </p> </subsection> </section> -<section name="Mailing Lists - Guidelines"> +<section name="Guidelines"> <p>A mailing list is an electronic discussion forum that anyone can subscribe to. When someone sends an email message to the mailing list, Modified: trunk/labs/jbossweb/xdocs/resources/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 22:55:19 UTC (rev 1106) +++ trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-14 05:39:23 UTC (rev 1107) @@ -7,7 +7,7 @@ <menu name="Resources"> <item name="FAQs" href="faq.html"/> <item name="Tutorial" href="tut.html"/> - <item name="Mailing Lists" href="mail.html"/> + <item name="Lists & Forums" href="mail.html"/> </menu> <menu name="FAQs"> <item name="General" href="faq01.html"/> |
Author: szimano Date: 2005-09-13 18:55:19 -0400 (Tue, 13 Sep 2005) New Revision: 1106 Removed: trunk/forge/portal-extensions/jbosswiki/lib/cglib2.jar trunk/forge/portal-extensions/jbosswiki/lib/commons-beanutils.jar trunk/forge/portal-extensions/jbosswiki/lib/commons-collections.jar trunk/forge/portal-extensions/jbosswiki/lib/commons-lang.jar trunk/forge/portal-extensions/jbosswiki/lib/commons-logging.jar trunk/forge/portal-extensions/jbosswiki/lib/dom4j.jar trunk/forge/portal-extensions/jbosswiki/lib/ehcache.jar trunk/forge/portal-extensions/jbosswiki/lib/hibernate2.jar trunk/forge/portal-extensions/jbosswiki/lib/hsqldb.jar trunk/forge/portal-extensions/jbosswiki/lib/informa.jar trunk/forge/portal-extensions/jbosswiki/lib/jdbc2_0-stdext.jar trunk/forge/portal-extensions/jbosswiki/lib/jdom.jar trunk/forge/portal-extensions/jbosswiki/lib/jta.jar trunk/forge/portal-extensions/jbosswiki/lib/log4j-1.2.8.jar trunk/forge/portal-extensions/jbosswiki/lib/lucene.jar trunk/forge/portal-extensions/jbosswiki/lib/odmg.jar trunk/forge/portal-extensions/jbosswiki/lib/xalan.jar trunk/forge/portal-extensions/jbosswiki/lib/xml-apis.jar Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiContext.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceLocal.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceMenagement.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/FindResultPlugin.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java trunk/forge/portal-extensions/jbosswiki/wiki-management/project.xml trunk/forge/portal-extensions/jbosswiki/wiki-management/src/java/org/jboss/wiki/management/WikiService.java Log: rss feed prototype: http://jira.jboss.com/jira/browse/JBWIKI-14 search scores added. Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/project.xml 2005-09-13 22:55:19 UTC (rev 1106) @@ -87,6 +87,7 @@ <groupId>informa</groupId> <artifactId>informa</artifactId> <version>0.6.0</version> + <jar>informa-0.6.0.jar</jar> </dependency> <dependency> Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -9,12 +9,10 @@ package org.jboss.wiki; import java.io.File; -import java.io.IOException; import java.util.Date; import java.util.Iterator; import java.util.List; -import java.util.Properties; -import java.util.Set; +import java.util.Map; import javax.portlet.*; import org.jboss.portlet.*; @@ -42,18 +40,12 @@ private WikiEngine wikiEngine; public void init() { - wikiEngine = new WikiEngine(); - WikiCommon wikiCommon = new WikiCommon(); - - WikiServiceMenagement wikiServiceMenagement = wikiCommon.getWikiManagement(); - - wikiServiceMenagement.setWikiEngine(wikiEngine); - - if (wikiEngine == null) { - wikiEngine = new WikiEngine(); - wikiServiceMenagement.setWikiEngine(wikiEngine); - } + + WikiServiceMenagement wikiServiceMenagement = wikiCommon + .getWikiManagement(); + + wikiEngine = wikiServiceMenagement.getWikiEngine(); } public void processAction(JBossActionRequest rReq, JBossActionResponse rResp) { @@ -131,8 +123,7 @@ } if (rReq.getParameter("searchQuery") != null) { - // TODO do it man ! - Set<String> pages = wikiEngine.findPages(rReq + Map<String, Integer> pages = wikiEngine.findPages(rReq .getParameter("searchQuery")); rReq.getPortletSession().setAttribute("findResult", pages); @@ -313,14 +304,14 @@ } else { page = "Wiki.jsp"; - String type = "HTML"; + String type = "html"; if (rReq.getParameter("type") != null) { type = rReq.getParameter("type"); //System.out.println("Getting type: " + type); } - wikiContext = new WikiContext(rReq.getUser(), wikiEngine + wikiContext = new WikiContext((rReq.getUser() != null) ? rReq.getUser().getUserName() : "", wikiEngine .getWikiType(type), new PortletWikiSession(rReq .getPortletSession())); Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -12,13 +12,13 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.PrintWriter; import java.util.Properties; import javax.activation.MimetypesFileTypeMap; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; -import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.ServletRequest; @@ -28,9 +28,13 @@ import javax.servlet.http.HttpServletResponse; import org.jboss.wiki.FileDataSource; +import org.jboss.wiki.ServletWikiSession; import org.jboss.wiki.WikiCommon; +import org.jboss.wiki.WikiContext; import org.jboss.wiki.WikiEngine; +import org.jboss.wiki.WikiPage; import org.jboss.wiki.WikiPlugin; +import org.jboss.wiki.WikiSession; import org.jboss.wiki.management.WikiServiceMenagement; // import org.jboss.forge.common.content.ContentManager; @@ -50,9 +54,7 @@ */ public static final String specialPage = "!WikiButtons"; - - public static final char specialChar = '!'; - + private final int BUF_SIZE = 32768; private String attachementsPath; @@ -69,20 +71,13 @@ public void init(FilterConfig conf) { // get wikiEnigne form wikiMenagement - wikiEngine = new WikiEngine(); - WikiCommon wikiCommon = new WikiCommon(); WikiServiceMenagement wikiServiceMenagement = wikiCommon .getWikiManagement(); - wikiServiceMenagement.setWikiEngine(wikiEngine); + wikiEngine = wikiServiceMenagement.getWikiEngine(); - if (wikiEngine == null) { - wikiEngine = new WikiEngine(); - wikiServiceMenagement.setWikiEngine(wikiEngine); - } - // load mime types map mimeTypes = new MimetypesFileTypeMap(WikiFileAccessFilter.class @@ -116,11 +111,20 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - if (request instanceof HttpServletRequest) { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; + WikiSession wikiSession = new ServletWikiSession(httpRequest + .getSession()); + + String hostURL = ((request.isSecure()) ? "https" : "http") + + "://" + + request.getServerName() + + ((request.getServerPort() == 80) ? "" : ":" + + request.getServerPort()); + + wikiSession.setAttribute("hostURL", hostURL); String requestURI = httpRequest.getRequestURI(); // Parse URI to get filename and page name @@ -128,308 +132,268 @@ // System.out.println("length " + tokens.length); - if (tokens[tokens.length - 2].charAt(0) == specialChar) { - if (tokens[tokens.length - 2].equals(specialPage)) { - // show apropriate buttons - InputStream imageIS = WikiFileAccessFilter.class - .getResourceAsStream("/" - + tokens[tokens.length - 1]); + if (tokens[tokens.length - 2].equals(specialPage)) { + // show apropriate buttons + InputStream imageIS = WikiFileAccessFilter.class + .getResourceAsStream("/" + tokens[tokens.length - 1]); - ServletOutputStream os = response.getOutputStream(); - - response.setContentType("image/png"); - - // Transferring the bytes - try { - byte[] buffer = new byte[BUF_SIZE]; - int read; - while ((read = imageIS.read(buffer)) != -1) - os.write(buffer, 0, read); - } catch (Exception e2) { - // Nothing that we can really do. Just send an - // incomplete - // file. - } finally { - os.close(); - imageIS.close(); - } - - } - else { - // show plugin with name after "!" - - } - } else if (tokens.length == 3) { - /*String hostURL = ((request.isSecure()) ? "https" : "http") - + "://" - + request.getServerName() - + ((request.getServerPort() == 80) ? "" : ":" - + request.getServerPort()); - - httpResponse.sendRedirect(hostURL + wikiHome + "&page=" - + tokens[tokens.length - 1]);*/ - request.getRequestDispatcher("/WEB-INF/jsp/Wiki.jsp").include(request, response); - } else { - // get fileName of attachement and page which is connected to - String fileName = tokens[tokens.length - 1]; - String pageName = tokens[tokens.length - 2]; - - // System.out.println("[WikiFileAccess]Getting file: " + - // fileName - // + " of page: " + pageName); - - Properties props = new Properties(); - - try { - props.load(new FileInputStream(new File(attachementsPath - + "/" + pageName + "-att/" + fileName - + "-dir/attachment.properties"))); - } catch (IOException e) { - System.err.println(e); - } - - // looking for the newest version - int version = 1; - - while (props.getProperty((version + 1) + ".author") != null) { - version++; - } - - tokens = fileName.split("\\."); - - File file = new File( - attachementsPath - + "/" - + pageName - + "-att/" - + fileName - + "-dir/" - + version - + "." - + ((fileName.indexOf(".") != -1) ? tokens[tokens.length - 1] - : "bin")); - - FileInputStream fileIS = new FileInputStream(file); - ServletOutputStream os = response.getOutputStream(); - response.setContentType(mimeTypes.getContentType(file)); - response.setContentLength((int) file.length()); + response.setContentType("image/png"); // Transferring the bytes try { byte[] buffer = new byte[BUF_SIZE]; int read; - while ((read = fileIS.read(buffer)) != -1) + while ((read = imageIS.read(buffer)) != -1) os.write(buffer, 0, read); } catch (Exception e2) { - // Nothing that we can really do. Just send an incomplete + // Nothing that we can really do. Just send an + // incomplete // file. } finally { os.close(); - fileIS.close(); + imageIS.close(); } - } - } else { - throw new IOException( - "This servlet should be called as HTTPServletRequest"); - } - } - - private void doServletDispatch(HttpServletRequest rReq, HttpServletResponse rResp) { - - //FIXME wrong url - String wikiURL = rReq.getRequestURI(); + } else if (tokens.length == 3) { + httpResponse.sendRedirect(hostURL + wikiHome + "&page=" + + tokens[tokens.length - 1]); - rReq.setAttribute("actionURL", wikiURL); + } else { + // get fileName of attachement and page which is connected to + String firstToken = tokens[tokens.length - 2]; + String secondToken = tokens[tokens.length - 1]; - // Create server host and put it into session for plugins - String hostURL = ((rReq.isSecure()) ? "https" : "http") + "://"+rReq.getServerName()+((rReq.getServerPort() == 80) ? "" : ":"+ rReq.getServerPort()); - - rReq.getPortletSession().setAttribute("hostURL", hostURL); - rReq.getPortletSession().setAttribute("actionURL", wikiURL.toString()); - - rReq.getPortletSession().setAttribute("isSecure", - new Boolean(rReq.isSecure())); + if (Character.isUpperCase(firstToken.charAt(0))) { + // Show file of a page + String pageName = firstToken; + String fileName = secondToken; - WikiPage noSuchPage = new WikiPage("", new Credentials(""), - "There is no such page. Click on EDIT to start it.", 0, 0, - null, wikiEngine.getMediaDataSource()); + Properties props = new Properties(); - String page = "Wiki.jsp"; + try { + props.load(new FileInputStream(new File( + attachementsPath + "/" + pageName + "-att/" + + fileName + + "-dir/attachment.properties"))); + } catch (IOException e) { + System.err.println(e); + } - String wikiPage = defaultPage; + // looking for the newest version + int version = 1; - WikiPage pageToShow = null; + while (props.getProperty((version + 1) + ".author") != null) { + version++; + } - WikiContext wikiContext = null; + tokens = fileName.split("\\."); - if (rReq.getParameter("page") != null) { - wikiPage = rReq.getParameter("page"); - } + File file = new File( + attachementsPath + + "/" + + pageName + + "-att/" + + fileName + + "-dir/" + + version + + "." + + ((fileName.indexOf(".") != -1) ? tokens[tokens.length - 1] + : "bin")); - if ((rReq.getParameter("action") != null) - && (rReq.getParameter("action").equals("Attach"))) { - rReq.setAttribute("fileAttach", "true"); - } + FileInputStream fileIS = new FileInputStream(file); - if ((rReq.getParameter("action") != null) - && (rReq.getParameter("action").equals("Edit")) - && (rReq.getUser() != null)) { - page = "Edit.jsp"; + ServletOutputStream os = response.getOutputStream(); - pageToShow = wikiEngine.getByName(wikiPage, null); + response.setContentType(mimeTypes.getContentType(file)); + response.setContentLength((int) file.length()); - if (rReq.getParameter("version") != null) { - // show previous version of page + // Transferring the bytes + try { + byte[] buffer = new byte[BUF_SIZE]; + int read; + while ((read = fileIS.read(buffer)) != -1) + os.write(buffer, 0, read); + } catch (Exception e2) { + // Nothing that we can really do. Just send an + // incomplete + // file. + } finally { + os.close(); + fileIS.close(); + } + } else { + // SHOW wikiType firstToken with page secondToken - System.out.println("Getting page " + wikiPage + " at version " - + rReq.getParameter("version")); - pageToShow = wikiEngine.getByName(wikiPage, null, Integer - .valueOf(rReq.getParameter("version"))); + String wikiTypeName = firstToken; + String pageName = secondToken; - if (pageToShow.getLastVersion() != pageToShow.getVersion()) { - rReq.setAttribute("showedVersion", Integer.valueOf(rReq - .getParameter("version"))); - } - } else { - pageToShow = wikiEngine.getByName(wikiPage, null); - } + WikiPage page = wikiEngine.getByName(pageName, + new WikiContext("", wikiEngine + .getWikiType(wikiTypeName), wikiSession)); - if (pageToShow == null) { - // start editing new page - // wikiPage = defaultPage; + PrintWriter out = httpResponse.getWriter(); - pageToShow = new WikiPage(wikiPage, new Credentials(rReq - .getUser().getUserName()), "", 0, 0, new Date(), - wikiEngine.getMediaDataSource()); - // wikiEngine.getByName(wikiPage, wikiContext); - } + httpResponse.setContentType("text/xml"); + httpResponse.setContentLength(page.getPageContent() + .length()); - Date dateLock = pageToShow.lock(rReq.getUser()); + out.print(page.getPageContent()); - if (dateLock != null) { - rReq - .setAttribute( - "lockMsg", - "Page is locked by " - + pageToShow.getLockUser() - + " from " - + dateLock - + ".<br> I won't stop you from saving, but you or he can erease each other changes. Lock will expire: "); - } - - } else if ((rReq.getParameter("action") != null) - && (rReq.getParameter("action").equals("Info"))) { - page = "PageInfo.jsp"; - - pageToShow = wikiEngine.getByName(wikiPage, null); - - if (pageToShow == null) { // if somebody entered a link to info - // non-existing page - page = "Wiki.jsp"; - try { - pageToShow = (WikiPage) noSuchPage.clone(); - } catch (CloneNotSupportedException cnse) { - System.out.println(cnse); + out.flush(); } - - pageToShow.setName(wikiPage); - } else { - rReq.setAttribute("pageAtTop", pageToShow); } - } else { - page = "Wiki.jsp"; - - String type = "HTML"; - - if (rReq.getParameter("type") != null) { - type = rReq.getParameter("type"); - //System.out.println("Getting type: " + type); - } - - wikiContext = new WikiContext(rReq.getUser(), wikiEngine - .getWikiType(type), new PortletWikiSession(rReq - .getPortletSession())); - - if (rReq.getParameter("version") != null) { - // show previous version of page - System.out.println("Getting page " + wikiPage + " at version " - + rReq.getParameter("version")); - pageToShow = wikiEngine.getByName(wikiPage, wikiContext, - Integer.valueOf(rReq.getParameter("version"))); - - if (pageToShow.getLastVersion() != pageToShow.getVersion()) { - rReq.setAttribute("showedVersion", Integer.valueOf(rReq - .getParameter("version"))); - } - } else { - pageToShow = wikiEngine.getByName(wikiPage, wikiContext); - } - - if (pageToShow == null) { - - try { - pageToShow = (WikiPage) noSuchPage.clone(); - } catch (CloneNotSupportedException cnse) { - System.out.println(cnse); - } - - pageToShow.setName(wikiPage); - } - + throw new IOException( + "This servlet should be called as HTTPServletRequest"); } - - rReq - .setAttribute( - "wikiName", - "<img src=\""+hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/JBossWikiLogoMedium.png\" width=\"100\" border=\"0\" style=\"vertical-align: middle\"/>"); + } - rReq.setAttribute("wikiContent", pageToShow.getContent()); - - rReq.setAttribute("wikiImagesUrl", hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/"); - - rReq.setAttribute("wikiPage", wikiPage); - - rReq.setAttribute("editDate", pageToShow.getEditDate()); - - rReq.setAttribute("author", pageToShow.getLastAuthor()); - - rReq.setAttribute("logedIn", (rReq.getUser() != null) ? "true" - : "false"); - - rReq.setAttribute("defaultPage", defaultPage); - - // FIXME make this more elegant (ie. plugin) - // pass friendly link - /*Properties props = new Properties(); - props.load(WikiPlugin.class - .getResourceAsStream("wikiPlugins.properties")); - String href = props.getProperty("htmlTranslatorURL") + "wiki/" - + pageToShow.getName(); - String[] replaces = props.getProperty("sslRedirectReplaces").split(","); - - if (rReq.isSecure() && (replaces.length % 2 == 0)) { - // chage normal url to secure - for (int i = 0; i < replaces.length; i += 2) - href = href.replaceAll(replaces[i], replaces[i + 1]); - }*/ - - rReq.setAttribute("friendlyLink", hostURL+"/wiki/"+pageToShow.getName()); - - rRes.setTitle("Wiki"); - if (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) - || javax.portlet.WindowState.MAXIMIZED.equals(rReq - .getWindowState())) { - rRes.setContentType("text/html"); - javax.portlet.PortletRequestDispatcher pRD = this - .getPortletContext().getRequestDispatcher(jspPath + page); - pRD.include(rReq, rRes); - return; - } - doDispatch(rReq, rRes); + private void doServletDispatch(HttpServletRequest rReq, + HttpServletResponse rResp) { + /* + * //FIXME wrong url String wikiURL = rReq.getRequestURI(); + * + * rReq.setAttribute("actionURL", wikiURL); // Create server host and + * put it into session for plugins String hostURL = ((rReq.isSecure()) ? + * "https" : "http") + "://"+rReq.getServerName()+((rReq.getServerPort() == + * 80) ? "" : ":"+ rReq.getServerPort()); + * + * rReq.getPortletSession().setAttribute("hostURL", hostURL); + * rReq.getPortletSession().setAttribute("actionURL", + * wikiURL.toString()); + * + * rReq.getPortletSession().setAttribute("isSecure", new + * Boolean(rReq.isSecure())); + * + * WikiPage noSuchPage = new WikiPage("", new Credentials(""), "There is + * no such page. Click on EDIT to start it.", 0, 0, null, + * wikiEngine.getMediaDataSource()); + * + * String page = "Wiki.jsp"; + * + * String wikiPage = defaultPage; + * + * WikiPage pageToShow = null; + * + * WikiContext wikiContext = null; + * + * if (rReq.getParameter("page") != null) { wikiPage = + * rReq.getParameter("page"); } + * + * if ((rReq.getParameter("action") != null) && + * (rReq.getParameter("action").equals("Attach"))) { + * rReq.setAttribute("fileAttach", "true"); } + * + * if ((rReq.getParameter("action") != null) && + * (rReq.getParameter("action").equals("Edit")) && (rReq.getUser() != + * null)) { page = "Edit.jsp"; + * + * pageToShow = wikiEngine.getByName(wikiPage, null); + * + * if (rReq.getParameter("version") != null) { // show previous version + * of page + * + * System.out.println("Getting page " + wikiPage + " at version " + + * rReq.getParameter("version")); pageToShow = + * wikiEngine.getByName(wikiPage, null, Integer + * .valueOf(rReq.getParameter("version"))); + * + * if (pageToShow.getLastVersion() != pageToShow.getVersion()) { + * rReq.setAttribute("showedVersion", Integer.valueOf(rReq + * .getParameter("version"))); } } else { pageToShow = + * wikiEngine.getByName(wikiPage, null); } + * + * if (pageToShow == null) { // start editing new page // wikiPage = + * defaultPage; + * + * pageToShow = new WikiPage(wikiPage, new Credentials(rReq + * .getUser().getUserName()), "", 0, 0, new Date(), + * wikiEngine.getMediaDataSource()); // wikiEngine.getByName(wikiPage, + * wikiContext); } + * + * Date dateLock = pageToShow.lock(rReq.getUser()); + * + * if (dateLock != null) { rReq .setAttribute( "lockMsg", "Page is + * locked by " + pageToShow.getLockUser() + " from " + dateLock + ".<br> + * I won't stop you from saving, but you or he can erease each other + * changes. Lock will expire: "); } } else if + * ((rReq.getParameter("action") != null) && + * (rReq.getParameter("action").equals("Info"))) { page = + * "PageInfo.jsp"; + * + * pageToShow = wikiEngine.getByName(wikiPage, null); + * + * if (pageToShow == null) { // if somebody entered a link to info // + * non-existing page page = "Wiki.jsp"; try { pageToShow = (WikiPage) + * noSuchPage.clone(); } catch (CloneNotSupportedException cnse) { + * System.out.println(cnse); } + * + * pageToShow.setName(wikiPage); } else { rReq.setAttribute("pageAtTop", + * pageToShow); } } else { page = "Wiki.jsp"; + * + * String type = "HTML"; + * + * if (rReq.getParameter("type") != null) { type = + * rReq.getParameter("type"); //System.out.println("Getting type: " + + * type); } + * + * wikiContext = new WikiContext(rReq.getUser(), wikiEngine + * .getWikiType(type), new PortletWikiSession(rReq + * .getPortletSession())); + * + * if (rReq.getParameter("version") != null) { // show previous version + * of page System.out.println("Getting page " + wikiPage + " at version " + + * rReq.getParameter("version")); pageToShow = + * wikiEngine.getByName(wikiPage, wikiContext, + * Integer.valueOf(rReq.getParameter("version"))); + * + * if (pageToShow.getLastVersion() != pageToShow.getVersion()) { + * rReq.setAttribute("showedVersion", Integer.valueOf(rReq + * .getParameter("version"))); } } else { pageToShow = + * wikiEngine.getByName(wikiPage, wikiContext); } + * + * if (pageToShow == null) { + * + * try { pageToShow = (WikiPage) noSuchPage.clone(); } catch + * (CloneNotSupportedException cnse) { System.out.println(cnse); } + * + * pageToShow.setName(wikiPage); } } + * + * rReq .setAttribute( "wikiName", "<img + * src=\""+hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/JBossWikiLogoMedium.png\" + * width=\"100\" border=\"0\" style=\"vertical-align: middle\"/>"); + * + * rReq.setAttribute("wikiContent", pageToShow.getContent()); + * + * rReq.setAttribute("wikiImagesUrl", + * hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/"); + * + * rReq.setAttribute("wikiPage", wikiPage); + * + * rReq.setAttribute("editDate", pageToShow.getEditDate()); + * + * rReq.setAttribute("author", pageToShow.getLastAuthor()); + * + * rReq.setAttribute("logedIn", (rReq.getUser() != null) ? "true" : + * "false"); + * + * rReq.setAttribute("defaultPage", defaultPage); // FIXME make this + * more elegant (ie. plugin) // pass friendly link + * + * + * rReq.setAttribute("friendlyLink", + * hostURL+"/wiki/"+pageToShow.getName()); + * + * rRes.setTitle("Wiki"); if + * (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) || + * javax.portlet.WindowState.MAXIMIZED.equals(rReq .getWindowState())) { + * rRes.setContentType("text/html"); + * javax.portlet.PortletRequestDispatcher pRD = this + * .getPortletContext().getRequestDispatcher(jspPath + page); + * pRD.include(rReq, rRes); return; } doDispatch(rReq, rRes); + */ } public void destroy() { Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-13 22:55:19 UTC (rev 1106) @@ -58,7 +58,7 @@ "</td><td>"+ author + "</td><td>"+prevWikiPage.getLength()+ - "</td><td>"+ ((i > 1) ? "<a href='"+actionURL+"&type=DIFF&version="+i+"&page="+wikiPage+"'>Changes from "+(i-1)+" to "+i+"</a>" : "") +"</td>"); + "</td><td>"+ ((i > 1) ? "<a href='"+actionURL+"&type=diff&version="+i+"&page="+wikiPage+"'>Changes from "+(i-1)+" to "+i+"</a>" : "") +"</td>"); } %> </table> Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-13 22:55:19 UTC (rev 1106) @@ -32,7 +32,7 @@ <!--<a href="<%=actionURL%>&page=<%=defaultPage%>"><%=defaultPage%></a><br />--> -<form method="post" action="<%=actionURL%>&type=FIND"> +<form method="post" action="<%=actionURL%>&type=find"> <table style="width: 100%" border="0"> <tr style="vertical-align: bottom;"> <td style="vertical-align: bottom; align-bottom: 0px;"> Deleted: trunk/forge/portal-extensions/jbosswiki/lib/cglib2.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/commons-beanutils.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/commons-collections.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/commons-lang.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/commons-logging.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/dom4j.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/ehcache.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/hibernate2.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/hsqldb.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/informa.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/jdbc2_0-stdext.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/jdom.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/jta.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/log4j-1.2.8.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/lucene.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/odmg.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/xalan.jar =================================================================== (Binary files differ) Deleted: trunk/forge/portal-extensions/jbosswiki/lib/xml-apis.jar =================================================================== (Binary files differ) Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/.classpath 2005-09-13 22:55:19 UTC (rev 1106) @@ -1,25 +1,48 @@ <?xml version="1.0" encoding="UTF-8"?> + <classpath> - <classpathentry kind="src" path="src/java"/> - <classpathentry kind="src" path="src/test/java"/> - <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> - <classpathentry kind="var" path="MAVEN_REPO/aslibs/jars/javax.servlet.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/aslibs/jars/javax.servlet.jsp.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/tmate/jars/javasvn.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/tmate/jars/jsch.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/activation.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/informa/jars/informa-0.6.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/dom4j/jars/dom4j-1.6.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jdom/jars/jdom-1.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-ejb3x.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-ejb3.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/portlet-api/jars/portlet-api-1.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-jmx.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-common.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/portal-common-lib.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/portal-core-lib.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/portal-portlet-lib.jar"/> - <classpathentry kind="output" path="target/classes"/> -</classpath> + <classpathentry excluding="" kind="src" path="src/java"> + </classpathentry> + <classpathentry output="target/test-classes" kind="src" path="src/test/java"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/aslibs/jars/javax.servlet.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/aslibs/jars/javax.servlet.jsp.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/tmate/jars/javasvn.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/tmate/jars/jsch.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/activation.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/informa/jars/informa-0.6.0.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/dom4j/jars/dom4j-1.6.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jdom/jars/jdom-1.0.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-ejb3x.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-ejb3.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/portlet-api/jars/portlet-api-1.0.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-jmx.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/jboss-common.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/portal-common-lib.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/portal-core-lib.jar"> + </classpathentry> + <classpathentry kind="var" path="MAVEN_REPO/jboss/jars/portal-portlet-lib.jar"> + </classpathentry> + <classpathentry kind="output" path="target/classes"> + </classpathentry> +</classpath> \ No newline at end of file Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/project.xml 2005-09-13 22:55:19 UTC (rev 1106) @@ -83,10 +83,11 @@ <jar>commons-fileupload-1.0.jar</jar> </dependency> - <dependency> + <dependency> <groupId>informa</groupId> <artifactId>informa</artifactId> <version>0.6.0</version> + <jar>informa-0.6.0.jar</jar> </dependency> <dependency> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/etc/org/jboss/wiki/WikiTypes.xml 2005-09-13 22:55:19 UTC (rev 1106) @@ -6,7 +6,7 @@ <wikiTypes> <wikiType> - <name>HTML</name> + <name>html</name> <class>org.jboss.wiki.plugins.DefaultWikiType</class> <plugin> <name>trail</name> @@ -26,7 +26,7 @@ </plugin> </wikiType> <wikiType> - <name>DIFF</name> + <name>diff</name> <class>org.jboss.wiki.plugins.DefaultWikiType</class> <plugin> <name>Diff</name> @@ -34,7 +34,7 @@ </plugin> </wikiType> <wikiType> - <name>FIND</name> + <name>find</name> <class>org.jboss.wiki.plugins.DefaultWikiType</class> <plugin> <name>findResult</name> @@ -49,4 +49,12 @@ <class>org.jboss.wiki.plugins.HTMLTranslator</class> </plugin> </wikiType> + <wikiType> + <name>rss</name> + <class>org.jboss.wiki.plugins.DefaultWikiType</class> + <plugin> + <name>RSSPlugin</name> + <class>org.jboss.wiki.plugins.RSSPlugin</class> + </plugin> + </wikiType> </wikiTypes> \ No newline at end of file Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiContext.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiContext.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiContext.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -15,8 +15,9 @@ * @version $Id$ */ -import org.jboss.portal.core.model.User; +//import org.jboss.portal.core.model.User; + /** * <p></p> * @@ -27,7 +28,7 @@ * <p>Represents ...</p> * */ - private User user; + private String user; /** * <p>Represents ...</p> @@ -40,7 +41,7 @@ */ private WikiSession wikiSession; - public WikiContext(User user, WikiType requestedType, WikiSession wikiSession) { + public WikiContext(String user, WikiType requestedType, WikiSession wikiSession) { this.user = user; this.requestedType = requestedType; this.wikiSession = wikiSession; @@ -51,7 +52,7 @@ } - public User getUser() { + public String getUser() { return user; } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiEngine.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -8,10 +8,17 @@ *************************************************/ package org.jboss.wiki; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.Set; +import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; @@ -161,17 +168,12 @@ } } else { // return noSuchPage if there isn't any - /*try { - ret = (WikiPage) noSuchPage.clone(); - } catch (CloneNotSupportedException cne) { - System.err.println(cne); - - } - if (wikiContext != null) { - return wikiContext.process(ret); - } else { - return ret; - }*/ + /* + * try { ret = (WikiPage) noSuchPage.clone(); } catch + * (CloneNotSupportedException cne) { System.err.println(cne); } if + * (wikiContext != null) { return wikiContext.process(ret); } else { + * return ret; } + */ return null; } } @@ -300,8 +302,8 @@ } public WikiType getWikiType(String wikiTypeName) { - //System.out - // .println("[WIKITYPE REQUEST]: " + wikiTypes.get(wikiTypeName)); + // System.out + // .println("[WIKITYPE REQUEST]: " + wikiTypes.get(wikiTypeName)); return wikiTypes.get(wikiTypeName); } @@ -339,25 +341,47 @@ } } - public Set<String> findPages(String searchQuery) { - //System.out.println("Starting search: " + searchQuery); + public Map<String, Integer> findPages(String searchQuery) { + // System.out.println("Starting search: " + searchQuery); WikiSearch wikiSearch = new WikiSearch(searchQuery); - Set<String> resPages = new TreeSet<String>(); + Map<String, Integer> resPages = new HashMap<String, Integer>(); Set<String> pages = getMediaDataSource().getAllPageNames(); for (String name : pages) { WikiPage temp = getByName(name, null); if (temp != null) { - if (wikiSearch.matches(temp.getPageContent().toLowerCase())) { - resPages.add(name); + int searchScore; + + if ((searchScore = wikiSearch.matches(temp.getPageContent() + .toLowerCase())) > 0) { + resPages.put(name, searchScore); } } } + + Object[] entryArr = resPages.entrySet().toArray(); + // Sorting the resPages by entry values (which are numbers), descending. + Arrays.sort(entryArr, new Comparator<Object>() { + public int compare(Object entry1, Object entry2) { + int i1 = ((Entry<String,Integer>)entry1).getValue(); + int i2 = ((Entry<String,Integer>)entry2).getValue(); - //System.out.println("Search completed"); + if (i1 == i2) + return 0; + return (i1 < i2) ? 1 : -1; + } + }); + + resPages = new LinkedHashMap<String, Integer>(); + + for (int i = 0; i < entryArr.length; i++) { + Entry<String,Integer> entry = (Entry<String,Integer>)entryArr[i]; + + resPages.put(entry.getKey(), entry.getValue()); + } + // System.out.println("Search completed"); return resPages; } - } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/WikiSearch.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -44,34 +44,38 @@ } } - public boolean matches(String content) { + public int matches(String content) { + int score = 0; + for (int i = 0; i < forbiddenTokens.size(); i++) { if (content.indexOf(forbiddenTokens.get(i)) != -1) { - // there is forbidden token - return false; + // there is forbidden token - return 0 + return 0; } } for (int i = 0; i < requiredTokens.size(); i++) { if (content.indexOf(requiredTokens.get(i)) == -1) { - // lack of one of the required tokens - return false; + // lack of one of the required tokens - return 0 + return 0; } } - if (requiredTokens.size() > 0) { + /*if (requiredTokens.size() > 0) { // there is at least one requirted token and it has been found return true; - } + }*/ for (int i = 0; i < requestTokens.size(); i++) { - if (content.indexOf(requestTokens.get(i)) != -1) { + int fromIndex = 0; + + while ((fromIndex = content.indexOf(requestTokens.get(i), fromIndex+1)) != -1) { // found at least one required token - return true; + score++; } } - // didn't found anything that fits - return false; + // return counted score + return score; } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceLocal.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceLocal.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceLocal.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -1,9 +1,6 @@ package org.jboss.wiki.management; -import org.jboss.wiki.WikiEngine; public interface WikiServiceLocal { - public WikiEngine getWikiEngine(); - public void setWikiEngine(WikiEngine wikiEngine); } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceMenagement.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceMenagement.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/management/WikiServiceMenagement.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -14,8 +14,6 @@ public WikiEngine getWikiEngine(); - public void setWikiEngine(WikiEngine wikiEngine); - void create() throws Exception; void start() throws Exception; Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/FindResultPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/FindResultPlugin.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/FindResultPlugin.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -1,6 +1,6 @@ package org.jboss.wiki.plugins; -import java.util.Set; +import java.util.Map; import org.jboss.wiki.WikiPage; import org.jboss.wiki.WikiPlugin; @@ -18,16 +18,16 @@ System.err.println(cl); } - Set<String> pages = (Set<String>) wikiSession + Map<String, Integer> pages = (Map<String, Integer>) wikiSession .getAttribute("findResult"); - StringBuilder pageStr = new StringBuilder("!!!__Find results:__\n"); + StringBuilder pageStr = new StringBuilder("!!!__Find results:__\n\\\\\n\\\\\n").append("|__Page__|__Score__\n"); if (pages.size() == 0) { pageStr.append("''NONE FOUND''"); } else { - for (String p : pages) { - pageStr.append("[").append(p).append("]").append("\\\\\n"); + for (String p : pages.keySet()) { + pageStr.append("|[").append(p).append("]|").append(pages.get(p)).append("\n"); } } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/RSSPlugin.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -1,6 +1,5 @@ package org.jboss.wiki.plugins; -import java.io.File; import java.io.IOException; import java.io.StringWriter; import java.io.Writer; @@ -9,50 +8,46 @@ import org.jboss.wiki.WikiPage; -import de.nava.informa.core.ChannelExporterIF; -import de.nava.informa.core.ChannelIF; -import de.nava.informa.core.ItemIF; -import de.nava.informa.exporters.RSS_2_0_Exporter; -import de.nava.informa.impl.basic.ChannelBuilder; import org.jboss.wiki.WikiPlugin; import org.jboss.wiki.WikiSession; public class RSSPlugin extends WikiPlugin { + private void addItem(StringBuilder rssFeed, String title, String link, + String description) { + rssFeed.append("<item>\n"); + rssFeed.append("<title>").append(title).append("</title>\n"); + rssFeed.append("<link>").append(link).append("</link>\n"); + rssFeed.append("<description>").append(description).append( + "</description>\n"); + rssFeed.append("</item>\n"); + } + @Override public WikiPage process(WikiPage wikiPage, WikiSession wikiSession) { - - String chanName = wikiPage.getName()+" change feed"; - Writer writer = new StringWriter(); - - ChannelBuilder builder = new ChannelBuilder(); - - ChannelIF channel = builder.createChannel(chanName); - channel.setDescription("Test Channel: " + chanName); - try { - ItemIF item1 = builder.createItem(channel, "Item 1 for " + chanName, - "First in line", new URL("http://sf.net/rss2_projnews.php?group_id=52620")); - ItemIF item2 = builder.createItem(channel, "Item 2 for " + chanName, - "Second in line", new URL("http://sf.net/export/rss2_projfiles.php?group_id=52620")); - - channel.addItem(item1); channel.addItem(item2); - + StringBuilder rssFeed = new StringBuilder( + "<!-- name=\"generator\" content=\"JBoss Wiki RSSPlugin\" -->\n"); + rssFeed.append("<rss version=\"0.92\">\n"); + rssFeed.append("<channel>\n"); + rssFeed.append("<title>JBoss Forge Wiki</title>\n"); + rssFeed.append("<link>" + (String) wikiSession.getAttribute("hostURL") + + "/wiki/" + wikiPage.getName() + "</link>\n"); + rssFeed.append("<description>JBoss Wiki: " + wikiPage.getName() + + "</description>\n"); + rssFeed.append("<language>en</language>\n"); + + for (int i = wikiPage.getLastVersion(); i > 0; i--) { + addItem(rssFeed, wikiPage.getName() + " rev: " + i, + (String) wikiSession.getAttribute("hostURL") + + getProperty("wikiHome").replaceAll("&", "&") + + "&page=" + wikiPage.getName() + "&version=" + i, + wikiPage.getPageAtVersion(true, i).getPageContent()); } - catch (MalformedURLException e) { - System.err.println(e); - } + + rssFeed.append("</channel>\n</rss>\n"); - try { - ChannelExporterIF exporter = new RSS_2_0_Exporter(writer, "utf8"); -// assuming you have a ChannelIF object available as channel - exporter.write(channel); - } - catch (IOException e) { - System.err.println(e); - } + wikiPage.setPageContent(rssFeed.toString()); - wikiPage.setPageContent(((StringWriter)writer).toString()+wikiPage.getContent()); - return wikiPage; } Modified: trunk/forge/portal-extensions/jbosswiki/wiki-management/project.xml =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-management/project.xml 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-management/project.xml 2005-09-13 22:55:19 UTC (rev 1106) @@ -87,12 +87,6 @@ </dependency> <dependency> - <groupId>informa</groupId> - <artifactId>informa</artifactId> - <version>0.6.0</version> - </dependency> - - <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.6</version> Modified: trunk/forge/portal-extensions/jbosswiki/wiki-management/src/java/org/jboss/wiki/management/WikiService.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-management/src/java/org/jboss/wiki/management/WikiService.java 2005-09-13 21:49:12 UTC (rev 1105) +++ trunk/forge/portal-extensions/jbosswiki/wiki-management/src/java/org/jboss/wiki/management/WikiService.java 2005-09-13 22:55:19 UTC (rev 1106) @@ -12,14 +12,13 @@ public class WikiService implements WikiServiceLocal, WikiServiceRemote, WikiServiceMenagement { WikiEngine wikiEngine; - public WikiEngine getWikiEngine() { + public synchronized WikiEngine getWikiEngine() { + if (wikiEngine == null) { + wikiEngine = new WikiEngine(); + } return wikiEngine; } - public void setWikiEngine(WikiEngine wikiEngine) { - this.wikiEngine = wikiEngine; - } - public void create() throws Exception { System.out.println("WikiService - Creating"); } |
From: <jbo...@li...> - 2005-09-13 21:49:23
|
Author: dam...@jb... Date: 2005-09-13 17:49:12 -0400 (Tue, 13 Sep 2005) New Revision: 1105 Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml Log: Reverted Adam's changes to the http scheme... not sure why, but there's an NPE on these mods.... To put these changes back in: svn merge -r 1103:1104 tps://svn.labs.jboss.com/trunk/forge/portal-extensions/forge-blog . Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-13 20:43:49 UTC (rev 1104) +++ trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-13 21:49:12 UTC (rev 1105) @@ -88,8 +88,6 @@ feedAddress = replaceProperty(feedAddress, "${host.address}", request .getServerName()); - feedAddress = replaceProperty(feedAddress, "${scheme.name}", request - .getScheme()); feedAddress = replaceProperty(feedAddress, "${host.port}", Integer .toString(request.getServerPort())); if (projectId != null) @@ -103,8 +101,6 @@ .getServerName()); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.port}", Integer .toString(request.getServerPort())); - remoteFeedAddress = replaceProperty(remoteFeedAddress, "${scheme.name}", request - .getScheme()); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${project.name}", projectId); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${portal.name}", portalName); String feedTypeFreeAddress = remoteFeedAddress; Modified: trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-13 20:43:49 UTC (rev 1104) +++ trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-13 21:49:12 UTC (rev 1105) @@ -29,12 +29,12 @@ <init-param> <description>Address of the blog's local feed.</description> <name>feedAddress</name> - <value>${scheme.name}://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> + <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <init-param> <description>Address of the blog's remote feed.</description> <name>remoteFeedAddress</name> - <value>${scheme.name}://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> + <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <portlet-info> <title>JBoss Blog Portlet</title> |
From: <jbo...@li...> - 2005-09-13 20:44:02
|
Author: adamw Date: 2005-09-13 16:43:49 -0400 (Tue, 13 Sep 2005) New Revision: 1104 Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml Log: Blog scheme fix Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-13 20:43:18 UTC (rev 1103) +++ trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-13 20:43:49 UTC (rev 1104) @@ -88,6 +88,8 @@ feedAddress = replaceProperty(feedAddress, "${host.address}", request .getServerName()); + feedAddress = replaceProperty(feedAddress, "${scheme.name}", request + .getScheme()); feedAddress = replaceProperty(feedAddress, "${host.port}", Integer .toString(request.getServerPort())); if (projectId != null) @@ -101,6 +103,8 @@ .getServerName()); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.port}", Integer .toString(request.getServerPort())); + remoteFeedAddress = replaceProperty(remoteFeedAddress, "${scheme.name}", request + .getScheme()); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${project.name}", projectId); remoteFeedAddress = replaceProperty(remoteFeedAddress, "${portal.name}", portalName); String feedTypeFreeAddress = remoteFeedAddress; Modified: trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-13 20:43:18 UTC (rev 1103) +++ trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-13 20:43:49 UTC (rev 1104) @@ -29,12 +29,12 @@ <init-param> <description>Address of the blog's local feed.</description> <name>feedAddress</name> - <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> + <value>${scheme.name}://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <init-param> <description>Address of the blog's remote feed.</description> <name>remoteFeedAddress</name> - <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> + <value>${scheme.name}://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <portlet-info> <title>JBoss Blog Portlet</title> |
From: <jbo...@li...> - 2005-09-13 20:43:28
|
Author: soh...@jb... Date: 2005-09-13 16:43:18 -0400 (Tue, 13 Sep 2005) New Revision: 1103 Modified: trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java Log: fixed the nullpointer exception when session is started with https request Modified: trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java =================================================================== --- trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java 2005-09-13 20:08:39 UTC (rev 1102) +++ trunk/forge/portal-extensions/forge-portal-attr/src/java/org/jboss/forge/portal/SSLProcessor.java 2005-09-13 20:43:18 UTC (rev 1103) @@ -43,15 +43,18 @@ if(this.isSwitchFromSSLNeeded(requestURL)) { Integer plainPort = (Integer)httpRequest.getSession().getAttribute("http"); - String relativeURL = HttpUtils.getRelativeURL(requestURL); - String plainURL = HttpUtils. - getPlainURL(httpRequest,plainPort.intValue()); - - //perform the switch from ssl to regular mode - String url = plainURL + "/" + relativeURL; - httpResponse.setContentType("text/html"); - httpResponse.sendRedirect(url); - return; + if(plainPort!=null) + { + String relativeURL = HttpUtils.getRelativeURL(requestURL); + String plainURL = HttpUtils. + getPlainURL(httpRequest,plainPort.intValue()); + + //perform the switch from ssl to regular mode + String url = plainURL + "/" + relativeURL; + httpResponse.setContentType("text/html"); + httpResponse.sendRedirect(url); + return; + } } } else @@ -60,15 +63,18 @@ if(this.isSwitchToSSLNeeded(requestURL)) { Integer sslPort = (Integer)httpRequest.getSession().getAttribute("https"); - String relativeURL = HttpUtils.getRelativeURL(requestURL); - String sslURL = HttpUtils. - getSecureURL(httpRequest,sslPort.intValue()); - - //perform the switch from regular to ssl-mode - String url = sslURL + "/" + relativeURL; - httpResponse.setContentType("text/html"); - httpResponse.sendRedirect(url); - return; + if(sslPort!=null) + { + String relativeURL = HttpUtils.getRelativeURL(requestURL); + String sslURL = HttpUtils. + getSecureURL(httpRequest,sslPort.intValue()); + + //perform the switch from regular to ssl-mode + String url = sslURL + "/" + relativeURL; + httpResponse.setContentType("text/html"); + httpResponse.sendRedirect(url); + return; + } } } } @@ -114,15 +120,22 @@ Integer sslPort = (Integer)request.getSession().getAttribute("https"); Integer plainPort = (Integer)request.getSession().getAttribute("http"); if(sslPort==null || plainPort==null) - { - Integer port = new Integer(request.getServerPort()); + { if(request.isSecure()) { - request.getSession().setAttribute("https",port); + if(sslPort==null) + { + Integer port = new Integer(request.getServerPort()); + request.getSession().setAttribute("https",port); + } } else { - request.getSession().setAttribute("http",port); + if(plainPort==null) + { + Integer port = new Integer(request.getServerPort()); + request.getSession().setAttribute("http",port); + } } } } |
From: <jbo...@li...> - 2005-09-13 19:48:07
|
Author: dam...@jb... Date: 2005-09-13 15:48:03 -0400 (Tue, 13 Sep 2005) New Revision: 1101 Modified: trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java Log: BEEEAAAAAAAAHHHUUTIFIED Modified: trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java =================================================================== --- trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java 2005-09-13 19:31:05 UTC (rev 1100) +++ trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java 2005-09-13 19:48:03 UTC (rev 1101) @@ -1,294 +1,254 @@ -/***************************************** - * * - * JBoss Portal: The OpenSource Portal * - * * - * Distributable under LGPL license. * - * See terms of license at gnu.org. * - * * - *****************************************/ -package org.jboss.portal.core.security.jaas; - -import java.security.Principal; -import java.security.acl.Group; -import java.util.*; - -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.security.auth.Subject; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.login.LoginException; -import javax.transaction.TransactionManager; - -import org.jboss.portal.core.modules.*; -import org.jboss.portal.core.model.Role; -import org.jboss.portal.core.model.User; -import org.jboss.portal.core.portlet.user.UserPortletConstants; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.Statement; -import java.sql.ResultSet; - -import org.jboss.portal.common.transaction.Transactions; -import org.jboss.security.SimpleGroup; -import org.jboss.security.auth.spi.UsernamePasswordLoginModule; -import org.hibernate.SessionFactory; -import org.hibernate.Session; -import org.hibernate.HibernateException; -import org.hibernate.Query; - -import org.jboss.portal.common.util.Tools; - - -/** - * A login module that use hibernate as underlying operational environment modified to take passwords from JBoss main db - * - * @author <a href="mailto:ju...@jb...">Julien Viet and Tomasz Szymanski</a> - * @version $Revision: 1.6 $ - */ -public class ForgeHibernateLoginModule - extends UsernamePasswordLoginModule -{ - - protected String factoryJNDIName; - protected String principalsQuery; - protected String rolesQuery; - protected String additionalRole; - protected String jbossDB; - - public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) - { - super.initialize(subject, callbackHandler, sharedState, options); - - // Get data - factoryJNDIName = (String)options.get("factoryJNDIName"); - principalsQuery = (String)options.get("principalsQuery"); - rolesQuery = (String)options.get("rolesQuery"); - additionalRole = (String)options.get("additionalRole"); - jbossDB = (String)options.get("jbossdb"); - // Some info - log.trace("factoryJNDIName = " + factoryJNDIName); - log.trace("principalsQuery = " + principalsQuery); - log.trace("rolesQuery = " + rolesQuery); - log.trace("additionalRole = " + additionalRole); - } - - private SessionFactory factory; - - private Session getSession() throws HibernateException, IllegalStateException, NamingException - { - if (factory == null) - { - factory = (SessionFactory)new InitialContext().lookup(factoryJNDIName); - } - return factory.getCurrentSession(); - } - - protected String getUsersPassword() throws LoginException - { - try - { - TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager"); - return (String)Transactions.required(tm, new Transactions.Runnable() - { - public Object run() throws Exception - { - Session session = null; - String password = null; - try - { - UserModule userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME); - RoleModule roleModule = (RoleModule)new InitialContext().lookup(ModuleConstants.ROLEMODULE_JNDINAME); - - session = getSession(); - - Query query = session.createQuery(principalsQuery); - query.setString("username", getUsername()); - - password = (String)query.uniqueResult(); - - - if (password == null) { - try { - /* take password from jboss database and update forge db with pass and user */ - - DataSource ds = (DataSource)new InitialContext().lookup(jbossDB); - - Connection conn = ds.getConnection(); - - Statement st = conn.createStatement(); - - log.info("Looking for the user "+getUsername()+" in the JBoss Database"); - - String sql = "SELECT * FROM nuke_users WHERE pn_uname='"+getUsername()+"';"; - - ResultSet rs = st.executeQuery(sql); - - - if (rs.next()) { - log.info("User "+getUsername()+" found in the JBoss Database."); - try - { - System.out.println("Taking pass for user "+getUsername()); - - User user = userModule.createUser(getUsername(), rs.getString("pn_pass"), rs.getString("pn_email")); - user.setFakeEmail(rs.getString("pn_femail")); - - //user.setRegistrationDate(new Date()); - String subscriptionMode = UserPortletConstants.SUBSCRIPTIONMODE_AUTOMATIC; - - user.setEnabled(true); - - log.info("User "+getUsername()+" added to Labs Database."); - - // Add the user to the default user role - String defaultRole = "User";//getPortletConfig().getInitParameter(UserPortletConstants.DEFAULT_ROLE); - if (defaultRole != null) - { - Set roleSet = new HashSet(); - Role role = roleModule.findRoleByName(defaultRole); - if (role != null) - { - roleSet.add(role); - user.setRoles(roleSet); - } - else - { - log.error("The role you specified as default role does not exist, check your portlet configuration"); - } - } - else - { - log.info("You didn't specify a default role in the portlet init configuration, please refer to the documentation"); - } - } - catch (IllegalArgumentException e) - { - log.error("Cannot create user " + getUsername(), e); - } - catch (ModuleException e) - { - log.error("Cannot create user " + getUsername(), e); - } - - password = rs.getString("pn_pass"); - - } - else { - log.info("User "+getUsername()+" couldn't been found in the JBoss Database."); - } - conn.close(); - } - catch(Exception e) { - System.err.println(e); - } - } - else if (getUsername().compareTo("admin") != 0) { - /* check if password in the main db changed (not for admin account)*/ - try { - DataSource ds = (DataSource)new InitialContext().lookup(jbossDB); - - Connection conn = ds.getConnection(); - - Statement st = conn.createStatement(); - - String sql = "SELECT * FROM nuke_users WHERE pn_uname='"+getUsername()+"';"; - - ResultSet rs = st.executeQuery(sql); - - if (rs.next()) { - if (password != rs.getString("pn_pass")) { - User user = userModule.findUserByUserName(getUsername()); - user.setPassword(rs.getString("pn_pass")); - password = rs.getString("pn_pass"); - } - - } - - conn.close(); - } - catch (Exception e) { - throw new LoginException(e.toString()); - } - } - } - catch (Exception e) - { - throw new LoginException(e.toString()); - } - return password; - } - }); - } - catch (Exception e) - { - Throwable cause = e.getCause(); - throw new LoginException(cause.toString()); - } - } - - protected Group[] getRoleSets() throws LoginException - { - try - { - TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager"); - return (Group[])Transactions.required(tm, new Transactions.Runnable() - { - public Object run() throws Exception - { - Group[] roleSets = null; - Session session = null; - try - { - session = getSession(); - Query query = session.createQuery(rolesQuery); - query.setString("username", getUsername()); - - Group rolesGroup = new SimpleGroup("Roles"); - rolesGroup.addMember(ForgeHibernateLoginModule.this.createIdentity(additionalRole)); - HashMap setsMap = new HashMap(); - setsMap.put("Roles", rolesGroup); - - for (Iterator iterator = query.iterate(); iterator.hasNext();) - { - String name = (String)iterator.next(); - String groupName = "Roles"; - - Group group = (Group)setsMap.get(groupName); - if (group == null) - { - group = new SimpleGroup(groupName); - setsMap.put(groupName, group); - } - - try - { - Principal p = ForgeHibernateLoginModule.this.createIdentity(name); - group.addMember(p); - } - catch (Exception e) - { - log.debug("Failed to create principal " + name, e); - } - } - - roleSets = new Group[setsMap.size()]; - setsMap.values().toArray(roleSets); - } - catch (Exception e) - { - throw new LoginException(e.toString()); - } - return roleSets; - } - }); - } - catch (Exception e) - { - Throwable cause = e.getCause(); - throw new LoginException(cause.toString()); - } - - } - -} +/***************************************** + * * + * JBoss Portal: The OpenSource Portal * + * * + * Distributable under LGPL license. * + * See terms of license at gnu.org. * + * * + *****************************************/ +package org.jboss.portal.core.security.jaas; + +import java.security.Principal; +import java.security.acl.Group; +import java.util.*; + +import javax.naming.InitialContext; +import javax.naming.NamingException; +import javax.security.auth.Subject; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.login.LoginException; +import javax.transaction.TransactionManager; + +import org.jboss.portal.core.modules.*; +import org.jboss.portal.core.model.Role; +import org.jboss.portal.core.model.User; +import org.jboss.portal.core.portlet.user.UserPortletConstants; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.Statement; +import java.sql.ResultSet; + +import org.jboss.portal.common.transaction.Transactions; +import org.jboss.security.SimpleGroup; +import org.jboss.security.auth.spi.UsernamePasswordLoginModule; +import org.hibernate.SessionFactory; +import org.hibernate.Session; +import org.hibernate.HibernateException; +import org.hibernate.Query; + +import org.jboss.portal.common.util.Tools; + + +/** + * A login module that use hibernate as underlying operational environment modified to take passwords from JBoss main db + * + * @author <a href="mailto:ju...@jb...">Julien Viet and Tomasz Szymanski</a> + * @version $Revision: 1.6 $ + */ +public class ForgeHibernateLoginModule + extends UsernamePasswordLoginModule { + + protected String factoryJNDIName; + protected String principalsQuery; + protected String rolesQuery; + protected String additionalRole; + protected String jbossDB; + + public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { + super.initialize(subject, callbackHandler, sharedState, options); + + // Get data + factoryJNDIName = (String)options.get("factoryJNDIName"); + principalsQuery = (String)options.get("principalsQuery"); + rolesQuery = (String)options.get("rolesQuery"); + additionalRole = (String)options.get("additionalRole"); + jbossDB = (String)options.get("jbossdb"); + // Some info + log.trace("factoryJNDIName = " + factoryJNDIName); + log.trace("principalsQuery = " + principalsQuery); + log.trace("rolesQuery = " + rolesQuery); + log.trace("additionalRole = " + additionalRole); + } + + private SessionFactory factory; + + private Session getSession() throws HibernateException, IllegalStateException, NamingException { + if (factory == null) { + factory = (SessionFactory)new InitialContext().lookup(factoryJNDIName); + } + return factory.getCurrentSession(); + } + + protected String getUsersPassword() throws LoginException { + try { + TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager"); + return (String)Transactions.required(tm, new Transactions.Runnable() { + public Object run() throws Exception { + Session session = null; + String password = null; + try { + UserModule userModule = (UserModule)new InitialContext().lookup(ModuleConstants.USERMODULE_JNDINAME); + RoleModule roleModule = (RoleModule)new InitialContext().lookup(ModuleConstants.ROLEMODULE_JNDINAME); + + session = getSession(); + + Query query = session.createQuery(principalsQuery); + query.setString("username", getUsername()); + + password = (String)query.uniqueResult(); + + + if (password == null) { + try { + /* take password from jboss database and update forge db with pass and user */ + + DataSource ds = (DataSource)new InitialContext().lookup(jbossDB); + + Connection conn = ds.getConnection(); + + Statement st = conn.createStatement(); + + log.info("Looking for the user "+getUsername()+" in the JBoss Database"); + + String sql = "SELECT * FROM nuke_users WHERE pn_uname='"+getUsername()+"';"; + + ResultSet rs = st.executeQuery(sql); + + + if (rs.next()) { + log.info("User "+getUsername()+" found in the JBoss Database."); + try { + System.out.println("Taking pass for user "+getUsername()); + + User user = userModule.createUser(getUsername(), rs.getString("pn_pass"), rs.getString("pn_email")); + user.setFakeEmail(rs.getString("pn_femail")); + + //user.setRegistrationDate(new Date()); + String subscriptionMode = UserPortletConstants.SUBSCRIPTIONMODE_AUTOMATIC; + + user.setEnabled(true); + + log.info("User "+getUsername()+" added to Labs Database."); + + // Add the user to the default user role + String defaultRole = "User";//getPortletConfig().getInitParameter(UserPortletConstants.DEFAULT_ROLE); + if (defaultRole != null) { + Set roleSet = new HashSet(); + Role role = roleModule.findRoleByName(defaultRole); + if (role != null) { + roleSet.add(role); + user.setRoles(roleSet); + } else { + log.error("The role you specified as default role does not exist, check your portlet configuration"); + } + } else { + log.info("You didn't specify a default role in the portlet init configuration, please refer to the documentation"); + } + } catch (IllegalArgumentException e) { + log.error("Cannot create user " + getUsername(), e); + } catch (ModuleException e) { + log.error("Cannot create user " + getUsername(), e); + } + + password = rs.getString("pn_pass"); + + } else { + log.info("User "+getUsername()+" couldn't been found in the JBoss Database."); + } + conn.close(); + } catch(Exception e) { + System.err.println(e); + } + } else if (getUsername().compareTo("admin") != 0) { + /* check if password in the main db changed (not for admin account)*/ + try { + DataSource ds = (DataSource)new InitialContext().lookup(jbossDB); + + Connection conn = ds.getConnection(); + + Statement st = conn.createStatement(); + + String sql = "SELECT * FROM nuke_users WHERE pn_uname='"+getUsername()+"';"; + + ResultSet rs = st.executeQuery(sql); + + if (rs.next()) { + if (password != rs.getString("pn_pass")) { + User user = userModule.findUserByUserName(getUsername()); + user.setPassword(rs.getString("pn_pass")); + password = rs.getString("pn_pass"); + } + + } + + conn.close(); + } catch (Exception e) { + throw new LoginException(e.toString()); + } + } + } catch (Exception e) { + throw new LoginException(e.toString()); + } + return password; + } + } + ); + } catch (Exception e) { + Throwable cause = e.getCause(); + throw new LoginException(cause.toString()); + } + } + + protected Group[] getRoleSets() throws LoginException { + try { + TransactionManager tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager"); + return (Group[])Transactions.required(tm, new Transactions.Runnable() { + public Object run() throws Exception { + Group[] roleSets = null; + Session session = null; + try { + session = getSession(); + Query query = session.createQuery(rolesQuery); + query.setString("username", getUsername()); + + Group rolesGroup = new SimpleGroup("Roles"); + rolesGroup.addMember(ForgeHibernateLoginModule.this.createIdentity(additionalRole)); + HashMap setsMap = new HashMap(); + setsMap.put("Roles", rolesGroup); + + for (Iterator iterator = query.iterate(); iterator.hasNext();) { + String name = (String)iterator.next(); + String groupName = "Roles"; + + Group group = (Group)setsMap.get(groupName); + if (group == null) { + group = new SimpleGroup(groupName); + setsMap.put(groupName, group); + } + + try { + Principal p = ForgeHibernateLoginModule.this.createIdentity(name); + group.addMember(p); + } catch (Exception e) { + log.debug("Failed to create principal " + name, e); + } + } + + roleSets = new Group[setsMap.size()]; + setsMap.values().toArray(roleSets); + } catch (Exception e) { + throw new LoginException(e.toString()); + } + return roleSets; + } + } + ); + } catch (Exception e) { + Throwable cause = e.getCause(); + throw new LoginException(cause.toString()); + } + + } + +} |
From: <jbo...@li...> - 2005-09-13 19:31:11
|
Author: szimano Date: 2005-09-13 15:31:05 -0400 (Tue, 13 Sep 2005) New Revision: 1100 Modified: trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java Log: added some logs to login module Modified: trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java =================================================================== --- trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java 2005-09-13 19:22:47 UTC (rev 1099) +++ trunk/forge/portal-extensions/forge-login/src/java/org/jboss/portal/core/security/jass/ForgeHibernateLoginModule.java 2005-09-13 19:31:05 UTC (rev 1100) @@ -118,12 +118,15 @@ Statement st = conn.createStatement(); + log.info("Looking for the user "+getUsername()+" in the JBoss Database"); + String sql = "SELECT * FROM nuke_users WHERE pn_uname='"+getUsername()+"';"; ResultSet rs = st.executeQuery(sql); if (rs.next()) { + log.info("User "+getUsername()+" found in the JBoss Database."); try { System.out.println("Taking pass for user "+getUsername()); @@ -136,6 +139,8 @@ user.setEnabled(true); + log.info("User "+getUsername()+" added to Labs Database."); + // Add the user to the default user role String defaultRole = "User";//getPortletConfig().getInitParameter(UserPortletConstants.DEFAULT_ROLE); if (defaultRole != null) @@ -169,7 +174,9 @@ password = rs.getString("pn_pass"); } - + else { + log.info("User "+getUsername()+" couldn't been found in the JBoss Database."); + } conn.close(); } catch(Exception e) { |
From: <jbo...@li...> - 2005-09-13 19:22:55
|
Author: adamw Date: 2005-09-13 15:22:47 -0400 (Tue, 13 Sep 2005) New Revision: 1099 Modified: trunk/forge/portal-extensions/forge-kosmos/changes trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_activity_details.jsp trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp Log: JBLAB-381: Cosmetic changes TODO: add portlet css to forge pages Modified: trunk/forge/portal-extensions/forge-kosmos/changes =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/changes 2005-09-13 18:05:51 UTC (rev 1098) +++ trunk/forge/portal-extensions/forge-kosmos/changes 2005-09-13 19:22:47 UTC (rev 1099) @@ -1,6 +1,4 @@ -The only changes are in the: -kosmos-server/src/java/hu/midori/kosmos/server/AbstractCosmosService.java -file. - -- HttpUrl is replaced by HttpsUrl -- making the directories is commented out \ No newline at end of file +Changes are in: +- kosmos-server/src/java/hu/midori/kosmos/server/AbstractCosmosService.java +- kosmos-server/src/java/hu/midori/kosmos/server/util/ChartUrils.java +- svn jsps - added a "back" from help mode, commented out "LAST 8 MODIFICATIONS HERE" Modified: trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_activity_details.jsp =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_activity_details.jsp 2005-09-13 18:05:51 UTC (rev 1098) +++ trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_activity_details.jsp 2005-09-13 19:22:47 UTC (rev 1099) @@ -24,7 +24,7 @@ <td><fmt:message key="svnrepository.commitHistory"/>:</td> <td><img src="<c:out value="${repository.commitsPerWeekChartUrl}"/>" title="<fmt:message key="svnrepository.commitHistory"/>"/></td> <td valign="top"> - TODO LATEST 8 MODIFICATIONS COME HERE + <!-- TODO LATEST 8 MODIFICATIONS COME HERE --> </td> </tr> <%@include file="includes/table_footer.jsp"%> Modified: trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp 2005-09-13 18:05:51 UTC (rev 1098) +++ trunk/forge/portal-extensions/forge-kosmos/kosmos-portlet/web-portlet/pages/svn_monitoring_help.jsp 2005-09-13 19:22:47 UTC (rev 1099) @@ -9,3 +9,5 @@ <%@include file="includes/legend.jsp"%> <%@include file="includes/about.jsp"%> + +<a href="<portlet:renderURL/>">Back</a> |
From: <jbo...@li...> - 2005-09-13 18:06:13
|
Author: adamw Date: 2005-09-13 14:05:51 -0400 (Tue, 13 Sep 2005) New Revision: 1098 Added: trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/ trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/ trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/jstl.jar trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/standard.jar Modified: trunk/forge/portal-extensions/forge-navigation/project.xml trunk/forge/portal-extensions/forge-navigation/src/java/org/jbosslabs/portlet/navigation/NavigationPortlet.java trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/common.css trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/print.css trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/screen.css Log: JBLAB-384: Project menu in-lined Added: trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/jstl.jar =================================================================== (Binary files differ) Property changes on: trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/jstl.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/standard.jar =================================================================== (Binary files differ) Property changes on: trunk/forge/portal-extensions/binaries/maven-repo-addons/taglibs/jars/standard.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/forge/portal-extensions/forge-navigation/project.xml =================================================================== --- trunk/forge/portal-extensions/forge-navigation/project.xml 2005-09-13 15:31:30 UTC (rev 1097) +++ trunk/forge/portal-extensions/forge-navigation/project.xml 2005-09-13 18:05:51 UTC (rev 1098) @@ -36,5 +36,25 @@ <artifactId>forge-common</artifactId> <version>1.0</version> </dependency> + + <dependency> + <groupId>taglibs</groupId> + <artifactId>jstl</artifactId> + <version>1.0</version> + <jar>jstl.jar</jar> + <properties> + <war.bundle>true</war.bundle> + </properties> + </dependency> + + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.0</version> + <jar>standard.jar</jar> + <properties> + <war.bundle>true</war.bundle> + </properties> + </dependency> </dependencies> </project> Modified: trunk/forge/portal-extensions/forge-navigation/src/java/org/jbosslabs/portlet/navigation/NavigationPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-navigation/src/java/org/jbosslabs/portlet/navigation/NavigationPortlet.java 2005-09-13 15:31:30 UTC (rev 1097) +++ trunk/forge/portal-extensions/forge-navigation/src/java/org/jbosslabs/portlet/navigation/NavigationPortlet.java 2005-09-13 18:05:51 UTC (rev 1098) @@ -27,16 +27,10 @@ public class NavigationPortlet extends JBossPortlet { private final static String MAIN_JSP = "navigation/main.jsp"; - private final static String PROJECT_JSP = "navigation/project.jsp"; - - private final static String FOOTER_JSP = "navigation/footer.jsp"; - public void doView(JBossRenderRequest request, JBossRenderResponse response) throws IOException, PortletException { response.setContentType("text/html"); - String projectId = ProjectsHelper.getSelectedProjectId(request); - String portalName = ForgeHelper.getPortalName(request); Projects projects = ProjectsHelper.getProjects(portalName); @@ -63,19 +57,5 @@ rd = getPortletContext().getRequestDispatcher( ForgeHelper.createRepoAccessPath(portalName, MAIN_JSP)); rd.include(request, response); - - if (projectId != null) { - context = projects.getProjectContext(pc, projectId); - request.setAttribute(PortalJsp.CTX_REQUEST, context); - request.setAttribute(ProjectsHelper.PROJECT_NAME, projects - .getProjectName(projectId)); - rd = getPortletContext().getRequestDispatcher( - ForgeHelper.createRepoAccessPath(portalName, PROJECT_JSP)); - rd.include(request, response); - } - - rd = getPortletContext().getRequestDispatcher( - ForgeHelper.createRepoAccessPath(portalName, FOOTER_JSP)); - rd.include(request, response); } } \ No newline at end of file Modified: trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/common.css =================================================================== --- trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/common.css 2005-09-13 15:31:30 UTC (rev 1097) +++ trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/common.css 2005-09-13 18:05:51 UTC (rev 1098) @@ -1,15 +1,15 @@ -/* some of the things need to be cleaned not needed for portal */ - body { font: 11px Helvetica, Arial, sans-serif; } -a:link { color: #005EB6; } -a:active { color: #666666; } -a:visited { color: #888888; } +a:link { color: #005EB6; text-decoration: none; } +a:active { color: #666666; text-decoration: none; } +a:visited { color: #005EB6/*#888888*/; text-decoration: none; } a:hover { } h1 { color: #000000; line-height: 22px; font: 20px Helvetica, Arial, sans-serif; } -h2 { color: #000000; line-height: 18px; font: 16px Helvetica, Arial, sans-serif; margin-top: 16px; } -h3 { color: #000000; line-height: 13px; font: bold 12px Helvetica, Arial, sans-serif; margin-top: 8px; } +h2 { color: #000000; line-height: 18px; font: bold 16px Helvetica, Arial, sans-serif; margin-top: 16px; } +h3 { color: #000000; line-height: 16px; font: bold 14px Helvetica, Arial, sans-serif; margin-top: 8px; } +h4 { color: #000000; line-height: 16px; font: 14px Helvetica, Arial, sans-serif; margin-top: 8px; } +h5 { color: #000000; line-height: 14px; font: 12px Helvetica, Arial, sans-serif; margin-top: 8px; } strong { font-weight: bold; } em { font-style: italic; } @@ -17,12 +17,13 @@ p { line-height: 150%; } pre { font-family: Andale Mono, Courier New, Courier, monospace; } - hr { color: #6e6e6e; } +dl {} +dl dt { font-weight: bold; } +dl dd { margin-top: 10px; margin-bottom: 20px; margin-left: 20px;} - /* FOOTER ----------------------------------------------*/ #PageFooter #Copyright { font: 9px Verdana, Helvetica, Arial, sans-serif;} #PageFooter a { color: #0044AA; } @@ -42,7 +43,18 @@ .infotable td { padding: 5px; background-color: #efefef; color: #000000; font: 11px Helvetica, Arial, sans-serif; } .infotable th { padding: 5px; background-color: #efefef; color: white; font: bold 13px Helvetica, Arial, sans-serif; } +table.infotable2 {} +table.infotable2 td { padding: 10px 10px 10px 10px; background-color: #eaeaea; border-top: solid 1px #777777; line-height: 150% } +table.infotable2 td:first-child { padding-top: 15px; padding-right: 20px; background-color: transparent; } +table.infotable2 p { padding: 10px; } +table.infotable2 p:first-child { padding-top: 0px; } +table.infotable2 table {border-bottom: none;} +table.infotable2 table td, table.infotable2 table td:first-child { padding: 5px; background-color: transparent; border: none; line-height: 100% } +table.infotable2 table p, table.infotable2 table p:first-child { padding: 0px; } +table.infotable2 h2 {margin: 0px;} + + /* DEFINITION TABLE ---------------------------------------*/ .deftable { border-spacing: 5px; text-align: left; color: #ffffff; line-height: 150%; } .deftable .term { border: none; vertical-align: top; padding: 5px; background-color: #aaaaaa; color: #ffffff; font-weight: bold; } @@ -91,7 +103,7 @@ .title { font: 26px Arial, Helvetica, sans-serif; color: #FF9900; text-decoration: none; } .intro { font: 12px Arial, Helvetica, sans-serif; color: #FF9900; text-decoration: none; } .orangeTd { background-color: #FF9900; } -ul { list-style-image: url(../img/reiter/ul.gif); } +ul { list-style-image: url(images/reiter/ul.gif); } h4 { font: 14px Arial, Helvetica, sans-serif; color: #000000; } .url { color: #996600; } Modified: trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/print.css =================================================================== --- trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/print.css 2005-09-13 15:31:30 UTC (rev 1097) +++ trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/print.css 2005-09-13 18:05:51 UTC (rev 1098) @@ -6,6 +6,8 @@ h1 { } h2 { } h3 { } +h4 { } +h5 { } strong { } em { } Modified: trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/screen.css =================================================================== --- trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/screen.css 2005-09-13 15:31:30 UTC (rev 1097) +++ trunk/forge/portal-extensions/forge-theme/jbossForgeLayout.war/screen.css 2005-09-13 18:05:51 UTC (rev 1098) @@ -1,4 +1,4 @@ -body { margin: 0px; padding: 0px; } +body { background-color: white; margin: 0px; padding: 0px; } a:link { text-decoration: none; } a:active { text-decoration: none; } @@ -8,6 +8,8 @@ h1 { } h2 { } h3 { } +h4 { } +h5 { } strong { } em { } @@ -57,11 +59,11 @@ /* BODY ------------------------------------------------*/ -#BodyTable { width: 100%; margin-bottom: 119px; } +#BodyTable { width: 100%; } #BodyTable td { vertical-align: top; } #BodyTable td.topheader { height: 102px; } -#BodyTable td.leftside { width: 219px; } -#BodyTable td.bodycell { font: 11px Verdana, Helvetica, Arial, sans-serif; padding: 0px 30px 0px 0px; } +#BodyTable td.leftside { width: 219px; padding-bottom: 119px; } +#BodyTable td.bodycell { font: 11px Verdana, Helvetica, Arial, sans-serif; padding: 0px 30px 119px 0px; } #ContentContainer { } #ContentContainer h1:first-child { margin-top: 5px; } @@ -69,17 +71,112 @@ /* LEFT MENU -------------------------------------------*/ /*1 10/179/0, 20/166/3, +45 = 226 */ /*2 8/167/0, 18/154/3, +44 = 219 */ +/* deprecated #LeftMenu { margin-right: 44px; border-right: solid 1px white; padding-bottom: 13px; } #LeftMenu ul { padding: 0px; margin: 0px; } #LeftMenu li { list-style: none; } #LeftMenu ul li a { width: 167px; font-weight: bold; padding: 4px 0px 4px 8px; border-top: solid 1px white; } #LeftMenu ul ul li a { width: 154px; font-weight: normal; padding: 3px 3px 3px 18px; border-top: none;} -#LeftMenu ul ul { padding-bottom: 0px; } +#LeftMenu ul ul { padding-bottom: 8px; } #LeftMenu a { display: block; font: 11px Verdana, Helvetica, Arial, sans-serif; text-decoration: none; } #LeftMenu a:link, #LeftMenu a:visited { color: #ffffff; } #LeftMenu a:hover { background-color: #cccccc; color: #000000; } +*/ +/* core */ +#LeftMenu { margin-right: 44px; padding-bottom: 13px; } +#LeftMenu li { list-style: none; font: 11px Verdana, Helvetica, Arial, sans-serif; } +#LeftMenu a { display: block; text-decoration: none; color: #ffffff;} +/* 1st level */ +#LeftMenu ul { + padding: 0px; + margin: 0px; +} +#LeftMenu ul li { + border-top: solid 1px white; +} +#LeftMenu ul li a { + width: 167px; + padding: 4px 0px 4px 8px; + /* 0 + 8 + 167 = 175px */ + font-weight: bold; +} +#LeftMenu ul li a:hover { + background-color: #cccccc; + color: black; +} +#LeftMenu ul li.current { + background-color: #cccccc; +} +#LeftMenu ul li.current a { + color: black; +} +#LeftMenu ul li.current a:hover { + background-color: #F0F0F0; +} + + +/* 2nd level */ +#LeftMenu ul li ul { + padding: 0px 0px 8px 0px; + margin: 0px; +} +#LeftMenu ul li ul li { + border-top: none; +} +#LeftMenu ul li ul li a { + width: 154px; + padding: 3px 3px 3px 18px; + /* 3 + 18 + 154 = 175px */ + color: white; + font-weight: normal; +} +#LeftMenu ul li ul li a:hover { + background-color: #cccccc; +} +#LeftMenu ul li.current ul li a:hover { + background-color: #F0F0F0; +} +#LeftMenu ul li.current ul li.current { + margin: 3px 10px 3px 10px; + background-color: #F0F0F0; +} +#LeftMenu ul li.current ul li.current a { + padding: 5px 3px 2px 8px; + width: 144px; + /* 3 + 8 + 144 + 10 + 10 = 175px */ + color: black; + font-weight: bold; + font-size: 10px; +} +#LeftMenu ul li ul li.current a:hover { + text-decoration: underline; +} + +/* 3rd level */ +#LeftMenu ul li.current ul li.current ul { + padding: 5px; + margin-left: 20px; +} +#LeftMenu ul li.current ul li.current ul li { + border-top: none; + list-style: square; +} +#LeftMenu ul li.current ul li.current ul li a { + padding: 3px 3px 3px 3px; + width: 119px; + /* 3 + 3 + 5 + 25 + 10 + 10 = 56 - 175px = 119 */ + color: black; + font-weight: normal; + font-size: 10px; +} +#LeftMenu ul li.current ul li.current ul li a:hover { + text-decoration: underline; +} + + + /* ADS ------------------------------------------------*/ #LeftAds {} #LeftAds .item { margin-top: 10px; margin-bottom: 10px; } @@ -87,7 +184,7 @@ /* FOOTER ----------------------------------------------*/ #PageFooter { position: absolute; bottom: 0px; padding-top: 114px; z-index:0} -#PageFooter #Copyright { margin-bottom: 20px; margin-left: 220px; text-align: center; } +#PageFooter #Copyright { margin-bottom: 20px; margin-left: 220px; } #PageFooter a { text-decoration: none; } @@ -103,9 +200,9 @@ div.brand_JEMS #PageFooter { background: transparent url(images/bg_bottom_blue.gif) bottom left no-repeat; } div.brand_JEMS #LeftMenu { background: #777777 url(images/bg_side_btm_blue.gif) bottom right no-repeat; } div.brand_JEMS #TopSearch input.searchbutton { background: #ffffff url(images/btn_go_blue.gif) right no-repeat; } -div.brand_DOTCOM #BodyTable { background: transparent url(images/bg_top_yellow.gif) top left no-repeat; } -div.brand_DOTCOM #PageFooter { background: transparent url(images/bg_bottom_yellow.gif) bottom left no-repeat; } -div.brand_DOTCOM #LeftMenu { background: #777777 url(images/bg_side_btm_yellow.gif) bottom right no-repeat; } +div.brand_DOTCOM #BodyTable { background: transparent url(images/bg_top_green.gif) top left no-repeat; } +div.brand_DOTCOM #PageFooter { background: transparent url(images/bg_bottom_green.gif) bottom left no-repeat; } +div.brand_DOTCOM #LeftMenu { background: #777777 url(images/bg_side_btm_green.gif) bottom right no-repeat; } div.brand_DOTCOM #TopSearch input.searchbutton { background: #ffffff url(images/btn_go_green.gif) right no-repeat; } div.brand_FED #BodyTable { background: transparent url(images/bg_top_yellow.gif) top left no-repeat; } div.brand_FED #PageFooter { background: transparent url(images/bg_bottom_yellow.gif) bottom left no-repeat; } |
Author: adamw Date: 2005-09-13 08:03:12 -0400 (Tue, 13 Sep 2005) New Revision: 1096 Added: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogNodeWatcher.java Removed: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/AbstractBlog.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/BlogNodeWatcher.java trunk/forge/portal-extensions/forge-prj-blog/ Modified: trunk/forge/portal-extensions/forge-ads/src/java/org/jbosslabs/portlet/ads/AdsPortlet.java trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet-instances.xml trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java trunk/forge/portal-extensions/forge-ear/src/META-INF/application.xml trunk/forge/portal-extensions/jbosswiki/.classpath trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml Log: Merging forge-blog and forge-prj-blog Modified: trunk/forge/portal-extensions/forge-ads/src/java/org/jbosslabs/portlet/ads/AdsPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-ads/src/java/org/jbosslabs/portlet/ads/AdsPortlet.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-ads/src/java/org/jbosslabs/portlet/ads/AdsPortlet.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -18,7 +18,6 @@ import javax.portlet.*; public class AdsPortlet extends ContentPortlet { - ForgeHelper forg = new ForgeHelper(); public AdsPortlet() { super("Ads", "ads"); } @@ -48,7 +47,7 @@ } public void prepareRequest(JBossRenderRequest rReq) { - forg.prepareRequest(rReq); + ForgeHelper.prepareRequest(rReq); } protected void displayContent(JBossRenderRequest rReq, Added: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogNodeWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogNodeWatcher.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogNodeWatcher.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -0,0 +1,35 @@ +package org.jboss.portlet.blog; + +import java.net.URL; + +import org.jboss.forge.common.service.NodeWatcher; + +import com.sun.syndication.feed.synd.SyndFeed; +import com.sun.syndication.io.SyndFeedInput; +import com.sun.syndication.io.XmlReader; + +public class BlogNodeWatcher implements NodeWatcher { + private String feedAddress; + + public BlogNodeWatcher(String feedAddress) { + this.feedAddress = feedAddress; + } + + private SyndFeed getFeed() { + try { + URL feedUrl = new URL(feedAddress); + SyndFeedInput input = new SyndFeedInput(); + return input.build(new XmlReader(feedUrl)); + } catch (Exception e) { + return null; + } + } + + public Object init(String portalName) { + return getFeed(); + } + + public Object nodeUpdate(String portalName, Object currentValue) { + return getFeed(); + } +} Modified: trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-blog/src/java/org/jboss/portlet/blog/BlogPortlet.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -8,14 +8,306 @@ *****************************************/ package org.jboss.portlet.blog; -import org.jboss.forge.common.blog.AbstractBlog; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.text.DateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import javax.portlet.PortalContext; +import javax.portlet.PortletConfig; +import javax.portlet.PortletException; +import javax.portlet.PortletRequestDispatcher; +import javax.portlet.WindowState; + +import org.jboss.forge.common.ForgeHelper; +import org.jboss.forge.common.projects.ProjectsHelper; +import org.jboss.logging.Logger; +import org.jboss.portal.common.context.DelegateContext; +import org.jboss.portal.core.servlet.jsp.PortalJsp; +import org.jboss.portlet.JBossPortlet; +import org.jboss.portlet.JBossRenderRequest; +import org.jboss.portlet.JBossRenderResponse; + +import com.sun.syndication.feed.synd.SyndContentImpl; +import com.sun.syndication.feed.synd.SyndEntryImpl; +import com.sun.syndication.feed.synd.SyndFeed; + /** - * Blog portlet for the Forge (global). + * A blog portlet. + * * @author Adam Warski */ -public class BlogPortlet extends AbstractBlog { - protected String getJsp() { - return "/blog/blog.jsp"; +public class BlogPortlet extends JBossPortlet { + /** The class logger */ + public static final Logger log = Logger.getLogger(JBossPortlet.class); + + /** + * Init method of the portlet + */ + public void init() throws PortletException { + super.init(); } + + /** + * In the given content, replaces a property with the given name (typically + * ${name}) with the provided value. + */ + public String replaceProperty(String content, String name, String value) { + return ForgeHelper.replace(content, name, value); + } + + private String getJsp(JBossRenderRequest request) { + return request.getPreferences().getValue("jsp", ""); + } + + public void doView(JBossRenderRequest request, JBossRenderResponse response) + throws IOException { + + response.setContentType("text/html"); + + PortalContext portalCtx = request.getPortalContext(); + + String projectId = ProjectsHelper.getSelectedProjectId(request, true); + String portalName = ForgeHelper.getPortalName(request); + + // Getting the number of headers and entries to display + PortletConfig pConfig = getPortletConfig(); + int headersNormal = Integer.valueOf( + pConfig.getInitParameter("headersNormal")).intValue(); + int headersMaximized = Integer.valueOf( + pConfig.getInitParameter("headersMaximized")).intValue(); + int defShowEntries = Integer.valueOf( + pConfig.getInitParameter("showEntries")).intValue(); + + String feedAddress = pConfig.getInitParameter("feedAddress"); + String remoteFeedAddress = pConfig.getInitParameter("remoteFeedAddress"); + + feedAddress = replaceProperty(feedAddress, "${host.address}", request + .getServerName()); + feedAddress = replaceProperty(feedAddress, "${host.port}", Integer + .toString(request.getServerPort())); + if (projectId != null) + feedAddress = replaceProperty(feedAddress, "${project.name}", projectId); + else + feedAddress = replaceProperty(feedAddress, "${project.name}", "default"); + feedAddress = replaceProperty(feedAddress, "${portal.name}", portalName); + feedAddress = replaceProperty(feedAddress, "${feed.type}", "atom"); + + remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.address}", request + .getServerName()); + remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.port}", Integer + .toString(request.getServerPort())); + remoteFeedAddress = replaceProperty(remoteFeedAddress, "${project.name}", projectId); + remoteFeedAddress = replaceProperty(remoteFeedAddress, "${portal.name}", portalName); + String feedTypeFreeAddress = remoteFeedAddress; + + /* Getting portal-specific blog properties */ + String mainportlet = portalCtx + .getProperty("org.jboss.portlet.blog.mainportlet"); + + /* + * Main portlet means that the blog is the central window, so we can + * display more headers and also display entries without mazimizing the + * window. + */ + boolean isMainPortlet = false; + if (mainportlet != null) + isMainPortlet = mainportlet.equals("yes"); + + // Name of the entry to expand + String blogLink = ForgeHelper.getRequestParameter(request, "link"); + if (blogLink != null) + blogLink = URLDecoder.decode(blogLink, "UTF-8"); + + // A string denoting the number of the first displayed entry + String fromEntryString = ForgeHelper.getRequestParameter(request, + "from"); + + if (fromEntryString == null) + fromEntryString = "1"; + + // Now we are sure that fromEntryString has the value that was given to + // us in the address + int fromEntry = Integer.parseInt(fromEntryString); + + String cacheKey = BlogPortlet.class.getName()+"/"+projectId; + + SyndFeed feed = (SyndFeed) ForgeHelper.getForgeManagement().getFromCache( + portalName, cacheKey); + + if (feed == null) { + feed = (SyndFeed) ForgeHelper.getForgeManagement(). + addNodeWatcher(portalName, cacheKey, + new BlogNodeWatcher(feedAddress)); + } + + WindowState ws = request.getWindowState(); + + String currentWindowState = "maximized"; + if (WindowState.NORMAL.equals(ws)) + currentWindowState = "normal"; + + String desiredWindowState = "maximized"; + if ((WindowState.NORMAL.equals(ws)) && (isMainPortlet)) + desiredWindowState = "normal"; + + int showEntries = defShowEntries; + // If we are displaying a specific entry, we don't display any other + // ones + if (blogLink != null) + showEntries = 0; + + int toEntry = fromEntry + defShowEntries + headersMaximized - 1; + if ((WindowState.NORMAL.equals(ws)) && (!isMainPortlet)) { + // Getting here means that the portlet is in a normal window size, + // not on the main page and not on a special page (e.g., no the + // default one). + toEntry = fromEntry + headersNormal - 1; + showEntries = 0; + } + + setBlogContext(request, response, feed, fromEntry, toEntry, + showEntries, blogLink, desiredWindowState, currentWindowState, + projectId, portalName, feedTypeFreeAddress); + + ProjectsHelper.prepareRequest(request); + writePage(request, response, ForgeHelper.createRepoAccessPath( + portalName, getJsp(request))); + response.setTitle("Blog"); + } + + /** + * Writes the given page to the portlet's output. + * + * @param name + * Name of the page to display. + */ + void writePage(JBossRenderRequest request, JBossRenderResponse response, + String name) { + try { + PortletRequestDispatcher rd = getPortletContext() + .getRequestDispatcher(name); + rd.include(request, response); + } catch (PortletException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private int max(int a, int b) { + return a > b ? a : b; + } + + /** + * Sets the context for this blog - e.g. information about blog entries. + * + * @param fromEntry + * Number of entry from which to include information. + * @param toEntry + * Number of last entry to include information about. + * @param showEntries + * Number of first entries to expand. + * @param mainEntryLink + * Link to a blog entry to expand. + * @param desiredWindowState + * Desired portlet window state in which we want to show the + * information. + * @param currentWindowState + * Current state of the portlets' window. + * @param portalName + * Name of the portal. + * @return True iff an entry was found matching <code>mainEntryLink</code>. + */ + private boolean setBlogContext(JBossRenderRequest request, + JBossRenderResponse response, SyndFeed feed, int fromEntry, + int toEntry, int showEntries, String mainEntryLink, + String desiredWindowState, String currentWindowState, + String projectId, String portalName, String feedTypeFreeAddress) { + List entries = feed.getEntries(); + DelegateContext root = new DelegateContext(); + String defaultAuthor = feed.getAuthor(); + Iterator it = entries.iterator(); + int i = 1; + int showedEntries = 0; + boolean found = mainEntryLink == null; + + while (it.hasNext()) { + SyndEntryImpl entry = (SyndEntryImpl) it.next(); + + if (i >= fromEntry) { + DelegateContext entryContext = root.next("entry"); + List contents = entry.getContents(); + SyndContentImpl content = (SyndContentImpl) contents.iterator() + .next(); + + String author = entry.getAuthor(); + if ((author == null) || (author.equals(""))) + author = defaultAuthor; + + entryContext.put("date", DateFormat.getDateInstance( + DateFormat.FULL, request.getLocale()).format( + entry.getPublishedDate())); + entryContext.put("time", DateFormat.getTimeInstance( + DateFormat.SHORT, request.getLocale()).format( + entry.getPublishedDate())); + entryContext.put("author", author); + entryContext.put("title", entry.getTitle()); + entryContext.put("content", content.getValue()); + entryContext.put("link", entry.getLink()); + if ((showedEntries++ < showEntries) + || (entry.getLink().equals(mainEntryLink))) + entryContext.next("show"); + else + entryContext.next("dontShow"); + + try { + entryContext.put("linkEnc", URLEncoder.encode(entry + .getLink(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + } + + if (entry.getLink().equals(mainEntryLink)) + found = true; + } + + i++; + if (i == toEntry + 1) + break; + } + + root.put("atomFeed", ForgeHelper.replace(feedTypeFreeAddress, + "${feed.type}", "atom")); + root.put("rssFeed", ForgeHelper.replace(feedTypeFreeAddress, + "${feed.type}", "rss")); + root.put("xmlFeed", ForgeHelper.replace(feedTypeFreeAddress, + "${feed.type}", "rdf")); + + root.put("currentTime", DateFormat.getTimeInstance(DateFormat.SHORT, + request.getLocale()).format(new Date())); + root.put("desiredWindowState", desiredWindowState); + root.put("currentWindowState", currentWindowState); + root.put("projectId", projectId); + root.put(ForgeHelper.PORTAL_NAME, portalName); + if (fromEntry != 1) { + root.next("showPrevEntries"); + root.put("prevEntries", Integer.toString(max(fromEntry + - (toEntry - fromEntry + 1), 1))); + } + + if (toEntry < entries.size()) { + root.next("showNextEntries"); + root.put("nextEntries", Integer.toString(toEntry + 1)); + } + + root.put("currEntries", Integer.toString(fromEntry)); + + request.setAttribute(PortalJsp.CTX_REQUEST, root); + + return found; + } } \ No newline at end of file Modified: trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet-instances.xml =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet-instances.xml 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet-instances.xml 2005-09-13 12:03:12 UTC (rev 1096) @@ -3,5 +3,21 @@ <instance> <instance-name>BlogPortletInstance</instance-name> <component-ref>BlogPortlet</component-ref> + <preferences> + <preference> + <name>jsp</name> + <value>/blog/blog.jsp</value> + </preference> + </preferences> </instance> + <instance> + <instance-name>PrjBlogPortletInstance</instance-name> + <component-ref>BlogPortlet</component-ref> + <preferences> + <preference> + <name>jsp</name> + <value>/prj-blog/blog.jsp</value> + </preference> + </preferences> + </instance> </instances> Modified: trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml =================================================================== --- trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-blog/src/web/WEB-INF/portlet.xml 2005-09-13 12:03:12 UTC (rev 1096) @@ -29,14 +29,12 @@ <init-param> <description>Address of the blog's local feed.</description> <name>feedAddress</name> - <value>http://${host.address}:${host.port}/blojsom/blog/${portal.name}/?flavor=${feed.type}</value> - <!-- <value>http://forge.sicore.org:${host.port}/blojsom/blog/${portal.name}/?flavor=atom</value> --> + <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <init-param> <description>Address of the blog's remote feed.</description> <name>remoteFeedAddress</name> - <value>http://${host.address}:${host.port}/blojsom/blog/${portal.name}/?flavor=${feed.type}</value> - <!-- <value>http://forge.sicore.org:${host.port}/blojsom/blog/${portal.name}/?flavor=atom</value> --> + <value>http://${host.address}:${host.port}/blojsom/blog/${project.name}/?flavor=${feed.type}</value> </init-param> <portlet-info> <title>JBoss Blog Portlet</title> Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/ForgeHelper.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -33,6 +33,13 @@ * @author adamw */ public class ForgeHelper { + /** + * This class cannot be instatiated. + */ + private ForgeHelper() { + + } + /** * <code>REPO_ACCESS_DIR</code> - name of the virtual directory which is * used by the servlets (portlets) to inlclude pages from the repository. Deleted: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/AbstractBlog.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/AbstractBlog.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/AbstractBlog.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -1,310 +0,0 @@ -/***************************************** - * * - * JBoss Portal: The OpenSource Portal * - * * - * Distributable under LGPL license. * - * See terms of license at gnu.org. * - * * - *****************************************/ -package org.jboss.forge.common.blog; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.text.DateFormat; -import java.util.Date; -import java.util.Iterator; -import java.util.List; - -import javax.portlet.PortalContext; -import javax.portlet.PortletConfig; -import javax.portlet.PortletException; -import javax.portlet.PortletRequestDispatcher; -import javax.portlet.WindowState; - -import org.jboss.forge.common.ForgeHelper; -import org.jboss.forge.common.projects.ProjectsHelper; -import org.jboss.logging.Logger; -import org.jboss.portal.common.context.DelegateContext; -import org.jboss.portal.core.servlet.jsp.PortalJsp; -import org.jboss.portlet.JBossPortlet; -import org.jboss.portlet.JBossRenderRequest; -import org.jboss.portlet.JBossRenderResponse; - -import com.sun.syndication.feed.synd.SyndContentImpl; -import com.sun.syndication.feed.synd.SyndEntryImpl; -import com.sun.syndication.feed.synd.SyndFeed; - -/** - * An abstract blog portlet. - * - * @author Adam Warski - */ -public abstract class AbstractBlog extends JBossPortlet { - /** The class logger */ - public static final Logger log = Logger.getLogger(JBossPortlet.class); - - /** - * Init method of the portlet - */ - public void init() throws PortletException { - super.init(); - } - - /** - * In the given content, replaces a property with the given name (typically - * ${name}) with the provided value. - */ - public String replaceProperty(String content, String name, String value) { - return ForgeHelper.replace(content, name, value); - } - - protected abstract String getJsp(); - - public void doView(JBossRenderRequest request, JBossRenderResponse response) - throws IOException { - response.setContentType("text/html"); - - PortalContext portalCtx = request.getPortalContext(); - - String projectId = ProjectsHelper.getSelectedProjectId(request); - String portalName = ForgeHelper.getPortalName(request); - - // Getting the number of headers and entries to display - PortletConfig pConfig = getPortletConfig(); - int headersNormal = Integer.valueOf( - pConfig.getInitParameter("headersNormal")).intValue(); - int headersMaximized = Integer.valueOf( - pConfig.getInitParameter("headersMaximized")).intValue(); - int defShowEntries = Integer.valueOf( - pConfig.getInitParameter("showEntries")).intValue(); - - String feedAddress = pConfig.getInitParameter("feedAddress"); - String remoteFeedAddress = pConfig.getInitParameter("remoteFeedAddress"); - - feedAddress = replaceProperty(feedAddress, "${host.address}", request - .getServerName()); - feedAddress = replaceProperty(feedAddress, "${host.port}", Integer - .toString(request.getServerPort())); - if (projectId != null) - feedAddress = replaceProperty(feedAddress, "${project.name}", projectId); - else - feedAddress = replaceProperty(feedAddress, "${project.name}", "default"); - feedAddress = replaceProperty(feedAddress, "${portal.name}", portalName); - feedAddress = replaceProperty(feedAddress, "${feed.type}", "atom"); - - remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.address}", request - .getServerName()); - remoteFeedAddress = replaceProperty(remoteFeedAddress, "${host.port}", Integer - .toString(request.getServerPort())); - remoteFeedAddress = replaceProperty(remoteFeedAddress, "${project.name}", projectId); - remoteFeedAddress = replaceProperty(remoteFeedAddress, "${portal.name}", portalName); - String feedTypeFreeAddress = remoteFeedAddress; - - /* Getting portal-specific blog properties */ - String mainportlet = portalCtx - .getProperty("org.jboss.portlet.blog.mainportlet"); - - /* - * Main portlet means that the blog is the central window, so we can - * display more headers and also display entries without mazimizing the - * window. - */ - boolean isMainPortlet = false; - if (mainportlet != null) - isMainPortlet = mainportlet.equals("yes"); - - // Name of the entry to expand - String blogLink = ForgeHelper.getRequestParameter(request, "link"); - if (blogLink != null) - blogLink = URLDecoder.decode(blogLink, "UTF-8"); - - // A string denoting the number of the first displayed entry - String fromEntryString = ForgeHelper.getRequestParameter(request, - "from"); - - if (fromEntryString == null) - fromEntryString = "1"; - - // Now we are sure that fromEntryString has the value that was given to - // us in the address - int fromEntry = Integer.parseInt(fromEntryString); - - String cacheKey = AbstractBlog.class.getName()+"/"+projectId; - - SyndFeed feed = (SyndFeed) ForgeHelper.getForgeManagement().getFromCache( - portalName, cacheKey); - - if (feed == null) { - feed = (SyndFeed) ForgeHelper.getForgeManagement(). - addNodeWatcher(portalName, cacheKey, - new BlogNodeWatcher(feedAddress)); - } - - WindowState ws = request.getWindowState(); - - String currentWindowState = "maximized"; - if (WindowState.NORMAL.equals(ws)) - currentWindowState = "normal"; - - String desiredWindowState = "maximized"; - if ((WindowState.NORMAL.equals(ws)) && (isMainPortlet)) - desiredWindowState = "normal"; - - int showEntries = defShowEntries; - // If we are displaying a specific entry, we don't display any other - // ones - if (blogLink != null) - showEntries = 0; - - int toEntry = fromEntry + defShowEntries + headersMaximized - 1; - if ((WindowState.NORMAL.equals(ws)) && (!isMainPortlet)) { - // Getting here means that the portlet is in a normal window size, - // not on the main page and not on a special page (e.g., no the - // default one). - toEntry = fromEntry + headersNormal - 1; - showEntries = 0; - } - - setBlogContext(request, response, feed, fromEntry, toEntry, - showEntries, blogLink, desiredWindowState, currentWindowState, - projectId, portalName, feedTypeFreeAddress); - - ProjectsHelper.prepareRequest(request); - writePage(request, response, ForgeHelper.createRepoAccessPath( - portalName, getJsp())); - response.setTitle("Blog"); - } - - /** - * Writes the given page to the portlet's output. - * - * @param name - * Name of the page to display. - */ - void writePage(JBossRenderRequest request, JBossRenderResponse response, - String name) { - try { - PortletRequestDispatcher rd = getPortletContext() - .getRequestDispatcher(name); - rd.include(request, response); - } catch (PortletException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - private int max(int a, int b) { - return a > b ? a : b; - } - - /** - * Sets the context for this blog - e.g. information about blog entries. - * - * @param fromEntry - * Number of entry from which to include information. - * @param toEntry - * Number of last entry to include information about. - * @param showEntries - * Number of first entries to expand. - * @param mainEntryLink - * Link to a blog entry to expand. - * @param desiredWindowState - * Desired portlet window state in which we want to show the - * information. - * @param currentWindowState - * Current state of the portlets' window. - * @param portalName - * Name of the portal. - * @return True iff an entry was found matching <code>mainEntryLink</code>. - */ - private boolean setBlogContext(JBossRenderRequest request, - JBossRenderResponse response, SyndFeed feed, int fromEntry, - int toEntry, int showEntries, String mainEntryLink, - String desiredWindowState, String currentWindowState, - String projectId, String portalName, String feedTypeFreeAddress) { - List entries = feed.getEntries(); - DelegateContext root = new DelegateContext(); - String defaultAuthor = feed.getAuthor(); - Iterator it = entries.iterator(); - int i = 1; - int showedEntries = 0; - boolean found = mainEntryLink == null; - - while (it.hasNext()) { - SyndEntryImpl entry = (SyndEntryImpl) it.next(); - - if (i >= fromEntry) { - DelegateContext entryContext = root.next("entry"); - List contents = entry.getContents(); - SyndContentImpl content = (SyndContentImpl) contents.iterator() - .next(); - - String author = entry.getAuthor(); - if ((author == null) || (author.equals(""))) - author = defaultAuthor; - - entryContext.put("date", DateFormat.getDateInstance( - DateFormat.FULL, request.getLocale()).format( - entry.getPublishedDate())); - entryContext.put("time", DateFormat.getTimeInstance( - DateFormat.SHORT, request.getLocale()).format( - entry.getPublishedDate())); - entryContext.put("author", author); - entryContext.put("title", entry.getTitle()); - entryContext.put("content", content.getValue()); - entryContext.put("link", entry.getLink()); - if ((showedEntries++ < showEntries) - || (entry.getLink().equals(mainEntryLink))) - entryContext.next("show"); - else - entryContext.next("dontShow"); - - try { - entryContext.put("linkEnc", URLEncoder.encode(entry - .getLink(), "UTF-8")); - } catch (UnsupportedEncodingException e) { - } - - if (entry.getLink().equals(mainEntryLink)) - found = true; - } - - i++; - if (i == toEntry + 1) - break; - } - - root.put("atomFeed", ForgeHelper.replace(feedTypeFreeAddress, - "${feed.type}", "atom")); - root.put("rssFeed", ForgeHelper.replace(feedTypeFreeAddress, - "${feed.type}", "rss")); - root.put("xmlFeed", ForgeHelper.replace(feedTypeFreeAddress, - "${feed.type}", "rdf")); - - root.put("currentTime", DateFormat.getTimeInstance(DateFormat.SHORT, - request.getLocale()).format(new Date())); - root.put("desiredWindowState", desiredWindowState); - root.put("currentWindowState", currentWindowState); - root.put("projectId", projectId); - root.put(ForgeHelper.PORTAL_NAME, portalName); - if (fromEntry != 1) { - root.next("showPrevEntries"); - root.put("prevEntries", Integer.toString(max(fromEntry - - (toEntry - fromEntry + 1), 1))); - } - - if (toEntry < entries.size()) { - root.next("showNextEntries"); - root.put("nextEntries", Integer.toString(toEntry + 1)); - } - - root.put("currEntries", Integer.toString(fromEntry)); - - request.setAttribute(PortalJsp.CTX_REQUEST, root); - - return found; - } -} \ No newline at end of file Deleted: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/BlogNodeWatcher.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/BlogNodeWatcher.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/blog/BlogNodeWatcher.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -1,35 +0,0 @@ -package org.jboss.forge.common.blog; - -import java.net.URL; - -import org.jboss.forge.common.service.NodeWatcher; - -import com.sun.syndication.feed.synd.SyndFeed; -import com.sun.syndication.io.SyndFeedInput; -import com.sun.syndication.io.XmlReader; - -public class BlogNodeWatcher implements NodeWatcher { - private String feedAddress; - - public BlogNodeWatcher(String feedAddress) { - this.feedAddress = feedAddress; - } - - private SyndFeed getFeed() { - try { - URL feedUrl = new URL(feedAddress); - SyndFeedInput input = new SyndFeedInput(); - return input.build(new XmlReader(feedUrl)); - } catch (Exception e) { - return null; - } - } - - public Object init(String portalName) { - return getFeed(); - } - - public Object nodeUpdate(String portalName, Object currentValue) { - return getFeed(); - } -} Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-13 12:03:12 UTC (rev 1096) @@ -21,6 +21,13 @@ * @author adamw */ public class ProjectsHelper { + /** + * This class cannot be instatiated. + */ + private ProjectsHelper() { + + } + /** * <code>PROJECT_ID</code> - name of the attribute under which the * selected project's id can be found in a servlet response object. Modified: trunk/forge/portal-extensions/forge-ear/src/META-INF/application.xml =================================================================== --- trunk/forge/portal-extensions/forge-ear/src/META-INF/application.xml 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/forge-ear/src/META-INF/application.xml 2005-09-13 12:03:12 UTC (rev 1096) @@ -35,11 +35,6 @@ </module> <module> <web> - <web-uri>forge-prj-blog.war</web-uri> - </web> - </module> - <module> - <web> <web-uri>forge-prj-downloads.war</web-uri> </web> </module> Modified: trunk/forge/portal-extensions/jbosswiki/.classpath =================================================================== --- trunk/forge/portal-extensions/jbosswiki/.classpath 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/jbosswiki/.classpath 2005-09-13 12:03:12 UTC (rev 1096) @@ -1,8 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> - <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> - </classpathentry> - <classpathentry kind="output" path="target/classes"> - </classpathentry> -</classpath> \ No newline at end of file + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> Modified: trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml =================================================================== --- trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml 2005-09-13 11:43:19 UTC (rev 1095) +++ trunk/forge/portal-extensions/portal-default/src/web/WEB-INF/default-portal.xml 2005-09-13 12:03:12 UTC (rev 1096) @@ -238,7 +238,7 @@ <window> <window-name>PrjBlogPortletWindowDefaultBlog</window-name> - <instance-ref>prj-blog.PrjBlogPortlet.PrjBlogPortletInstance</instance-ref> + <instance-ref>blog.BlogPortlet.PrjBlogPortletInstance</instance-ref> <default>true</default> <region>center</region> <height>0</height> |
From: <jbo...@li...> - 2005-09-13 11:43:23
|
Author: mla...@jb... Date: 2005-09-13 07:43:19 -0400 (Tue, 13 Sep 2005) New Revision: 1095 Modified: trunk/labs/jbossweb/xdocs/news/2005.xml trunk/labs/jbossweb/xdocs/news/project.xml Log: Update news project Modified: trunk/labs/jbossweb/xdocs/news/2005.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/2005.xml 2005-09-13 10:59:53 UTC (rev 1094) +++ trunk/labs/jbossweb/xdocs/news/2005.xml 2005-09-13 11:43:19 UTC (rev 1095) @@ -8,7 +8,7 @@ <properties> <author email="mla...@jb...">Mladen Turk</author> - <title>2005 News and Status</title> + <title>News and Status</title> </properties> <body> @@ -16,7 +16,7 @@ <section name="2005 News & Status"> <br /> <a name="20050805.1"> -<h3>8 April - JBossWeb project started</h3> +<h3>5 August 2005 - JBossWeb project started</h3> </a> <p>JBossWeb project has been officially started. </p> Modified: trunk/labs/jbossweb/xdocs/news/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/project.xml 2005-09-13 10:59:53 UTC (rev 1094) +++ trunk/labs/jbossweb/xdocs/news/project.xml 2005-09-13 11:43:19 UTC (rev 1095) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <project name="JBossWeb Documentation - News"> - <title>Breaking News</title> + <title>JBossWeb</title> <logo href="/images/jbossweblogo.gif">JBossWeb @ JBoss labs</logo> <body> <menu name="News"> |
From: <jbo...@li...> - 2005-09-13 10:59:58
|
Author: mla...@jb... Date: 2005-09-13 06:59:53 -0400 (Tue, 13 Sep 2005) New Revision: 1094 Modified: trunk/labs/jbossweb/xdocs/project.xml trunk/labs/jbossweb/xdocs/resources/faq.xml trunk/labs/jbossweb/xdocs/resources/project.xml Log: Use FAQq instead FAQ Modified: trunk/labs/jbossweb/xdocs/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 10:54:14 UTC (rev 1093) +++ trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 10:59:53 UTC (rev 1094) @@ -12,7 +12,7 @@ <item name="Architecture" href="reference/arch.html"/> </menu> <menu name="Resources"> - <item name="FAQ" href="resources/faq.html"/> + <item name="FAQs" href="resources/faq.html"/> <item name="Tutorial" href="resources/tut.html"/> <item name="Mailing Lists" href="resources/mail.html"/> </menu> Modified: trunk/labs/jbossweb/xdocs/resources/faq.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/faq.xml 2005-09-13 10:54:14 UTC (rev 1093) +++ trunk/labs/jbossweb/xdocs/resources/faq.xml 2005-09-13 10:59:53 UTC (rev 1094) @@ -8,7 +8,7 @@ <properties> <author email="mla...@jb...">Mladen Turk</author> - <title>FAQ</title> + <title>FAQs</title> </properties> <body> Modified: trunk/labs/jbossweb/xdocs/resources/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 10:54:14 UTC (rev 1093) +++ trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 10:59:53 UTC (rev 1094) @@ -5,11 +5,11 @@ <body> <menu name="Resources"> - <item name="FAQ" href="faq.html"/> + <item name="FAQs" href="faq.html"/> <item name="Tutorial" href="tut.html"/> <item name="Mailing Lists" href="mail.html"/> </menu> - <menu name="FAQ"> + <menu name="FAQs"> <item name="General" href="faq01.html"/> <item name="HTTP" href="faq02.html"/> <item name="HTTPS" href="faq03.html"/> |
From: <jbo...@li...> - 2005-09-13 10:54:22
|
Author: mla...@jb... Date: 2005-09-13 06:54:14 -0400 (Tue, 13 Sep 2005) New Revision: 1093 Added: trunk/labs/jbossweb/xdocs/resources/mail.xml Modified: trunk/labs/jbossweb/xdocs/project.xml trunk/labs/jbossweb/xdocs/resources/project.xml Log: Added mail.xml Modified: trunk/labs/jbossweb/xdocs/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 09:54:48 UTC (rev 1092) +++ trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 10:54:14 UTC (rev 1093) @@ -14,6 +14,7 @@ <menu name="Resources"> <item name="FAQ" href="resources/faq.html"/> <item name="Tutorial" href="resources/tut.html"/> + <item name="Mailing Lists" href="resources/mail.html"/> </menu> <menu name="News"> <item name="News & Status" href="news/2005.html"/> Added: trunk/labs/jbossweb/xdocs/resources/mail.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/mail.xml 2005-09-13 09:54:48 UTC (rev 1092) +++ trunk/labs/jbossweb/xdocs/resources/mail.xml 2005-09-13 10:54:14 UTC (rev 1093) @@ -0,0 +1,174 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="mail.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Mailing lists</title> + </properties> + +<body> + +<section name="Apache Tomcat"> +<br/> +<subsection name="Tomcat User List"> +<p> +This is the list where users of Tomcat meet and discuss issues. Developers are +also expected to be lurking on this list to offer support to users of Tomcat. +<ul> +<li><a href="mailto:tom...@ja...">Subscribe</a></li> +<li><a href="mailto:tom...@ja...">Unsubscribe</a></li> +<li><a href="http://mail-archives.eu.apache.org/mod_mbox/jakarta-tomcat-user/">Archive</a></li> +</ul> +</p> +</subsection> +<subsection name="Tomcat Developer List"> +<p> +This is the list where participating developers of the Tomcat Servlet Container +meet and discuss issues, code changes/additions, etc. Subscribers to this list +get notices of each and every code change, build results, testing notices, etc. +Do not send mail to this list with usage questions or configuration problems -- +that's what tomcat-user is for. +<ul> +<li><a href="mailto:tom...@ja...">Subscribe</a></li> +<li><a href="mailto:tom...@ja...">Unsubscribe</a></li> +<li><a href="http://mail-archives.eu.apache.org/mod_mbox/jakarta-tomcat-dev/">Archive</a></li> +</ul> +</p> +</subsection> +</section> +<section name="Mailing Lists - Guidelines"> + +<p>A mailing list is an electronic discussion forum that anyone can +subscribe to. When someone sends an email message to the mailing list, +a copy of that message is broadcast to everyone who is subscribed to +that mailing list. Mailing lists provide a simple and effective +communication mechanism. With potentially thousands of subscribers, +there is a common set of etiquette guidelines that you should observe. +Please keep on reading. +</p> + + +<p> +<strong> + Respect the mailing list type +</strong><br/> + There are generally two types of lists. +</p> + +<p> +<ul> + <li> + The "User" lists where you can send questions and comments about + configuration, setup, usage and other "user" types of questions. + </li> + <li> + The "Developer" lists where you can send questions and + comments about the actual software source code and general + "development" types of questions. + </li> +</ul> +</p> + +<p>Some questions are appropriate for posting on both the "user" and +the "developer" lists. In this case, pick one and only one. Do not +cross post.</p> + +<p>Asking a configuration question on the developers list is frowned +upon because developers' time is as precious as yours. By contacting +them directly instead of the user base you are abusing resources. In +fact, it is unlikely that you will get a quicker answer, if at +all.</p> + +<p> +<strong> + Join the lists that are appropriate for your discussion. +</strong><br/> +Please make sure that you are joining the list that is appropriate for the +topic or product that you would like to discuss. For example, +please do not join the Regexp mailing list and ask questions about Tomcat. +Instead, you should join the Tomcat User list and ask your questions +there. +</p> + +<p> +<strong> + Ask smart questions. </strong><br/> + +Every volunteer project obtains its strength from the people involved +in it. You are welcome to join any of our mailing lists. You can +choose to lurk, or actively participate; it's up to you. The level of +community responsiveness to specific questions is generally directly +proportional to the amount of effort you spend formulating your +question. Eric Raymond and Rick Moen have even written an essay entitled <a +href="http://www.catb.org/~esr/faqs/smart-questions.html">"<b>Asking +Smart Questions</b>"</a> precisely on this topic. Although somewhat +militant, it is definitely worth reading.<br/> +<b>Note</b>: Please do NOT send your Java problems to the two authors. They welcome feedback on the FAQ's contents, but are simply not a Java help resource. Follow the essay's advice and <a href="http://www.catb.org/~esr/faqs/smart-questions.html#forum">choose your forum</a> carefully. +</p> + +<p> +<strong> + Keep your email short and to the point. +</strong><br/> +If your email is more than about a page of text, chances are that it +won't get read by very many people. It is much better to try to pack a +lot of informative information (see above about asking smart questions) +into as small of an email as possible. If you are replying to a previous +email, it is a good idea to only quote the parts that you are replying +to and to remove the unnecessary bits. This makes it easier for people +to follow a thread as well as making the email archives easier to search +and read. +</p> + +<p> +<strong> + Do your best to ensure that you are not sending HTML or + "Stylelized" email to the list. +</strong><br/> +If you are using Outlook or Outlook Express or Eudora, chances are that +you are sending HTML email by default. There is usually a setting that +will allow you to send "Plain Text" email. If you are using Microsoft +products to send email, there are several bugs in the software that +prevent you from turning off the sending of HTML email. +</p> + +<p> +<strong> + Watch where you are sending email. +</strong><br/> +The majority of our mailing lists have set the Reply-To to go back to the +list. That means that when you Reply to a message, it will go to the list +and not to the original author directly. The reason is because it helps +facilitate discussion on the list for everyone to benefit from. Be careful +of this as sometimes you may intend to reply to a message directly to someone +instead of the entire list. +<em> +The appropriate contents of the Reply-To header is an age-old debate that +should not be brought up on the mailing lists. You can +examine opposing points of view +<a href="http://www.unicom.com/pw/reply-to-harmful.html">condemning</a> +our convention and +<a href="http://www.metasystema.org/essays/reply-to-useful.mhtml"> +condoning</a> +it. Bringing this up for debate on a mailing list will add nothing +new and is considered off-topic. +</em> +</p> + +<p> +<strong> + Do not cross post messages. +</strong><br/> +In other words, pick a mailing list and send your messages to that mailing +list only. Do not send your messages to multiple mailing lists. The reason is +that people may be subscribed to one list and not to the other. Therefore, +some people will only see part of the conversation. +</p> +</section> +</body> +</document> Modified: trunk/labs/jbossweb/xdocs/resources/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 09:54:48 UTC (rev 1092) +++ trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 10:54:14 UTC (rev 1093) @@ -7,6 +7,7 @@ <menu name="Resources"> <item name="FAQ" href="faq.html"/> <item name="Tutorial" href="tut.html"/> + <item name="Mailing Lists" href="mail.html"/> </menu> <menu name="FAQ"> <item name="General" href="faq01.html"/> |
From: <jbo...@li...> - 2005-09-13 09:55:04
|
Author: mla...@jb... Date: 2005-09-13 05:54:48 -0400 (Tue, 13 Sep 2005) New Revision: 1092 Added: trunk/labs/jbossweb/xdocs/howto/ trunk/labs/jbossweb/xdocs/howto/how.xml trunk/labs/jbossweb/xdocs/howto/how01.xml trunk/labs/jbossweb/xdocs/howto/project.xml trunk/labs/jbossweb/xdocs/news/ trunk/labs/jbossweb/xdocs/news/2005.xml trunk/labs/jbossweb/xdocs/news/project.xml trunk/labs/jbossweb/xdocs/news/roadmap.xml trunk/labs/jbossweb/xdocs/reference/arch.xml trunk/labs/jbossweb/xdocs/reference/arch01.xml trunk/labs/jbossweb/xdocs/reference/arch02.xml trunk/labs/jbossweb/xdocs/resources/ trunk/labs/jbossweb/xdocs/resources/faq.xml trunk/labs/jbossweb/xdocs/resources/faq01.xml trunk/labs/jbossweb/xdocs/resources/faq02.xml trunk/labs/jbossweb/xdocs/resources/faq03.xml trunk/labs/jbossweb/xdocs/resources/faq04.xml trunk/labs/jbossweb/xdocs/resources/project.xml trunk/labs/jbossweb/xdocs/resources/tut.xml trunk/labs/jbossweb/xdocs/resources/tut01.xml Modified: trunk/labs/jbossweb/xdocs/build.xml trunk/labs/jbossweb/xdocs/project.xml trunk/labs/jbossweb/xdocs/reference/project.xml trunk/labs/jbossweb/xdocs/style.xsl Log: Add howto, news and resources Modified: trunk/labs/jbossweb/xdocs/build.xml =================================================================== --- trunk/labs/jbossweb/xdocs/build.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/build.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -60,6 +60,7 @@ <param name="relative-path" expression="./.."/> <param name="project-menu" expression="nomenu"/> </style> + <style basedir="reference" destdir="${build.dir}/${dist.name}/reference" extension=".html" @@ -79,18 +80,17 @@ <param name="project-menu" expression="nomenu"/> </style> -<!-- - <style basedir="news" - destdir="${build.dir}/${dist.name}/news" + <style basedir="resources" + destdir="${build.dir}/${dist.name}/resources" extension=".html" style="style.xsl" excludes="project.xml" includes="*.xml"> <param name="relative-path" expression=".."/> </style> - <mkdir dir="${build.dir}/${dist.name}/news/printer"/> - <style basedir="news" - destdir="${build.dir}/${dist.name}/news/printer" + <mkdir dir="${build.dir}/${dist.name}/resources/printer"/> + <style basedir="resources" + destdir="${build.dir}/${dist.name}/resources/printer" extension=".html" style="style.xsl" excludes="project.xml" @@ -98,17 +98,18 @@ <param name="relative-path" expression="../.."/> <param name="project-menu" expression="nomenu"/> </style> - <style basedir="common" - destdir="${build.dir}/${dist.name}/common" + + <style basedir="howto" + destdir="${build.dir}/${dist.name}/howto" extension=".html" style="style.xsl" excludes="project.xml" includes="*.xml"> <param name="relative-path" expression=".."/> </style> - <mkdir dir="${build.dir}/${dist.name}/common/printer"/> - <style basedir="common" - destdir="${build.dir}/${dist.name}/common/printer" + <mkdir dir="${build.dir}/${dist.name}/howto/printer"/> + <style basedir="howto" + destdir="${build.dir}/${dist.name}/howto/printer" extension=".html" style="style.xsl" excludes="project.xml" @@ -117,17 +118,17 @@ <param name="project-menu" expression="nomenu"/> </style> - <style basedir="howto" - destdir="${build.dir}/${dist.name}/howto" + <style basedir="news" + destdir="${build.dir}/${dist.name}/news" extension=".html" style="style.xsl" excludes="project.xml" includes="*.xml"> <param name="relative-path" expression=".."/> </style> - <mkdir dir="${build.dir}/${dist.name}/howto/printer"/> - <style basedir="howto" - destdir="${build.dir}/${dist.name}/howto/printer" + <mkdir dir="${build.dir}/${dist.name}/news/printer"/> + <style basedir="news" + destdir="${build.dir}/${dist.name}/news/printer" extension=".html" style="style.xsl" excludes="project.xml" @@ -136,6 +137,26 @@ <param name="project-menu" expression="nomenu"/> </style> +<!-- + <style basedir="common" + destdir="${build.dir}/${dist.name}/common" + extension=".html" + style="style.xsl" + excludes="project.xml" + includes="*.xml"> + <param name="relative-path" expression=".."/> + </style> + <mkdir dir="${build.dir}/${dist.name}/common/printer"/> + <style basedir="common" + destdir="${build.dir}/${dist.name}/common/printer" + extension=".html" + style="style.xsl" + excludes="project.xml" + includes="*.xml"> + <param name="relative-path" expression="../.."/> + <param name="project-menu" expression="nomenu"/> + </style> + <style basedir="config" destdir="${build.dir}/${dist.name}/config" extension=".html" Added: trunk/labs/jbossweb/xdocs/howto/how.xml =================================================================== --- trunk/labs/jbossweb/xdocs/howto/how.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/howto/how.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="how.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>HowTo Documentation index</title> + </properties> + +<body> + +<section name="Introduction"> +<p>This is the top-level entry point of the HowTo documentation bundle for the +<strong>JBossWeb server</strong>. + +</p> +<p>Select one of the links from the navigation menu (to the left) to drill +down to the more detailed documentation that is available.</p> + +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/howto/how01.xml =================================================================== --- trunk/labs/jbossweb/xdocs/howto/how01.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/howto/how01.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="how01.html"> + + &project; + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Quick start HowTo</title> + </properties> + + <body> +<section name="Introduction"> +<p> + This document describes the configuration files used by JBossWeb + for the 'impatients' : + <ul> + <li> + WebServers add-ons to be set on the JBossWeb server. + </li> + </ul> +</p> +</section> + +<section name="Test your configuration"> +<p> + (Re)start the Web server and browse to the <a href="http://localhost/examples/">http://localhost/examples/</a> +</p> + +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/howto/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/howto/project.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/howto/project.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JBossWeb Documentation - Howto"> + <title>HowTo</title> + <logo href="/images/jbossweblogo.gif">JBossWeb @ JBoss labs</logo> +<body> + + <menu name="HowTo"> + <item name="Quick Start HowTo" href="how01.html"/> + </menu> + <menu name="Links"> + <item name="HowTo" href="how.html"/> + <item name="Documentation Home" href="../index.html"/> + </menu> +</body> +</project> Added: trunk/labs/jbossweb/xdocs/news/2005.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/2005.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/news/2005.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="2005.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>2005 News and Status</title> + </properties> + +<body> + +<section name="2005 News & Status"> +<br /> +<a name="20050805.1"> +<h3>8 April - JBossWeb project started</h3> +</a> +<p>JBossWeb project has been officially started. +</p> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/news/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/project.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/news/project.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JBossWeb Documentation - News"> + <title>Breaking News</title> + <logo href="/images/jbossweblogo.gif">JBossWeb @ JBoss labs</logo> +<body> + <menu name="News"> + <item name="2005" href="2005.html"/> + <item name="Roadmap" href="roadmap.html"/> + </menu> + <menu name="Links"> + <item name="Documentation Home" href="../index.html"/> + </menu> +</body> +</project> Added: trunk/labs/jbossweb/xdocs/news/roadmap.xml =================================================================== --- trunk/labs/jbossweb/xdocs/news/roadmap.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/news/roadmap.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,22 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="Roadmap.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Roadmap</title> + </properties> + +<body> + +<section name="Introduction"> +<br /> +This document details the current high level plans for the JBossWeb project as a whole. +More information can be found in JIRA under the JBWEB project. +</section> +</body> +</document> Modified: trunk/labs/jbossweb/xdocs/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/project.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -9,7 +9,15 @@ <item name="Overview" href="index.html"/> </menu> <menu name="Reference"> - <item name="Architecture" href="reference/ch01.html"/> + <item name="Architecture" href="reference/arch.html"/> </menu> + <menu name="Resources"> + <item name="FAQ" href="resources/faq.html"/> + <item name="Tutorial" href="resources/tut.html"/> + </menu> + <menu name="News"> + <item name="News & Status" href="news/2005.html"/> + <item name="Roadmap" href="news/roadmap.html"/> + </menu> </body> </project> Added: trunk/labs/jbossweb/xdocs/reference/arch.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/reference/arch.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="arch.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Architecture Overview</title> + </properties> + +<body> + +<section name="Design"> + <p>JBoss Web Server is based on the + <a href="http://tomcat.apache.org">Apache Tomcat</a>. + </p> + <figure src="/images/design/jbosswebblockda.png" name="Figure 1" text="JBossWeb architecture"/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/reference/arch01.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch01.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/reference/arch01.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="arch01.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Tomcat Native</title> + </properties> + +<body> + +<section name="Design"> + <p>Tomcat Native uses <a href="http://apr.apache.org">APR</a> and + <a href="http://www.openssl.org">OpenSSL</a> + </p> + <figure src="/images/design/tcnativeblockda.png" name="Figure 2" text="Tomcat Native"/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/reference/arch02.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/arch02.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/reference/arch02.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,22 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="arch02.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Hybrid connection model</title> + </properties> + +<body> + +<section name="Design"> + <p>Hybrid connection model + </p> + <figure src="/images/design/acceptflowchart.png" name="Figure 3" text="Accept flowchart"/> +</section> +</body> +</document> Modified: trunk/labs/jbossweb/xdocs/reference/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/project.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/reference/project.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -1,17 +1,19 @@ <?xml version="1.0" encoding="ISO-8859-1"?> -<project name="JBossWeb Documentation - Top Level Directory" - href="http://labs.jboss.com/portal/index.html?ctrl:id=page.default.info&project=jbossweb"> - <title>JBossWeb</title> +<project name="JBossWeb Documentation - Refence"> + <title>Reference</title> <logo href="/images/jbossweblogo.gif">JBossWeb @ JBoss labs</logo> <body> - <menu name="JBossWeb"> - <item name="Overview" href="../index.html"/> + <menu name="Reference"> + <item name="Architecture" href="arch.html"/> </menu> <menu name="Architecture"> - <item name="Overview" href="ch01.html"/> - <item name="Native" href="ch02.html"/> - <item name="Hybrid connection model" href="ch03.html"/> + <item name="Overview" href="arch.html"/> + <item name="Native" href="arch01.html"/> + <item name="Hybrid connection model" href="arch02.html"/> </menu> + <menu name="Links"> + <item name="Documentation Home" href="../index.html"/> + </menu> </body> </project> Added: trunk/labs/jbossweb/xdocs/resources/faq.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/faq.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/faq.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="faq.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>FAQ</title> + </properties> + +<body> + +<section name="Where is the latest FAQ?"> + <p>The JBossWeb FAQ is included in the demo of the extra JBossWeb release. + But for the latest FAQ entries, visit the + <a href="../index.html">JBossWeb site</a>. + </p> + <br/> +</section> +<section name="Who wrote the FAQ?"> +<p>This FAQ was originally written by :</p> +<p> +<ul> +<li>Mladen Turk<br/></li> +<li>Remy Maucheret<br/></li> +</ul> +</p> +<br/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/resources/faq01.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/faq01.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/faq01.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="faq01.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>General FAQ's</title> + </properties> + +<body> + +<section name="What is the JBossWeb Architecture?"> + <figure src="/images/design/jbosswebblockda.png" name="Figure 1" text="JBossWeb architecture"/> + <p>For detailed JBossWeb architecture documentation see + <a href="../reference/arch.html">Architecture section</a>. + </p> + <br/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/resources/faq02.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/faq02.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/faq02.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="faq02.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>HTTP FAQ's</title> + </properties> + +<body> + +<section name="How do I run JBossWeb on a specific port?"> + <todo note="show server.xml example"/> + <br/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/resources/faq03.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/faq03.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/faq03.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,33 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="faq03.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>HTTPS FAQ's</title> + </properties> + +<body> + +<section name="About Certificates"> + <br /> + <subsection name="What are RSA Private Keys, CSRs and Certificates?"> + The RSA private key file is a digital file that you can use to decrypt messages + sent to you. It has a public component which you distribute (via your Certificate file) + which allows people to encrypt those messages to you. A Certificate Signing Request + (CSR) is a digital file which contains your public key and your name. + You send the CSR to a Certifying Authority (CA) to be converted into a real Certificate. + A Certificate contains your RSA public key, your name, the name of the CA, + and is digitally signed by your CA. Browsers that know the CA can verify the + signature on that Certificate, thereby obtaining your RSA public key. + That enables them to send messages which only you can decrypt. + </subsection> + <br /> + <todo note="copy httpd's mod_ssl FAQ's"/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/resources/faq04.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/faq04.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/faq04.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,43 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="faq04.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>AJP FAQ's</title> + </properties> + +<body> + +<section name="What is AJP Protocol?"> +<p> +The <b>AJP13</b> protocol is packet-oriented. A binary format was +presumably chosen over the more readable plain text for reasons of +performance. The web server communicates with the servlet container over +TCP connections. To cut down on the expensive process of socket creation, +the web server will attempt to maintain persistent TCP connections to the +servlet container, and to reuse a connection for multiple request/response +cycles. +</p><p> +Once a connection is assigned to a particular request, it will not be +used for any others until the request-handling cycle has terminated. In +other words, requests are not multiplexed over connections. This makes +for much simpler code at either end of the connection, although it does +cause more connections to be open at once. +</p><p> +Once the web server has opened a connection to the servlet container, +the connection can be in one of the following states: +</p><p> +<ul> + <li> Idle <br/> No request is being handled over this connection. </li> + <li> Assigned <br/> The connecton is handling a specific request.</li> +</ul> +</p> +<br/> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/resources/project.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/project.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<project name="JBossWeb Documentation - Top Level Directory"> + <title>Resources</title> + <logo href="/images/jbossweblogo.gif">JBossWeb @ JBoss labs</logo> +<body> + + <menu name="Resources"> + <item name="FAQ" href="faq.html"/> + <item name="Tutorial" href="tut.html"/> + </menu> + <menu name="FAQ"> + <item name="General" href="faq01.html"/> + <item name="HTTP" href="faq02.html"/> + <item name="HTTPS" href="faq03.html"/> + <item name="AJP" href="faq04.html"/> + </menu> + <menu name="Tutorial"> + <item name="Geting started" href="tut01.html"/> + </menu> + <menu name="Links"> + <item name="Documentation Home" href="../index.html"/> + </menu> +</body> +</project> Added: trunk/labs/jbossweb/xdocs/resources/tut.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/tut.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/tut.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="tut.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Tutorials</title> + </properties> + +<body> + +<section name="Using the tutorial"> + <p>If you just want to learn how to run a stand-alone JBossWeb server with the + demonstrations supplied, start at the <a href="tut01.html">Getting Started</a> + section. This should give you a good feel for JBossWeb. + </p> +</section> +</body> +</document> Added: trunk/labs/jbossweb/xdocs/resources/tut01.xml =================================================================== --- trunk/labs/jbossweb/xdocs/resources/tut01.xml 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/resources/tut01.xml 2005-09-13 09:54:48 UTC (rev 1092) @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<!DOCTYPE document [ + <!ENTITY project SYSTEM "project.xml"> +]> +<document url="tut.html"> + + &project; + + <properties> + <author email="mla...@jb...">Mladen Turk</author> + <title>Getting started tutorial</title> + </properties> + +<body> + +<section name="Introduction"> + <p>Firstly, if you haven't already done it, you need to download JBossWeb. + </p> +</section> +</body> +</document> Modified: trunk/labs/jbossweb/xdocs/style.xsl =================================================================== --- trunk/labs/jbossweb/xdocs/style.xsl 2005-09-13 09:51:28 UTC (rev 1091) +++ trunk/labs/jbossweb/xdocs/style.xsl 2005-09-13 09:54:48 UTC (rev 1092) @@ -18,7 +18,7 @@ <xsl:param name="project-menu" select="'menu'"/> <xsl:param name="standalone" select="''"/> <xsl:param name="buglink" select="'http://jira.jboss.com/jira/browse/'"/> - + <xsl:param name="home-site" select="'http://labs.jboss.com/portal/index.html?ctrl:id=page.default.info&project=jbossweb'"/> <!-- Process an entire document into an HTML page --> <xsl:template match="document"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> @@ -71,7 +71,7 @@ </xsl:variable> <xsl:comment>PROJECT LOGO</xsl:comment> - <a href="{$home}"> + <a href="{$home-site}"> <img src="{$src}" align="right" alt="{$alt}" border="0"/> </a> </xsl:if> @@ -378,6 +378,11 @@ </div> </p> </xsl:template> + <xsl:template match="home"> + <a href="{$home-site}"> + <xsl:apply-templates/> + </a> + </xsl:template> <!-- Changelog related tags --> <xsl:template match="changelog"> |
From: <jbo...@li...> - 2005-09-13 09:51:44
|
Author: mla...@jb... Date: 2005-09-13 05:51:28 -0400 (Tue, 13 Sep 2005) New Revision: 1091 Removed: trunk/labs/jbossweb/xdocs/reference/ch01.xml trunk/labs/jbossweb/xdocs/reference/ch02.xml trunk/labs/jbossweb/xdocs/reference/ch03.xml Log: Remove chXX.xml files Deleted: trunk/labs/jbossweb/xdocs/reference/ch01.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/ch01.xml 2005-09-12 21:02:06 UTC (rev 1090) +++ trunk/labs/jbossweb/xdocs/reference/ch01.xml 2005-09-13 09:51:28 UTC (rev 1091) @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE document [ - <!ENTITY project SYSTEM "project.xml"> -]> -<document url="ch01.html"> - - &project; - - <properties> - <author email="mla...@jb...">Mladen Turk</author> - <title>Architecture</title> - </properties> - -<body> - -<section name="Design"> - <p>JBoss Web Server is based on the - <a href="http://tomcat.apache.org">Apache Tomcat</a>. - </p> - <figure src="/images/design/jbosswebblockda.png" name="Figure 1" text="JBossWeb architecture"/> -</section> -</body> -</document> Deleted: trunk/labs/jbossweb/xdocs/reference/ch02.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/ch02.xml 2005-09-12 21:02:06 UTC (rev 1090) +++ trunk/labs/jbossweb/xdocs/reference/ch02.xml 2005-09-13 09:51:28 UTC (rev 1091) @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE document [ - <!ENTITY project SYSTEM "project.xml"> -]> -<document url="ch02.html"> - - &project; - - <properties> - <author email="mla...@jb...">Mladen Turk</author> - <title>Tomcat Native</title> - </properties> - -<body> - -<section name="Design"> - <p>Tomcat Native uses <a href="http://apr.apache.org">APR</a> and - <a href="http://www.openssl.org">OpenSSL</a> - </p> - <figure src="/images/design/tcnativeblockda.png" name="Figure 2" text="Tomcat Native"/> -</section> -</body> -</document> Deleted: trunk/labs/jbossweb/xdocs/reference/ch03.xml =================================================================== --- trunk/labs/jbossweb/xdocs/reference/ch03.xml 2005-09-12 21:02:06 UTC (rev 1090) +++ trunk/labs/jbossweb/xdocs/reference/ch03.xml 2005-09-13 09:51:28 UTC (rev 1091) @@ -1,22 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE document [ - <!ENTITY project SYSTEM "project.xml"> -]> -<document url="ch03.html"> - - &project; - - <properties> - <author email="mla...@jb...">Mladen Turk</author> - <title>Hybrid connection model</title> - </properties> - -<body> - -<section name="Design"> - <p>Hybrid connection model - </p> - <figure src="/images/design/acceptflowchart.png" name="Figure 3" text="Accept flowchart"/> -</section> -</body> -</document> |
From: <jbo...@li...> - 2005-09-12 21:03:24
|
Author: szimano Date: 2005-09-12 17:02:06 -0400 (Mon, 12 Sep 2005) New Revision: 1090 Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp Log: servlet things Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-12 20:01:57 UTC (rev 1089) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/WikiPortlet.java 2005-09-12 21:02:06 UTC (rev 1090) @@ -19,6 +19,7 @@ import javax.portlet.*; import org.jboss.portlet.*; import org.jboss.wiki.fileaccess.WikiFileAccessFilter; +import org.jboss.wiki.management.WikiServiceMenagement; import org.apache.commons.fileupload.PortletDiskFileUpload; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.FileItem; @@ -43,11 +44,16 @@ public void init() { wikiEngine = new WikiEngine(); - //WikiCommon wikiCommon = new WikiCommon(); + WikiCommon wikiCommon = new WikiCommon(); - //WikiServiceMenagement wikiServiceMenagement = wikiCommon.getWikiManagement(); + WikiServiceMenagement wikiServiceMenagement = wikiCommon.getWikiManagement(); - //wikiServiceMenagement.setWikiEngine(wikiEngine); + wikiServiceMenagement.setWikiEngine(wikiEngine); + + if (wikiEngine == null) { + wikiEngine = new WikiEngine(); + wikiServiceMenagement.setWikiEngine(wikiEngine); + } } public void processAction(JBossActionRequest rReq, JBossActionResponse rResp) { Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-12 20:01:57 UTC (rev 1089) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/java/org/jboss/wiki/fileaccess/WikiFileAccessFilter.java 2005-09-12 21:02:06 UTC (rev 1090) @@ -18,6 +18,8 @@ import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -26,7 +28,10 @@ import javax.servlet.http.HttpServletResponse; import org.jboss.wiki.FileDataSource; +import org.jboss.wiki.WikiCommon; +import org.jboss.wiki.WikiEngine; import org.jboss.wiki.WikiPlugin; +import org.jboss.wiki.management.WikiServiceMenagement; // import org.jboss.forge.common.content.ContentManager; // import org.jboss.forge.common.ForgeHelper; @@ -43,20 +48,41 @@ * <code>BUF_SIZE</code> - size of a buffer, which is used while reading a * file and sending it to the client. */ + + public static final String specialPage = "!WikiButtons"; - public static final String specialPage = "!WikiButtons"; + public static final char specialChar = '!'; + private final int BUF_SIZE = 32768; private String attachementsPath; private String wikiHome; + private WikiEngine wikiEngine; + /* * private ForgeHelper forgeHelper; private ContentManager contentManager; */ private MimetypesFileTypeMap mimeTypes; public void init(FilterConfig conf) { + // get wikiEnigne form wikiMenagement + + wikiEngine = new WikiEngine(); + + WikiCommon wikiCommon = new WikiCommon(); + + WikiServiceMenagement wikiServiceMenagement = wikiCommon + .getWikiManagement(); + + wikiServiceMenagement.setWikiEngine(wikiEngine); + + if (wikiEngine == null) { + wikiEngine = new WikiEngine(); + wikiServiceMenagement.setWikiEngine(wikiEngine); + } + // load mime types map mimeTypes = new MimetypesFileTypeMap(WikiFileAccessFilter.class @@ -78,7 +104,7 @@ // get the host wikiHome = props.getProperty("wikiHome"); - + } catch (IOException e) { System.err.println(e); } @@ -88,8 +114,9 @@ } public void doFilter(ServletRequest request, ServletResponse response, - FilterChain chain) throws IOException { + FilterChain chain) throws IOException, ServletException { + if (request instanceof HttpServletRequest) { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; @@ -99,43 +126,57 @@ // Parse URI to get filename and page name String[] tokens = requestURI.split("[/]"); - //System.out.println("length " + tokens.length); + // System.out.println("length " + tokens.length); - if (tokens[tokens.length - 2].equals(specialPage)) { - // show apropriate buttons - InputStream imageIS = WikiFileAccessFilter.class.getResourceAsStream("/"+tokens[tokens.length - 1]); - - ServletOutputStream os = response.getOutputStream(); + if (tokens[tokens.length - 2].charAt(0) == specialChar) { + if (tokens[tokens.length - 2].equals(specialPage)) { + // show apropriate buttons + InputStream imageIS = WikiFileAccessFilter.class + .getResourceAsStream("/" + + tokens[tokens.length - 1]); - response.setContentType("image/png"); + ServletOutputStream os = response.getOutputStream(); - // Transferring the bytes - try { - byte[] buffer = new byte[BUF_SIZE]; - int read; - while ((read = imageIS.read(buffer)) != -1) - os.write(buffer, 0, read); - } catch (Exception e2) { - // Nothing that we can really do. Just send an incomplete - // file. - } finally { - os.close(); - imageIS.close(); + response.setContentType("image/png"); + + // Transferring the bytes + try { + byte[] buffer = new byte[BUF_SIZE]; + int read; + while ((read = imageIS.read(buffer)) != -1) + os.write(buffer, 0, read); + } catch (Exception e2) { + // Nothing that we can really do. Just send an + // incomplete + // file. + } finally { + os.close(); + imageIS.close(); + } + } - - } - else if (tokens.length == 3) { - String hostURL = ((request.isSecure()) ? "https" : "http") + "://"+request.getServerName()+((request.getServerPort() == 80) ? "" : ":"+ request.getServerPort()); - - httpResponse.sendRedirect(hostURL+wikiHome + "&page=" - + tokens[tokens.length - 1]); + else { + // show plugin with name after "!" + + } + } else if (tokens.length == 3) { + /*String hostURL = ((request.isSecure()) ? "https" : "http") + + "://" + + request.getServerName() + + ((request.getServerPort() == 80) ? "" : ":" + + request.getServerPort()); + + httpResponse.sendRedirect(hostURL + wikiHome + "&page=" + + tokens[tokens.length - 1]);*/ + request.getRequestDispatcher("/WEB-INF/jsp/Wiki.jsp").include(request, response); } else { // get fileName of attachement and page which is connected to String fileName = tokens[tokens.length - 1]; String pageName = tokens[tokens.length - 2]; - //System.out.println("[WikiFileAccess]Getting file: " + fileName - // + " of page: " + pageName); + // System.out.println("[WikiFileAccess]Getting file: " + + // fileName + // + " of page: " + pageName); Properties props = new Properties(); @@ -195,7 +236,202 @@ "This servlet should be called as HTTPServletRequest"); } } + + private void doServletDispatch(HttpServletRequest rReq, HttpServletResponse rResp) { + + //FIXME wrong url + String wikiURL = rReq.getRequestURI(); + rReq.setAttribute("actionURL", wikiURL); + + // Create server host and put it into session for plugins + String hostURL = ((rReq.isSecure()) ? "https" : "http") + "://"+rReq.getServerName()+((rReq.getServerPort() == 80) ? "" : ":"+ rReq.getServerPort()); + + rReq.getPortletSession().setAttribute("hostURL", hostURL); + rReq.getPortletSession().setAttribute("actionURL", wikiURL.toString()); + + rReq.getPortletSession().setAttribute("isSecure", + new Boolean(rReq.isSecure())); + + WikiPage noSuchPage = new WikiPage("", new Credentials(""), + "There is no such page. Click on EDIT to start it.", 0, 0, + null, wikiEngine.getMediaDataSource()); + + String page = "Wiki.jsp"; + + String wikiPage = defaultPage; + + WikiPage pageToShow = null; + + WikiContext wikiContext = null; + + if (rReq.getParameter("page") != null) { + wikiPage = rReq.getParameter("page"); + } + + if ((rReq.getParameter("action") != null) + && (rReq.getParameter("action").equals("Attach"))) { + rReq.setAttribute("fileAttach", "true"); + } + + if ((rReq.getParameter("action") != null) + && (rReq.getParameter("action").equals("Edit")) + && (rReq.getUser() != null)) { + page = "Edit.jsp"; + + pageToShow = wikiEngine.getByName(wikiPage, null); + + if (rReq.getParameter("version") != null) { + // show previous version of page + + System.out.println("Getting page " + wikiPage + " at version " + + rReq.getParameter("version")); + pageToShow = wikiEngine.getByName(wikiPage, null, Integer + .valueOf(rReq.getParameter("version"))); + + if (pageToShow.getLastVersion() != pageToShow.getVersion()) { + rReq.setAttribute("showedVersion", Integer.valueOf(rReq + .getParameter("version"))); + } + } else { + pageToShow = wikiEngine.getByName(wikiPage, null); + } + + if (pageToShow == null) { + // start editing new page + // wikiPage = defaultPage; + + pageToShow = new WikiPage(wikiPage, new Credentials(rReq + .getUser().getUserName()), "", 0, 0, new Date(), + wikiEngine.getMediaDataSource()); + // wikiEngine.getByName(wikiPage, wikiContext); + } + + Date dateLock = pageToShow.lock(rReq.getUser()); + + if (dateLock != null) { + rReq + .setAttribute( + "lockMsg", + "Page is locked by " + + pageToShow.getLockUser() + + " from " + + dateLock + + ".<br> I won't stop you from saving, but you or he can erease each other changes. Lock will expire: "); + } + + } else if ((rReq.getParameter("action") != null) + && (rReq.getParameter("action").equals("Info"))) { + page = "PageInfo.jsp"; + + pageToShow = wikiEngine.getByName(wikiPage, null); + + if (pageToShow == null) { // if somebody entered a link to info + // non-existing page + page = "Wiki.jsp"; + try { + pageToShow = (WikiPage) noSuchPage.clone(); + } catch (CloneNotSupportedException cnse) { + System.out.println(cnse); + } + + pageToShow.setName(wikiPage); + } else { + rReq.setAttribute("pageAtTop", pageToShow); + } + + } else { + page = "Wiki.jsp"; + + String type = "HTML"; + + if (rReq.getParameter("type") != null) { + type = rReq.getParameter("type"); + //System.out.println("Getting type: " + type); + } + + wikiContext = new WikiContext(rReq.getUser(), wikiEngine + .getWikiType(type), new PortletWikiSession(rReq + .getPortletSession())); + + if (rReq.getParameter("version") != null) { + // show previous version of page + System.out.println("Getting page " + wikiPage + " at version " + + rReq.getParameter("version")); + pageToShow = wikiEngine.getByName(wikiPage, wikiContext, + Integer.valueOf(rReq.getParameter("version"))); + + if (pageToShow.getLastVersion() != pageToShow.getVersion()) { + rReq.setAttribute("showedVersion", Integer.valueOf(rReq + .getParameter("version"))); + } + } else { + pageToShow = wikiEngine.getByName(wikiPage, wikiContext); + } + + if (pageToShow == null) { + + try { + pageToShow = (WikiPage) noSuchPage.clone(); + } catch (CloneNotSupportedException cnse) { + System.out.println(cnse); + } + + pageToShow.setName(wikiPage); + } + + } + + rReq + .setAttribute( + "wikiName", + "<img src=\""+hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/JBossWikiLogoMedium.png\" width=\"100\" border=\"0\" style=\"vertical-align: middle\"/>"); + + rReq.setAttribute("wikiContent", pageToShow.getContent()); + + rReq.setAttribute("wikiImagesUrl", hostURL+"/wiki/"+WikiFileAccessFilter.specialPage+"/"); + + rReq.setAttribute("wikiPage", wikiPage); + + rReq.setAttribute("editDate", pageToShow.getEditDate()); + + rReq.setAttribute("author", pageToShow.getLastAuthor()); + + rReq.setAttribute("logedIn", (rReq.getUser() != null) ? "true" + : "false"); + + rReq.setAttribute("defaultPage", defaultPage); + + // FIXME make this more elegant (ie. plugin) + // pass friendly link + /*Properties props = new Properties(); + props.load(WikiPlugin.class + .getResourceAsStream("wikiPlugins.properties")); + String href = props.getProperty("htmlTranslatorURL") + "wiki/" + + pageToShow.getName(); + String[] replaces = props.getProperty("sslRedirectReplaces").split(","); + + if (rReq.isSecure() && (replaces.length % 2 == 0)) { + // chage normal url to secure + for (int i = 0; i < replaces.length; i += 2) + href = href.replaceAll(replaces[i], replaces[i + 1]); + }*/ + + rReq.setAttribute("friendlyLink", hostURL+"/wiki/"+pageToShow.getName()); + + rRes.setTitle("Wiki"); + if (javax.portlet.WindowState.NORMAL.equals(rReq.getWindowState()) + || javax.portlet.WindowState.MAXIMIZED.equals(rReq + .getWindowState())) { + rRes.setContentType("text/html"); + javax.portlet.PortletRequestDispatcher pRD = this + .getPortletContext().getRequestDispatcher(jspPath + page); + pRD.include(rReq, rRes); + return; + } + doDispatch(rReq, rRes); + } + public void destroy() { } Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp 2005-09-12 20:01:57 UTC (rev 1089) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Edit.jsp 2005-09-12 21:02:06 UTC (rev 1090) @@ -4,10 +4,8 @@ See terms of license at gnu.org. --> -<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <%@ page isELIgnored ="false" %> -<portlet:defineObjects/> <% String actionURL = (String)request.getAttribute("actionURL"); Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-12 20:01:57 UTC (rev 1089) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/PageInfo.jsp 2005-09-12 21:02:06 UTC (rev 1090) @@ -4,10 +4,8 @@ See terms of license at gnu.org. --> -<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <%@ page isELIgnored ="false" %> -<portlet:defineObjects/> <% String actionURL = (String)request.getAttribute("actionURL"); Modified: trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp =================================================================== --- trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-12 20:01:57 UTC (rev 1089) +++ trunk/forge/portal-extensions/jbosswiki/forge-wiki/src/web/WEB-INF/jsp/Wiki.jsp 2005-09-12 21:02:06 UTC (rev 1090) @@ -4,10 +4,8 @@ See terms of license at gnu.org. --> -<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %> <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <%@ page isELIgnored ="false" %> -<portlet:defineObjects/> <% String actionURL = (String)request.getAttribute("actionURL"); |
From: <jbo...@li...> - 2005-09-12 20:02:02
|
Author: adamw Date: 2005-09-12 16:01:57 -0400 (Mon, 12 Sep 2005) New Revision: 1089 Modified: trunk/forge/portal-extensions/forge-kosmos/kosmos-server/src/java/hu/midori/kosmos/server/util/ChartUtils.java Log: JBLAB-381: Graph bug fixed? Modified: trunk/forge/portal-extensions/forge-kosmos/kosmos-server/src/java/hu/midori/kosmos/server/util/ChartUtils.java =================================================================== --- trunk/forge/portal-extensions/forge-kosmos/kosmos-server/src/java/hu/midori/kosmos/server/util/ChartUtils.java 2005-09-12 19:29:56 UTC (rev 1088) +++ trunk/forge/portal-extensions/forge-kosmos/kosmos-server/src/java/hu/midori/kosmos/server/util/ChartUtils.java 2005-09-12 20:01:57 UTC (rev 1089) @@ -122,6 +122,17 @@ public static PieDataset listToPieDataset(List<Map.Entry> data, int maxItems) { DefaultPieDataset dataset = new DefaultPieDataset(); + // Sorting the data wrt entry values (which are numbers), descending. + Collections.sort(data, new Comparator<Map.Entry>() { + public int compare(Map.Entry entry1, Map.Entry entry2) { + double d1 = ((Number) entry1.getValue()).doubleValue(); + double d2 = ((Number) entry2.getValue()).doubleValue(); + + if (d1 == d2) return 0; + return d1 < d2 ? 1 : -1; + } + }); + // generate dataset int counter = 0; for(Iterator it = data.iterator(); it.hasNext();) { |
From: <jbo...@li...> - 2005-09-12 19:30:04
|
Author: dam...@jb... Date: 2005-09-12 15:29:56 -0400 (Mon, 12 Sep 2005) New Revision: 1088 Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/bmsi/util/Diff.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/DifferenceEngine.java trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslator.java Log: Attributing to JSPWiki where necessary. Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/bmsi/util/Diff.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/bmsi/util/Diff.java 2005-09-12 18:37:48 UTC (rev 1087) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/bmsi/util/Diff.java 2005-09-12 19:29:56 UTC (rev 1088) @@ -1,12 +1,3 @@ -/************************************************** - * * - * JBoss Labs: Creating Professional Open Source * - * * - * Distributable under LGPL license. * - * See terms of license at gnu.org. * - * * - *************************************************/ - package bmsi.util; import java.util.Hashtable; Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/DifferenceEngine.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/DifferenceEngine.java 2005-09-12 18:37:48 UTC (rev 1087) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/DifferenceEngine.java 2005-09-12 19:29:56 UTC (rev 1088) @@ -7,6 +7,46 @@ * * *************************************************/ +/* + Copyright (C) 2005 Damon Sicore, + Rali Genova, + Tomasz Szymanski, + Adam Warski, + JBoss, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +/** +* Portions of this work are based on the work +* of Janne Jalkanen of the JSPWiki project. +* +* Marked Portions are Copyright (C) 2001-2002 Janne Jalkanen (Jan...@ik...) +* +* Those portions are marked by the 'author' javadoc tag +* and list Janne Jalkanen as the author of that method. +* +* This class is based on the JSPWiki 2.0 version +* of the DifferenceEngine.java class. The original +* version of that class can be found here: +* +* http://anonsvn.labs.jboss.com/branches/forge/archives/jspwiki/src/com/ecyrd/jspwiki/DifferenceEngine.java +* +*/ + package org.jboss.wiki.plugins; import java.util.Properties; Modified: trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslator.java =================================================================== --- trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslator.java 2005-09-12 18:37:48 UTC (rev 1087) +++ trunk/forge/portal-extensions/jbosswiki/wiki-common/src/java/org/jboss/wiki/plugins/HTMLTranslator.java 2005-09-12 19:29:56 UTC (rev 1088) @@ -7,6 +7,45 @@ * * *************************************************/ +/* + Copyright (C) 2005 Damon Sicore, + Rali Genova, + Tomasz Szymanski, + Adam Warski, + JBoss, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +/** +* Portions of this work are based on the work +* of Janne Jalkanen of the JSPWiki project. +* +* Marked Portions are Copyright (C) 2001-2002 Janne Jalkanen (Jan...@ik...) +* +* Those portions are marked by the 'author' javadoc tag +* and list Janne Jalkanen as the author of that method. +* +* This class is based on the JSPWiki 2.0 version +* of the TranslatorReader.java class. The original +* version of that class can be found here: +* +* http://anonsvn.labs.jboss.com/branches/forge/archives/jspwiki/src/com/ecyrd/jspwiki/TranslatorReader.java +* +*/ package org.jboss.wiki.plugins; /** @@ -971,4 +1010,4 @@ } -} \ No newline at end of file +} |
From: <jbo...@li...> - 2005-09-12 18:38:04
|
Author: adamw Date: 2005-09-12 14:37:48 -0400 (Mon, 12 Sep 2005) New Revision: 1087 Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesElementValue.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/ProjectURLTag.java trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/URLTag.java trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java trunk/forge/portal-extensions/portal-default/project.xml trunk/forge/portal-extensions/portal-default/src/java/org/jboss/forge/redirect/RedirectFilter.java Log: JBLAB-355: project main page as a freezone page Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectDescriptor.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -55,13 +55,17 @@ * project. * @param portalName * Name of the portal to which this project belongs to. + * @param adminProperties + * Properties that are set by the administrator, to be included + * while filling the context. * @throws SAXException * @throws IOException * @throws XmlNotFoundException */ public ProjectDescriptor(String projectId, XmlInputFactory isf, DomToXmlTransformer xht, OutsidePropertiesMap opm, - String portalName) throws SAXException, IOException, + String portalName, PropertiesMap adminProperties) + throws SAXException, IOException, XmlNotFoundException { this.portalName = portalName; @@ -77,6 +81,11 @@ thisProject = new ElementDescriptor(node, xht, getProjectPropertiesHandler(), getProjectExtendedPropertiesMap(), opm); + + // Adding properties set by the administrator. + if (adminProperties != null) { + thisProject.addProperties(adminProperties); + } // Trying to create a downloads descriptor. try { @@ -249,6 +258,23 @@ } /** + * Creates and returns a link to the project's main page. + * + * @return A link to this project's main page. + */ + public String getProjectLink() { + if (thisProject.hasProperty(ProjectsDescriptor.INFO_PAGE_ATTRIBUTE)) { + String infoPage = getProperty(ProjectsDescriptor.INFO_PAGE_ATTRIBUTE); + + return ProjectsHelper.createFreezonePageLink(portalName, + getId(), infoPage); + } else { + return ProjectsHelper.createPageLink(portalName, + getId(), "info"); + } + } + + /** * Checks if permission to read this project is allowed with permissions * set represented by the given permissions checker. * Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/Projects.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -110,6 +110,13 @@ public String getProjectName(String projectId) { return getProjectsDescriptor().getProjectName(projectId); } + + /** + * Gets the name of the project with the given id. + */ + public String getProjectLink(String projectId) { + return getProjectsDescriptor().getProjectLink(projectId); + } /** * Searches for the given string in project's names and descriptions. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsDescriptor.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -42,6 +42,12 @@ * @author adamw */ public class ProjectsDescriptor extends AbstractDescriptor { + /** + * <code>INFO_PAGE_ATTRIBUTE</code> - name of an xml attribute in which information + * on whether a freezone info page should be displayed instead of the standard one. + */ + static final String INFO_PAGE_ATTRIBUTE = "info-page"; + private static final Logger log = Logger.getLogger(ProjectsDescriptor.class); /** @@ -208,7 +214,7 @@ * and fills the projects list with that information. */ private void unmarshallProjects(Node root, XmlInputFactory isf, - DomToXmlTransformer xht, String portalName) { + DomToXmlTransformer xht, String portalName) { Node n; NodeList nodes = root.getChildNodes(); @@ -217,11 +223,21 @@ if ((n.getNodeType() == Node.ELEMENT_NODE) && (n.getNodeName().equals(PROJECT_EL))) { + PropertiesMap adminProperties = null; + + Node infoPageAttribute = n.getAttributes().getNamedItem(INFO_PAGE_ATTRIBUTE); + if ((infoPageAttribute != null) && + (infoPageAttribute.getNodeType() == Node.ATTRIBUTE_NODE)) { + adminProperties = new PropertiesMap(); + adminProperties.add(INFO_PAGE_ATTRIBUTE, unmarshallText(infoPageAttribute)); + } + String projectId = unmarshallText(n); ProjectDescriptor pd = null; try { pd = new ProjectDescriptor(projectId, - isf, xht, opm, portalName); + isf, xht, opm, portalName, + adminProperties); projects.put(projectId, pd); } catch (Exception e) { @@ -365,6 +381,18 @@ } /** + * Gets a link to the project witht he given id. + * @param projectId Id of the project. + * @return A link to the given project's main page. + */ + public String getProjectLink(String projectId) { + ProjectDescriptor pd = (ProjectDescriptor) projects.get(projectId); + if (pd == null) return ""; + + return pd.getProjectLink(); + } + + /** * Gets a set of names of resources which are descriptors of projects * represented by this ProjectsDescriptor instance. * @return Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/ProjectsHelper.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -157,4 +157,16 @@ + ".freezone&project=" + projectId + "&page=" + ForgeHelper.replace(page, "/", ForgeHelper.FREEZONE_SEPARATOR); } + + /** + * Creates a link to a portal page based on the given parameters. + * @param portalName Name of the portal. + * @param projectId Id of the project for which the page should be displayed. + * @param page Page to display. + * @return A link to the given portal page. + */ + public static String createPageLink(String portalName, String projectId, String page) { + return "/portal/index.html?ctrl:id=page." + portalName + + "." + page + "&project=" + projectId; + } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/ElementDescriptor.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -12,6 +12,7 @@ import org.jboss.forge.common.projects.DomToXmlTransformer; import org.jboss.forge.common.projects.permissions.PermissionsChecker; import org.jboss.portal.common.context.DelegateContext; +import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -128,11 +129,23 @@ epm.getBindingsHandlersStack().fillContext(bindings, context, pc); opm.getBindingsHandlersStack().fillContext(bindings, context, pc); } - + private void unmarshallElement(Node root, DomToXmlTransformer xht) { Node n; + + // Processing attributes. + NamedNodeMap nnm = root.getAttributes(); + if (nnm != null) { + for (int i=0; i<nnm.getLength(); i++) { + n = nnm.item(i); + if (n.getNodeType() == Node.ATTRIBUTE_NODE) { + properties.add(n.getNodeName(), unmarshallText(n)); + } + } + } + + // Processing nested elements. NodeList nodes = root.getChildNodes(); - for (int i = 0; i < nodes.getLength(); i++) { n = nodes.item(i); @@ -214,6 +227,26 @@ } /** + * Checks if the given property name has any values. + * + * @param propertyName + * Name of the property. + * @return True iff the given property has any values. + */ + public boolean hasProperty(String propertyName) { + return properties.hasValues(propertyName); + } + + /** + * Adds to the currently held properties, properties from the + * given properties map. + * @param pm Properties map from which to add the properties. + */ + public void addProperties(PropertiesMap pm) { + properties.add(pm); + } + + /** * Checks if data from this element descriptor can be read by a user who's * permissions can be checked using the provided permissions checker. * @param pc Permissions checker with which permissions can be checked. Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesElementValue.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesElementValue.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesElementValue.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -36,25 +36,56 @@ */ public PropertiesElementValue(String initialValue) { this(); - addValue(initialValue); + add(initialValue); } + + /** + * Crates a new instance with values copied from the given + * element values. + * + * @param initialValues + * Initial values to add. + */ + public PropertiesElementValue(PropertiesElementValue initialValues) { + this(); + add(initialValues); + } + private void singleToMulti() { + multi = new ArrayList<String>(); + + if (single != null) { + multi.add(single); + single = null; + } + } + /** + * Adds all values from the given element values. + * + * @param ev + * Values to add. + */ + public void add(PropertiesElementValue ev) { + // Converting our values to a list of values. + singleToMulti(); + multi.addAll(ev.getAllValues()); + } + + /** * Adds a value. * * @param value * Value to add. */ - public void addValue(String value) { + public void add(String value) { if ((single == null) && (multi == null)) single = value; else if (multi != null) multi.add(value); else { - multi = new ArrayList<String>(); - multi.add(single); + singleToMulti(); multi.add(value); - single = null; } } @@ -68,7 +99,7 @@ if (multi == null) return null; - return (String) multi.get(0); + return multi.get(0); } return single; @@ -81,9 +112,7 @@ */ public List<String> getAllValues() { if (single != null) { - multi = new ArrayList<String>(); - multi.add(single); - single = null; + singleToMulti(); } return multi; Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/projects/elements/PropertiesMap.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -40,7 +40,7 @@ if (ev == null) properties.put(key, new PropertiesElementValue(value)); else - ev.addValue(value); + ev.add(value); } /** @@ -80,4 +80,32 @@ public boolean hasValues(String key) { return properties.containsKey(key); } + + /** + * Binds with the given key, the given element values. + * + * @param key + * Key which to bind. + * @param value + * Values which should be added to the currently held values under + * the given key. + */ + public void add(String key, PropertiesElementValue value) { + PropertiesElementValue ev = (PropertiesElementValue) properties.get(key); + if (ev == null) + properties.put(key, new PropertiesElementValue(value)); + else + ev.add(value); + } + + /** + * Adds all properties from the given properties map to this properties + * map. + * @param pm A properties map from which to add all the properties. + */ + public void add(PropertiesMap pm) { + for (String key : pm.properties.keySet()) { + add(key, pm.properties.get(key)); + } + } } Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/ProjectURLTag.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/ProjectURLTag.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/ProjectURLTag.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -37,12 +37,25 @@ this.page = page; } + private String getSelectedProject() { + return + project.equals(SELECTED_PROJECT) ? + pageContext.getRequest().getAttribute(ProjectsHelper.PROJECT_ID).toString() + : project; + } + public int doStartTag() throws JspException { - return writeURL("/portal/index.html", "ctrl:id", "page."+ + if ((page == null) || ("info".equals(page))) { + write(ProjectsHelper.getProjects( + pageContext.getRequest().getAttribute(ForgeHelper.PORTAL_NAME).toString()). + getProjectLink(getSelectedProject())); + } else { + writeURL("/portal/index.html", "ctrl:id", "page."+ pageContext.getRequest().getAttribute(ForgeHelper.PORTAL_NAME)+"."+page+"&project="+ - (project.equals(SELECTED_PROJECT) ? - pageContext.getRequest().getAttribute(ProjectsHelper.PROJECT_ID).toString() - : project)); + getSelectedProject()); + } + + return EVAL_BODY_BUFFERED; } public void release() { Modified: trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/URLTag.java =================================================================== --- trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/URLTag.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-common/src/java/org/jboss/forge/common/taglib/URLTag.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -27,23 +27,27 @@ public void setForm(String form) { this.form = form; } - - public int writeURL(String baseURL, String paramName, String paramValue) throws JspException { - try { - if ((form == null) || ((!form.equals("formAction")) && (!form.equals("formField")))) - pageContext.getOut().write(baseURL+"?"+paramName+"="+paramValue); - else - if (form.equals("formAction")) - pageContext.getOut().write(baseURL); - else - pageContext.getOut().write("<input type=\"hidden\" name=\""+paramName+ - "\" value=\""+paramValue+"\" />"); + + public void write(String toWrite) throws JspException { + try { + pageContext.getOut().write(toWrite); } catch (IOException e) { - throw new JspException(); + throw new JspException(e); } - - return EVAL_BODY_BUFFERED; } + + public int writeURL(String baseURL, String paramName, String paramValue) throws JspException { + if ((form == null) || ((!form.equals("formAction")) && (!form.equals("formField")))) + write(baseURL+"?"+paramName+"="+paramValue); + else + if (form.equals("formAction")) + write(baseURL); + else + write("<input type=\"hidden\" name=\""+paramName+ + "\" value=\""+paramValue+"\" />"); + + return EVAL_BODY_BUFFERED; + } public int doAfterBody() throws JspTagException { BodyContent bc = getBodyContent(); Modified: trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java =================================================================== --- trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/forge-freezone/src/java/org/jboss/forge/projects/freezone/Freezone.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -213,10 +213,16 @@ // Replacing images while ((nextRef = findNextReference(pageContent, "image")) != null) { - nextRef2 = modifyPath(pagePath, nextRef); - pageContent = ForgeHelper.replace(pageContent, "<img src=" + if (!isExternalLink(nextRef)) { + nextRef2 = modifyPath(pagePath, nextRef); + + pageContent = ForgeHelper.replace(pageContent, "<img src=" + '"' + nextRef + '"', "*img src=" + '"' + fileAccessPrepend + nextRef2 + '"'); + } else + pageContent = ForgeHelper.replace(pageContent, "<img src=" + + '"' + nextRef + '"', "*img src=" + '"' + + nextRef + '"'); } // fix back internal links Modified: trunk/forge/portal-extensions/portal-default/project.xml =================================================================== --- trunk/forge/portal-extensions/portal-default/project.xml 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/portal-default/project.xml 2005-09-12 18:37:48 UTC (rev 1087) @@ -21,26 +21,17 @@ <artifactId>javasvn</artifactId> <version>1.0</version> <jar>javasvn.jar</jar> - <properties> - <war.bundle>true</war.bundle> - </properties> </dependency> <dependency> <groupId>tmate</groupId> <artifactId>jsch</artifactId> <version>1.0</version> <jar>jsch.jar</jar> - <properties> - <war.bundle>true</war.bundle> - </properties> </dependency> <dependency> <groupId>jboss-forge</groupId> <artifactId>forge-common</artifactId> <version>1.0</version> - <properties> - <war.bundle>true</war.bundle> - </properties> </dependency> <dependency> <groupId>aslibs</groupId> Modified: trunk/forge/portal-extensions/portal-default/src/java/org/jboss/forge/redirect/RedirectFilter.java =================================================================== --- trunk/forge/portal-extensions/portal-default/src/java/org/jboss/forge/redirect/RedirectFilter.java 2005-09-12 18:07:58 UTC (rev 1086) +++ trunk/forge/portal-extensions/portal-default/src/java/org/jboss/forge/redirect/RedirectFilter.java 2005-09-12 18:37:48 UTC (rev 1087) @@ -14,6 +14,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.jboss.forge.common.projects.ProjectsHelper; + /** * A filter redirecting addresses: /<.war name> to /portal/<forge portal * name> /<.war name>/<project name> to /portal/<forge portal name>/<project @@ -43,16 +45,14 @@ String requestURI = httpRequest.getRequestURI(); String[] tokens = requestURI.split("[/]"); - String page; + String redirectTo; if ((tokens.length > 2) && (!tokens[2].equals(""))) - page = "index.html?ctrl:id=page." - + FORGE_PORTAL + ".info&project=" - + tokens[2]; + redirectTo = ProjectsHelper.getProjects(FORGE_PORTAL).getProjectLink(tokens[2]); else - page = FORGE_PORTAL; + redirectTo = "/portal/" + FORGE_PORTAL; - httpResponse.sendRedirect("/portal/" + page); + httpResponse.sendRedirect(redirectTo); } else { response.setContentType("text/html"); response.getWriter().write(WRONG_REQ_RESP); |
From: <jbo...@li...> - 2005-09-12 18:08:08
|
Author: dam...@jb... Date: 2005-09-12 14:07:58 -0400 (Mon, 12 Sep 2005) New Revision: 1086 Added: branches/forge/archives/jspwiki-new/ Removed: trunk/forge/portal-extensions/jspwiki-new/ Log: Archiving original version of JSPWiki that we used for reference of HTML Translator and diff. Copied: branches/forge/archives/jspwiki-new (from rev 1085, trunk/forge/portal-extensions/jspwiki-new) |
From: <jbo...@li...> - 2005-09-12 18:07:25
|
Author: dam...@jb... Date: 2005-09-12 14:07:20 -0400 (Mon, 12 Sep 2005) New Revision: 1085 Added: branches/forge/archives/jspwiki/ Removed: trunk/forge/portal-extensions/jspwiki/ Log: Archiving original version of JSPWiki that we used for reference of HTML Translator and diff. Copied: branches/forge/archives/jspwiki (from rev 1084, trunk/forge/portal-extensions/jspwiki) |