Author: bdaw
Date: 2007-08-01 06:45:19 -0400 (Wed, 01 Aug 2007)
New Revision: 7853
Added:
trunk/web-clipping/
trunk/web-clipping/build.bat
trunk/web-clipping/build.sh
trunk/web-clipping/build.xml
trunk/web-clipping/src/
trunk/web-clipping/src/main/
trunk/web-clipping/src/main/org/
trunk/web-clipping/src/main/org/jboss/
trunk/web-clipping/src/main/org/jboss/portal/
trunk/web-clipping/src/main/org/jboss/portal/webclipping/
trunk/web-clipping/src/main/org/jboss/portal/webclipping/WebClippingPortlet.java
trunk/web-clipping/src/resources/
trunk/web-clipping/src/resources/test/
trunk/web-clipping/src/resources/web-clipping-war/
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/jsp/
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/jsp/edit.jsp
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet-instances.xml
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet.xml
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/web.xml
Log:
add web-clipping module
Added: trunk/web-clipping/build.bat
===================================================================
--- trunk/web-clipping/build.bat (rev 0)
+++ trunk/web-clipping/build.bat 2007-08-01 10:45:19 UTC (rev 7853)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1140 2005-11-25 23:38:58Z julien $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/web-clipping/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/web-clipping/build.sh
===================================================================
--- trunk/web-clipping/build.sh (rev 0)
+++ trunk/web-clipping/build.sh 2007-08-01 10:45:19 UTC (rev 7853)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1140 2005-11-25 23:38:58Z julien $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools'
module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/web-clipping/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/web-clipping/build.xml
===================================================================
--- trunk/web-clipping/build.xml (rev 0)
+++ trunk/web-clipping/build.xml 2007-08-01 10:45:19 UTC (rev 7853)
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This 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 software 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 software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 5448 2006-10-13 19:29:17Z chris.laprun(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable"
depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="jboss/backport.concurrent.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="portletbridge.portletbridge.classpath"/>
+ <path refid="apache.beanutils.classpath"/>
+ <path refid="apache.codec.classpath"/>
+ <path refid="apache.collections.classpath"/>
+ <path refid="apache.digester.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
+ <path refid="apache.logging.classpath"/>
+ <path refid="apache.xalan.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="nekohtml.nekohtml.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+ <call target="configure-explode"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ </target>
+
+ <target name="configure-explode">
+
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <!-- widget-lib.jar -->
+ <mkdir dir="${build.lib}"/>
+ <jar jarfile="${build.lib}/web-clipping-lib.jar">
+ <fileset dir="${build.classes}"/>
+ </jar>
+
+ <!-- widget.war -->
+ <copy todir="${build.resources}/web-clipping.war">
+ <fileset dir="${build.resources}/web-clipping-war"/>
+ </copy>
+
+ <copy todir="${build.resources}/web-clipping.war/WEB-INF/lib">
+ <fileset dir="${build.lib}"
includes="web-clipping-lib.jar"/>
+ <fileset dir="${portletbridge.portletbridge.lib}"
includes="portletbridge-core-1.0.jar, portletbridge-portlet.jar"/>
+ <fileset dir="${apache.beanutils.lib}"
includes="commons-beanutils.jar"/>
+ <fileset dir="${apache.codec.lib}"
includes="commons-codec.jar"/>
+ <fileset dir="${apache.collections.lib}"
includes="commons-collections.jar"/>
+ <fileset dir="${apache.digester.lib}"
includes="commons-digester-1.6.jar"/>
+ <fileset dir="${apache.httpclient.lib}"
includes="commons-httpclient.jar"/>
+ <!--<fileset dir="${apache.logging.lib}"
includes=""/>-->
+ <!--<fileset dir="${apache.commons.lib}"
includes="commons-beanutils.jar, commons-collections.jar, commons-digester-1.6.jar,
+ commons-httpclient.jar,
commons-logging.jar, "/>-->
+ <!--<fileset dir="${apache.log4j.lib}"
includes="log4j.jar"/>-->
+ <fileset dir="${apache.xalan.lib}"
includes="xalan.jar"/>
+ <fileset dir="${apache.xerces.lib}" includes="xercesImpl.jar,
xml-apis.jar, resolver.jar"/>
+ <fileset dir="${nekohtml.nekohtml.lib}"
includes="nekohtml.jar"/>
+ </copy>
+
+ </target>
+
+
+ <target name="output"
+ description="Generate all target output."
+ depends="artifacts">
+
+ <implode
+ dir="${build.resources}/web-clipping.war"
+ tofile="${build.lib}/web-clipping.war"/>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/web-clipping.war"
todir="${jboss.home}/server/${portal.deploy.dir}"/>
+ </target>
+
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/web-clipping.war"/>
+ </target>
+
+ <target name="package-tests" depends="init, output">
+ <!--Empty for now-->
+ <!--<jar jarfile="${build.lib}/portal-widget-test-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/**"/>
+ <fileset dir="${build.resources}/portal-widget-test-jar"/>
+ </jar>-->
+
+ </target>
+
+ <target name="tests" depends="init, package-tests">
+ <property name="proto-libs"
value="${project.root}/proto-libs"/>
+ <execute-tests>
+<!--
+
+ <x-sysproperty>
+ <jvmarg value="-Xdebug"/>
+ <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
+ </x-sysproperty>
+-->
+
+
+ <x-test>
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.widget.google.PreferencesTestCase"/>-->
+ </x-test>
+ <x-classpath>
+ <pathelement location="${build.lib}/web-clipping-lib.jar"/>
+ <pathelement location="${build.resources}/test"/>
+
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="apache.commons.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="apache.logging.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="apache.collections.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="apache.logging.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+
+</project>
Property changes on: trunk/web-clipping/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/web-clipping/src/main/org/jboss/portal/webclipping/WebClippingPortlet.java
===================================================================
--- trunk/web-clipping/src/main/org/jboss/portal/webclipping/WebClippingPortlet.java
(rev 0)
+++
trunk/web-clipping/src/main/org/jboss/portal/webclipping/WebClippingPortlet.java 2007-08-01
10:45:19 UTC (rev 7853)
@@ -0,0 +1,33 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This 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 software 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 software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.jboss.portal.webclipping;
+
+import org.portletbridge.portlet.PortletBridgePortlet;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class WebClippingPortlet extends PortletBridgePortlet
+{
+}
Added: trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/jsp/edit.jsp
===================================================================
--- trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/jsp/edit.jsp
(rev 0)
+++ trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/jsp/edit.jsp 2007-08-01
10:45:19 UTC (rev 7853)
@@ -0,0 +1,147 @@
+<%@ page import="org.jboss.portal.widget.google.provider.GGQueryResult"
%>
+<%@ page import="org.jboss.portal.widget.google.provider.GGProvider" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="org.jboss.portal.widget.google.GGWidget" %>
+<%@ page import="org.jboss.portal.widget.google.GGPreferenceInfo" %>
+<%@ page import="org.jboss.portal.widget.google.type.DataType" %>
+<%@ page import="org.jboss.portal.widget.google.GGWidgetCategoryInfo" %>
+<%@ page import="org.jboss.portal.widget.google.provider.GGQuery" %>
+<%@ page import="org.jboss.portal.widget.google.type.EnumType" %>
+<%@ page language="java"%>
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="p" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+<div>
+
+Temporary Edit Page
+<%--<%
+ // Get useful request attributes
+ GGWidget selWidget = (GGWidget)request.getAttribute("selectedWidget");
+ GGProvider provider = (GGProvider)request.getAttribute("provider");
+
+ // Get query term
+ String queryTerm = request.getParameter("query");
+ if (queryTerm == null)
+ {
+ queryTerm = "";
+ }
+
+ // Get category term
+ String catTerm = request.getParameter("cat");
+ if (catTerm == null)
+ {
+ catTerm = "";
+ }
+
+ // Compute query
+ GGQuery query = new GGQuery(0, catTerm, queryTerm);
+ GGQueryResult result = provider.search(query);
+%>
+
+
+<form action="<p:renderURL></p:renderURL>"
method="post">
+ <input type="text" name="query"
class="portlet-form-field"/>
+ <select name="cat" class="portlet-form-field">
+ <option value=""> </option>
+ <%
+ for (Iterator i = provider.getCategories().iterator(); i.hasNext();)
+ {
+ GGWidgetCategoryInfo cat = (GGWidgetCategoryInfo)i.next();
+ boolean selected = cat.getName().equals(catTerm);
+ %>
+ <option value="<%= cat.getName() %>" <%= selected ?
"selected=\"selected\"" : "" %>><%=
cat.getDisplayName() %></option>
+ <%
+ }
+ %>
+ </select>
+ <input type="submit" value="Search Gadgets"
class="portlet-form-button"/>
+</form>
+
+<%
+ if (selWidget != null)
+ {
+%>
+<p>You have selected the widget <%= selWidget.getTitle().getDefaultString()
%></p>
+<p>
+ <form action="<p:actionURL><p:param
name="content.action.select" value="select"/><p:param
name="content.uri" value="<%= selWidget.getId()
%>"/></p:actionURL>" method="post">
+ <%
+ for (Iterator i =
selWidget.getPreferencesInfo().getPreferencesInfo().iterator(); i.hasNext();)
+ {
+ GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
+ if (prefInfo.getType().getOrdinal() == DataType.HIDDEN)
+ {
+
+ %>
+ <input type="hidden" name="content.param.<%=
prefInfo.getName() %>" value="<%= prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "" %>"/>
+ <%
+ }
+ }
+ %>
+ <table>
+ <tbody>
+ <%
+ for (Iterator i =
selWidget.getPreferencesInfo().getPreferencesInfo().iterator(); i.hasNext();)
+ {
+ GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
+ %>
+ <tr>
+ <td><%= prefInfo.getName() %>:</td>
+ <%
+ switch (prefInfo.getType().getOrdinal())
+ {
+ case DataType.HIDDEN:
+ break;
+ case DataType.ENUM:
+ %>
+ <td><select name="content.param.<%= prefInfo.getName()
%>" class="portlet-form-field">
+ <%
+ EnumType e = (EnumType)prefInfo.getType();
+ for (int j = 0;j < e.getSize();j++)
+ {
+ EnumType.Value value = e.getValue(j);
+ boolean selected =
value.getValue().equals(prefInfo.getDefaultValue());
+ %>
+ <option <%= selected ?
"selected=\"selected\"" : "" %> value="<%=
value.getValue() %>"><%= value.getDisplayValue() != null ?
value.getDisplayValue() : value.getValue() %></option>
+ <%
+ }
+ %>
+ </select></td>
+ <%
+ break;
+ default:
+ %>
+ <td><input type="text" name="content.param.<%=
prefInfo.getName() %>" class="portlet-form-field" value="<%=
prefInfo.getDefaultValue() != null ? prefInfo.getDefaultValue() : ""
%>"/></td>
+ <%
+ break;
+ }
+ %>
+ </tr>
+ <%
+ }
+ %>
+ <tr>
+ <td colspan="2"><input type="submit"
value="Select" class="portlet-form-button"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
+</p>
+<%
+ }
+%>
+
+<ul>
+ <%
+ for (Iterator i = result.getWidgetIterator();i.hasNext();)
+ {
+ GGWidget widget = (GGWidget)i.next();
+ %>
+ <li><a href="<p:renderURL><p:param name="op"
value="select"/><p:param name="uri" value="<%=
widget.getId() %>"/><p:param name="cat" value="<%= catTerm
%>"/></p:renderURL>"><%= widget.getTitle().getDefaultString()
%></a></li>
+ <%
+ }
+ %>
+</ul>--%>
+
+</div>
+
\ No newline at end of file
Added: trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet-instances.xml
(rev 0)
+++
trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet-instances.xml 2007-08-01
10:45:19 UTC (rev 7853)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This 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 software 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 software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>WebClippingPortletInstance</instance-id>
+ <portlet-ref>WebClippingPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Added: trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet.xml
===================================================================
--- trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet.xml
(rev 0)
+++ trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/portlet.xml 2007-08-01
10:45:19 UTC (rev 7853)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This 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 software 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 software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Web Clipping Portlet</description>
+ <portlet-name>WebClippingPortlet</portlet-name>
+ <display-name>Web Clipping Portlet</display-name>
+
<portlet-class>org.jboss.portal.webclipping.WebClippingPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+
+
<resource-bundle>org.portletbridge.portlet.PortletBridgePortlet</resource-bundle>
+
+ <portlet-info>
+ <title>Web Clipping</title>
+ <keywords>web clipping</keywords>
+ </portlet-info>
+
+ <expiration-cache>-1</expiration-cache>
+
+ <init-param>
+ <name>mementoSessionKey</name>
+ <value>mementoSessionKey</value>
+ </init-param>
+
+ <init-param>
+ <name>parserClassName</name>
+ <value>org.cyberneko.html.parsers.SAXParser</value>
+ </init-param>
+
+ <init-param>
+ <name>editStylesheet</name>
+ <value>classpath:/org/portletbridge/xsl/pages/edit.xsl</value>
+ </init-param>
+
+ <init-param>
+ <name>helpStylesheet</name>
+ <value>classpath:/org/portletbridge/xsl/pages/help.xsl</value>
+ </init-param>
+
+ <init-param>
+ <name>errorStylesheet</name>
+ <value>classpath:/org/portletbridge/xsl/pages/error.xsl</value>
+ </init-param>
+
+ <init-param>
+ <name>stylesheetUrl</name>
+ <value>classpath:/org/portletbridge/xsl/default.xsl</value>
+ </init-param>
+
+ <init-param>
+ <name>cssRegex</name>
+
<value>(?:url\((?:'|")?(.*?)(?:'|")?\))|(?:@import\s+[^url](?:'|")?(.*?)(?:'|")|;|\s+|$)</value>
+ </init-param>
+
+ <init-param>
+ <name>jsRegex</name>
+
<value>open\('([^']*)'|open\("([^\"]*)"</value>
+ </init-param>
+
+ <init-param>
+ <name>servletName</name>
+ <value>pbhs</value>
+ </init-param>
+
+ <init-param>
+ <name>idParamKey</name>
+ <value>id</value>
+ </init-param>
+
+ <init-param>
+ <name>authenticatorClassName</name>
+ <value>org.portletbridge.portlet.DefaultBridgeAuthenticator</value>
+ </init-param>
+
+ <init-param>
+ <name>initUrlFactoryClassName</name>
+ <value>org.portletbridge.portlet.DefaultInitUrlFactory</value>
+ </init-param>
+
+ <portlet-preferences>
+ <preference>
+ <name>secureEdit</name>
+ <value>false</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>initUrl</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>scope</name>
+ <value>.*</value>
+ </preference>
+ <preference>
+ <name>authentication</name>
+ <value>none</value>
+ </preference>
+ <preference>
+ <name>authenticationUsername</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>authenticationPassword</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>authenticationHost</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>authenticationDomain</name>
+ <value></value>
+ </preference>
+ <!--preference>
+ <name>proxyHost</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>proxyPort</name>
+ <value>80</value>
+ </preference-->
+ <preference>
+ <name>proxyAuthentication</name>
+ <value>none</value>
+ </preference>
+ <preference>
+ <name>proxyAuthenticationUsername</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>proxyAuthenticationPassword</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>proxyAuthenticationHost</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>proxyAuthenticationDomain</name>
+ <value></value>
+ </preference>
+ <preference>
+ <name>stylesheet</name>
+ <value></value>
+ </preference>
+
+
<preferences-validator>org.portletbridge.portlet.PortletBridgePortletValidator</preferences-validator>
+
+ </portlet-preferences>
+
+ <security-role-ref>
+ <role-name>portletbridge</role-name>
+ <role-link>portletbridge</role-link>
+ </security-role-ref>
+
+ </portlet>
+</portlet-app>
Added: trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/web.xml
===================================================================
--- trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/web.xml
(rev 0)
+++ trunk/web-clipping/src/resources/web-clipping-war/WEB-INF/web.xml 2007-08-01 10:45:19
UTC (rev 7853)
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This 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 software 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 software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+ <!--<context-param>
+ <param-name>org.jboss.portal.content_type</param-name>
+ <param-value>web-clipping/portletbridge</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.jboss.portal.portlet_instance</param-name>
+ <param-value>GoogleWidgetPortletInstance</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portlet.content.ContentTypeRegistration</listener-class>
+ </listener>-->
+
+ <display-name>Web Clipping Portlet</display-name>
+
+ <servlet>
+ <servlet-name>pbhs</servlet-name>
+
<servlet-class>org.portletbridge.portlet.PortletBridgeServlet</servlet-class>
+ <init-param>
+ <param-name>mementoSessionKey</param-name>
+ <param-value>mementoSessionKey</param-value>
+ </init-param>
+ <init-param>
+ <param-name>cssRegex</param-name>
+
<param-value>(?:url\((?:'|")?(.*?)(?:'|")?\))|(?:@import\s+[^url](?:'|")?(.*?)(?:'|")|;|\s+|$)</param-value>
+ </init-param>
+ <init-param>
+ <param-name>jsRegex</param-name>
+
<param-value>open\('([^']*)'|open\("([^\"]*)"</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ignoreRequestHeaders</param-name>
+ <param-value>accept-encoding,connection,keep-alive</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ignorePostToGetRequestHeaders</param-name>
+ <param-value>content-type,content-length</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>pbhs</servlet-name>
+ <url-pattern>/pbhs/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>