[seam-commits] Seam SVN: r9235 - in trunk/examples/wiki: src/etc and 14 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Oct 8 16:54:01 EDT 2008


Author: christian.bauer at jboss.com
Date: 2008-10-08 16:54:01 -0400 (Wed, 08 Oct 2008)
New Revision: 9235

Added:
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/FilteringSelector.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/FlashVideoPreferences.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flashVideo.xhtml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/default/img/
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/default/img/flashvideoplayer.swf
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/inrelationto/img/
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/inrelationto/img/flashvideoplayer.swf
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/sfwkorg/img/
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/sfwkorg/img/flashvideoplayer.swf
Modified:
   trunk/examples/wiki/README.txt
   trunk/examples/wiki/build.xml
   trunk/examples/wiki/src/etc/WEB-INF/web.xml
   trunk/examples/wiki/src/etc/production.sql
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java
   trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Basic.plugin.xml
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Flash.java
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/i18n/messages_basic_en.properties
   trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flash.xhtml
   trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml
Log:
New flash video player plugin and minor fixes for 2.1 release

Modified: trunk/examples/wiki/README.txt
===================================================================
--- trunk/examples/wiki/README.txt	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/README.txt	2008-10-08 20:54:01 UTC (rev 9235)
@@ -12,12 +12,12 @@
 INSTALLATION WITH MYSQL (development profile)
 ==========================================================================================
 
-- Install JBoss Application Server 4.2.2 GA
+- Install JBoss Application Server 4.2.3 GA
 
 - Edit build.properties
 
 - Upgrade/downgrade the Hibernate libraries to the ones bundled with this application:
-  'ant upgradehibernate' will replace the libraries in server/default/lib of JBoss AS 4.2.2
+  'ant upgradehibernate' will replace the libraries in server/default/lib of JBoss AS 4.2.3
   and also copy the required ehcache.jar.
   (Sorry, but no other version works currently and the 4.2.2 bundled libraries are too old.)
 
@@ -37,7 +37,7 @@
 INSTALLATION WITH MYSQL (production profile)
 ==========================================================================================
 
-- Install JBoss Application Server 4.2.2 GA
+- Install JBoss Application Server 4.2.3 GA
 
 - Upgrade/downgrade the Hibernate libraries bundled with JBoss AS to the libraries bundled
   with this application. Follow the steps outlined above (edit build.properties, call
@@ -97,15 +97,19 @@
 soon as you try to store any non-latin character.
 
 Note that due to URL rewriting rules, stored wiki items (documents, uploaded files) MUST have
-at least 3 latin-1 characters in their name! The application will prompt you with a validation
-error message when you forget that limitation and enter only non-latin-1 characters in a form.
+at least three latin1 characters in their name! The application will prompt you with a validation
+error message when you forget that limitation and enter only non-latin1 characters in a form.
 
 The wiki search engine passes search terms as request parameters in the URI. If you require
 unicode support for search terms, you need to set an option in Tomcat to enable the correct
 decoding of URL-encoded request parameter values to UTF-8. To do that, edit
+
   ${JBOSS_HOME}/server/(default)/deploy/jboss-web.deployer/server.xml
+
 and add
+
   URIEncoding="UTF-8"
+
 to the <connector> declaration.
 
 

Modified: trunk/examples/wiki/build.xml
===================================================================
--- trunk/examples/wiki/build.xml	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/build.xml	2008-10-08 20:54:01 UTC (rev 9235)
@@ -105,6 +105,7 @@
         <include name="**/*.jpeg"/>
         <include name="**/*.png"/>
         <include name="**/*.css"/>
+        <include name="**/*.swf"/>
         <include name="**/*.xhtml"/>
     </patternset>
 

Modified: trunk/examples/wiki/src/etc/WEB-INF/web.xml
===================================================================
--- trunk/examples/wiki/src/etc/WEB-INF/web.xml	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/etc/WEB-INF/web.xml	2008-10-08 20:54:01 UTC (rev 9235)
@@ -5,23 +5,11 @@
          version="2.5">
 
     <!-- LaceWiki administration -->
+
     <listener>
         <listener-class>org.jboss.seam.wiki.admin.WikiServletListener</listener-class>
     </listener>
 
-    <!--
-        (This resolves the not-thrown ViewExpiredException on session timeout and JSF POSTback.)
-        I have got a lot of times to understand JSF 1.2 implementation code. As I guess from code,
-        JSF 1.2 detect ViewHandler/StateManager version from faces-config.xml DTD/XML schema name.
-        We can't switch RichFaces 3.1.x configuration files to a JSF 1.2 format, as far as it will
-        completely break JSF 1.1 compatibility. Fortunately, there is workaround for a SUN RI framework.
-        Just put into application web.xml. It will switch framework to a JSF 1.2 behavior.
-    -->
-    <context-param>
-        <param-name>com.sun.faces.disableVersionTracking</param-name>
-        <param-value>true</param-value>
-    </context-param>
-
     <!-- Seam -->
 
     <listener>
@@ -109,6 +97,8 @@
         </auth-constraint>
     </security-constraint>
 
+    <!-- TODO: Rewrite these servlets as Seam resources -->
+
     <!-- Wiki: File Download Servlet -->
 
     <servlet>
@@ -134,11 +124,10 @@
     <!-- Misc Settings -->
 
     <error-page>
-        <error-code>500</error-code>
-        <exception-type>java.lang.IllegalStateException</exception-type>
-        <location>/errors/toomanysessions.html</location>
         <!-- Don't use a Faces or JSP page here, too many sessions means nothing works anymore!
              Unfortunately, Tomcat can't be bothered to throw anything better than an IllegalStateException... -->
+        <exception-type>java.lang.IllegalStateException</exception-type>
+        <location>/errors/toomanysessions.html</location>
     </error-page>
 
     <error-page>
@@ -146,7 +135,7 @@
         <location>/errors/generic.jsp</location>
     </error-page>
 
-    <!-- Session timeout,can be extended for authenticated users in components.xml! -->
+    <!-- Session timeout for anonymous,can be extended for authenticated users in wiki/*components.xml! -->
     <session-config>
         <session-timeout>30</session-timeout>
     </session-config>

Modified: trunk/examples/wiki/src/etc/production.sql
===================================================================
--- trunk/examples/wiki/src/etc/production.sql	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/etc/production.sql	2008-10-08 20:54:01 UTC (rev 9235)
@@ -71,6 +71,8 @@
 INSERT INTO PREFERENCE VALUES(210,'ForumTopPosters','title',NULL,NULL,NULL,NULL,'Top Forum Posters',0,NULL);
 INSERT INTO PREFERENCE VALUES(211,'ForumTopPosters','numberOfPosters',10,NULL,NULL,NULL,NULL,0,NULL);
 
+INSERT INTO PREFERENCE VALUES(220,'FlashVideo','allowedDomains',NULL,NULL,NULL,NULL,'video.google.com,www.youtube.com',0,NULL);
+
 INSERT INTO PREFERENCE VALUES(300,'JiraConnector','connectionTimeoutSeconds',15,NULL,NULL,NULL,NULL,0,NULL);
 INSERT INTO PREFERENCE VALUES(301,'JiraConnector','replyTimeoutSeconds',10,NULL,NULL,NULL,NULL,0,NULL);
 INSERT INTO PREFERENCE VALUES(302,'JiraConnector','issueListCacheUpdateTimeoutSeconds',600,NULL,NULL,NULL,NULL,0,NULL);

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/action/Authenticator.java	2008-10-08 20:54:01 UTC (rev 9235)
@@ -13,6 +13,7 @@
 import org.jboss.seam.core.Events;
 import org.jboss.seam.log.Log;
 import org.jboss.seam.security.Identity;
+import org.jboss.seam.security.Credentials;
 import org.jboss.seam.util.Base64;
 import org.jboss.seam.wiki.core.action.prefs.UserManagementPreferences;
 import org.jboss.seam.wiki.core.dao.UserDAO;
@@ -24,6 +25,7 @@
 import org.jboss.seam.wiki.util.Hash;
 import org.jboss.seam.wiki.util.WikiUtil;
 import org.jboss.seam.wiki.WikiInit;
+import org.jboss.seam.wiki.preferences.Preferences;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
@@ -42,9 +44,6 @@
     @In
     private Hash hashUtil;
 
-    @In("#{preferences.get('UserManagement')}")
-    UserManagementPreferences prefs;
-
     private String activationCode;
     public String getActivationCode() { return activationCode; }
     public void setActivationCode(String activationCode) { this.activationCode = activationCode; }
@@ -73,8 +72,9 @@
     }
 
     public boolean authenticate() {
-
-        User user = getUserForCredentials(Identity.instance().getUsername(), Identity.instance().getPassword());
+        Credentials credentials = Identity.instance().getCredentials();
+        log.debug("attempting authentication of user: " + credentials.getUsername());
+        User user = getUserForCredentials(credentials.getUsername(),  credentials.getPassword());
         if (user == null) return false;
 
         setRolesAndAccessLevels(user);
@@ -88,7 +88,10 @@
     }
 
     private User getUserForCredentials(String username, String password) {
-        if (User.GUEST_USERNAME.equals(username)) return null;
+        if (User.GUEST_USERNAME.equals(username)) {
+            log.warn("denying attempted 'guest' login");
+            return null;
+        }
         User user = userDAO.findUser(username, true, true);
         if (user == null || password == null || !user.getPasswordHash().equalsIgnoreCase(hashUtil.hash(password))) {
             log.debug("Invalid authentication credentials for username '" + username + "'");
@@ -120,7 +123,7 @@
             Contexts.getEventContext().set("activatedUser", user);
 
             // Optionally, create home directory
-            if ( prefs.getCreateHomeAfterUserActivation() ) {
+            if ( Preferences.instance().get(UserManagementPreferences.class).getCreateHomeAfterUserActivation() ) {
                 createHomeDirectory(user);
             }
 
@@ -163,7 +166,7 @@
         homePage.setWikiname(WikiUtil.convertToWikiName(homePage.getName()));
         homePage.setCreatedBy(user);
         homePage.setAreaNumber(homeDirectory.getAreaNumber());
-        homePage.setContent(prefs.getHomepageDefaultContent());
+        homePage.setContent(Preferences.instance().get(UserManagementPreferences.class).getHomepageDefaultContent());
         homePage.setWriteAccessLevel(Role.ADMINROLE_ACCESSLEVEL);
         homePage.setReadAccessLevel(Role.GUESTROLE_ACCESSLEVEL);
 

Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/WikiPluginThemeResource.java	2008-10-08 20:54:01 UTC (rev 9235)
@@ -37,13 +37,13 @@
  * <p>
  * This means that any web request can get any file out of that package. So don't put
  * anything into a plugins theme directory that you don't want people to GET.
+ * </p>
  * <p>
- * <p>
  * It is primarily used for serving up plugin CSS and image files. It can also interpolate
  * EL expressions in certain resources, configured with <tt>interpolatedResourcesExtensions</tt>.
  * The default is to parse resources with <tt>css</tt> extension. A temporary
- * <tt>WikiPluginMacro</tt> instance is available in these expressions, you can utilize this
- * to access the metadata (e.g. paths) of the plugin.
+ * <tt>WikiPluginMacro</tt> instance is available in these expressions as <tt>currentMacro</tt>,
+ * you can utilize this to access the metadata (e.g. paths) of the plugin.
  * </p>
  *
  * @author Christian Bauer

Added: trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/FilteringSelector.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/FilteringSelector.java	                        (rev 0)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/FilteringSelector.java	2008-10-08 20:54:01 UTC (rev 9235)
@@ -0,0 +1,58 @@
+package org.jboss.seam.wiki.util;
+
+import java.util.List;
+
+/**
+ * A list of items, optionally filtered by search prefix, one might be selected.
+ *
+ * @author Christian Bauer
+ */
+public class FilteringSelector<T> {
+
+    protected String filterLabel;
+    protected List<T> items;
+    protected T selected;
+    protected String searchPrefix;
+
+    public FilteringSelector(String filterLabel) {
+        this.filterLabel = filterLabel;
+        searchPrefix = filterLabel;
+    }
+
+    public List<T> getItems() {
+        return items;
+    }
+
+    public void setItems(List<T> items) {
+        this.items = items;
+    }
+
+    public T getSelected() {
+        return selected;
+    }
+
+    public void setSelected(T selected) {
+        this.selected = selected;
+    }
+
+    public String getSearchPrefix() {
+        return searchPrefix;
+    }
+
+    public void setSearchPrefix(String searchPrefix) {
+        this.searchPrefix = searchPrefix;
+    }
+
+    public void reset() {
+        searchPrefix = filterLabel;
+    }
+
+    public String getSearchPrefixClean() {
+        return searchPrefix == null ||
+               searchPrefix.length() == 0 ||
+               searchPrefix.equals(filterLabel)
+                ? null
+                : searchPrefix;
+    }
+
+}

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Basic.plugin.xml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Basic.plugin.xml	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Basic.plugin.xml	2008-10-08 20:54:01 UTC (rev 9235)
@@ -137,6 +137,14 @@
         </skins>
     </macro>
 
+    <!-- See http://flv-player.net/ -->
+    <macro key="flashVideo" name="flashVideo">
+        <applicable-to content="true"/>
+        <skins>
+            <skin name="d"/>
+        </skins>
+    </macro>
+
     <macro key="tags" name="tags">
         <applicable-to content="true"/>
         <skins>

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Flash.java
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Flash.java	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/Flash.java	2008-10-08 20:54:01 UTC (rev 9235)
@@ -18,6 +18,8 @@
     @Logger
     Log log;
 
+    // TODO: Some duplication here
+
     public boolean isValidURL(FlashPreferences prefs) {
 
         String allowedDomains = prefs.getAllowedDomains();
@@ -38,4 +40,26 @@
         Arrays.sort(allowedDomainNames);
         return Arrays.binarySearch(allowedDomainNames, desiredDomainName) >= 0;
     }
+
+    public boolean isValidURL(FlashVideoPreferences prefs) {
+
+        String allowedDomains = prefs.getAllowedDomains();
+        if (allowedDomains == null || allowedDomains.length() == 0) return false;
+
+        String desiredDomainName;
+        try {
+            URI uri = new URI(prefs.getUrl());
+            desiredDomainName = uri.getHost();
+        } catch (Exception ex) {
+            log.debug("Exception parsing flash movie URL into URI: " + ex.getMessage());
+            return false;
+        }
+        allowedDomains = allowedDomains.replaceAll("\\s", ""); // Remove spaces
+        String[] allowedDomainNames = allowedDomains.split(",");
+        if (desiredDomainName == null || desiredDomainName.length() == 0) return true;
+
+        Arrays.sort(allowedDomainNames);
+        return Arrays.binarySearch(allowedDomainNames, desiredDomainName) >= 0;
+    }
+
 }

Copied: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/FlashVideoPreferences.java (from rev 8700, trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/FlashPreferences.java)
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/FlashVideoPreferences.java	                        (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/FlashVideoPreferences.java	2008-10-08 20:54:01 UTC (rev 9235)
@@ -0,0 +1,61 @@
+package org.jboss.seam.wiki.plugin.basic;
+
+import org.hibernate.validator.Length;
+import org.hibernate.validator.Range;
+import org.jboss.seam.wiki.preferences.PreferenceVisibility;
+import org.jboss.seam.wiki.preferences.annotations.PreferenceProperty;
+import org.jboss.seam.wiki.preferences.annotations.Preferences;
+
+import java.io.Serializable;
+
+ at Preferences(
+    name = "FlashVideo",
+    description = "#{messages['basic.flashVideo.preferences.description']}",
+    mappedTo = "basic.flashVideo"
+)
+public class FlashVideoPreferences implements Serializable {
+
+    @PreferenceProperty(
+        description = "#{messages['basic.flashVideo.preferences.property.flashURL']}",
+        visibility = PreferenceVisibility.INSTANCE
+    )
+    @Length(min = 0, max = 1024)
+    private String url;
+
+    @PreferenceProperty(
+        description = "#{messages['basic.flashVideo.preferences.property.width']}",
+        visibility = PreferenceVisibility.INSTANCE
+    )
+    @Range(min = 1l, max = 2000l)
+    private Long width;
+
+    @PreferenceProperty(
+        description = "#{messages['basic.flashVideo.preferences.property.height']}",
+        visibility = PreferenceVisibility.INSTANCE
+    )
+    @Range(min = 1l, max = 2000l)
+    private Long height;
+
+    @PreferenceProperty(
+        description = "#{messages['basic.flashVideo.preferences.property.allowedDomains']}",
+        visibility = PreferenceVisibility.SYSTEM
+    )
+    @Length(min = 3, max = 1024)
+    private String allowedDomains;
+
+    public String getUrl() {
+        return url;
+    }
+
+    public Long getWidth() {
+        return width;
+    }
+
+    public Long getHeight() {
+        return height;
+    }
+
+    public String getAllowedDomains() {
+        return allowedDomains;
+    }
+}
\ No newline at end of file


Property changes on: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/FlashVideoPreferences.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/i18n/messages_basic_en.properties
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/i18n/messages_basic_en.properties	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/i18n/messages_basic_en.properties	2008-10-08 20:54:01 UTC (rev 9235)
@@ -53,6 +53,14 @@
 basic.flash.msg.URLNotSupplied=[Flash Macro: Add 'url' macro parameter to embed flash movie.]
 basic.flash.msg.URLNotAllowed=[Flash Macro: The flash URL you supplied is not in the list of valid domains, please ask the system administrator to add it.]
 
+basic.flashVideo.label=Flash Video Player
+basic.flashVideo.description=Embed and play Flash videos
+basic.flashVideo.preferences.description=Plugin: Flash Video Player
+basic.flashVideo.preferences.property.flashURL=URL of flash movie
+basic.flashVideo.preferences.property.width=Width in pixels
+basic.flashVideo.preferences.property.height=Height in pixels
+basic.flashVideo.preferences.property.allowedDomains=Comma-separated list of allowed domain names
+
 basic.dirToc.label=Directory TableOfContents
 basic.dirToc.description=Display a tree of subdirectories/documents as a ToC
 basic.dirToc.preferences.decription=Plugin: Directory TOC

Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flash.xhtml
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flash.xhtml	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flash.xhtml	2008-10-08 20:54:01 UTC (rev 9235)
@@ -11,8 +11,9 @@
     <s:div rendered="#{not empty preferences.get('Flash', currentMacro).url and flash.isValidURL(preferences.get('Flash', currentMacro))}">
         <object width="#{preferences.get('Flash', currentMacro).width}"
                 height="#{preferences.get('Flash', currentMacro).height}">
-            <param name="movie" value="#{preferences.get('Flash', currentMacro).url}"></param>
-            <param name="wmode" value="transparent"></param>
+            <param name="movie" value="#{preferences.get('Flash', currentMacro).url}"/>
+            <param name="wmode" value="transparent"/>
+            <param name="allowFullScreen" value="true"/>
             <embed src="#{preferences.get('Flash', currentMacro).url}"
                    type="application/x-shockwave-flash"
                    wmode="transparent"

Copied: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flashVideo.xhtml (from rev 8700, trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flash.xhtml)
===================================================================
--- trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flashVideo.xhtml	                        (rev 0)
+++ trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flashVideo.xhtml	2008-10-08 20:54:01 UTC (rev 9235)
@@ -0,0 +1,35 @@
+<wiki:plugin
+	 xmlns="http://www.w3.org/1999/xhtml"
+     xmlns:ui="http://java.sun.com/jsf/facelets"
+     xmlns:h="http://java.sun.com/jsf/html"
+     xmlns:f="http://java.sun.com/jsf/core"
+     xmlns:wiki="http://jboss.com/products/seam/wiki"
+     xmlns:s="http://jboss.com/products/seam/taglib">
+
+<s:div id="flashVideoPluginDiv">
+
+    <s:div rendered="#{not empty preferences.get('FlashVideo', currentMacro).url and flash.isValidURL(preferences.get('FlashVideo', currentMacro))}"
+           style="width: #{preferences.get('FlashVideo', currentMacro).width}px; border: 1px solid grey;">
+        <object>
+            <embed src="#{contextPath}#{currentMacro.requestImagePath}/flashvideoplayer.swf?flv=#{preferences.get('FlashVideo', currentMacro).url}&amp;showopen=0&amp;showvolume=1&amp;showfullscreen=1&amp;showtime=2&amp;margin=0&amp;title=Click to play video...&amp;playeralpha=60&amp;showplayer=autohide&amp;playertimeout=5000&amp;width=#{preferences.get('FlashVideo', currentMacro).width}&amp;height=#{preferences.get('FlashVideo', currentMacro).height}"
+                   type="application/x-shockwave-flash"
+                   allowfullscreen="true"
+                   width="#{preferences.get('FlashVideo', currentMacro).width}"
+                   height="#{preferences.get('FlashVideo', currentMacro).height}"/>
+        </object>
+    </s:div>
+
+    <s:div rendered="#{empty preferences.get('FlashVideo', currentMacro).url}"
+           styleClass="flashURLNotSupplied">
+        <h:outputText value="#{messages['basic.flash.msg.URLNotSupplied']}"/>
+    </s:div>
+
+    <s:div rendered="#{not empty preferences.get('FlashVideo', currentMacro).url and
+                       not flash.isValidURL(preferences.get('FlashVideo', currentMacro))}"
+           styleClass="flashURLNotAllowed">
+        <h:outputText value="#{messages['basic.flash.msg.URLNotAllowed']}"/>
+    </s:div>
+
+</s:div>
+
+</wiki:plugin>


Property changes on: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/templates/flashVideo.xhtml
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/default/img/flashvideoplayer.swf
===================================================================
(Binary files differ)


Property changes on: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/default/img/flashvideoplayer.swf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/inrelationto/img/flashvideoplayer.swf
===================================================================
(Binary files differ)


Property changes on: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/inrelationto/img/flashvideoplayer.swf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/sfwkorg/img/flashvideoplayer.swf
===================================================================
(Binary files differ)


Property changes on: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/basic/themes/sfwkorg/img/flashvideoplayer.swf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml
===================================================================
--- trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml	2008-10-08 19:41:02 UTC (rev 9234)
+++ trunk/examples/wiki/src/test/org/jboss/seam/wiki/test/WikiBaseData.dbunit.xml	2008-10-08 20:54:01 UTC (rev 9235)
@@ -4,7 +4,7 @@
 
     <PREFERENCE PREF_ID = "1" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "baseUrl" STRING_VALUE = "http://localhost:8080/wiki" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
     <PREFERENCE PREF_ID = "2" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "timeZone" STRING_VALUE = "CET" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
-    <PREFERENCE PREF_ID = "3" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "themeName" STRING_VALUE = "default" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
+    <PREFERENCE PREF_ID = "3" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "themeName" STRING_VALUE = "openremote" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
     <PREFERENCE PREF_ID = "4" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "memberArea" STRING_VALUE = "Members" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
     <PREFERENCE PREF_ID = "5" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "helpArea" STRING_VALUE = "Help" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
     <PREFERENCE PREF_ID = "6" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "Wiki" PROPERTY_NAME = "defaultDocumentId" STRING_VALUE = "[NULL]" LONG_VALUE = "6" BOOLEAN_VALUE = "[NULL]"/>
@@ -77,6 +77,8 @@
     <PREFERENCE PREF_ID = "210" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "ForumTopPosters" PROPERTY_NAME = "title" STRING_VALUE = "Top Forum Posters" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]"/>
     <PREFERENCE PREF_ID = "211" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "ForumTopPosters" PROPERTY_NAME = "numberOfPosters" STRING_VALUE = "[NULL]" LONG_VALUE = "10" BOOLEAN_VALUE = "[NULL]"/>
 
+    <PREFERENCE PREF_ID = "220" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "FlashVideo" PROPERTY_NAME = "allowedDomains" LONG_VALUE = "[NULL]" BOOLEAN_VALUE = "[NULL]" STRING_VALUE = "video.google.com,www.youtube.com"/>
+
     <!-- CONNECTORS -->
 
     <PREFERENCE PREF_ID = "300" OBJ_VERSION = "0" USER_ID = "[NULL]" ENTITY_NAME = "JiraConnector" PROPERTY_NAME = "connectionTimeoutSeconds" STRING_VALUE = "[NULL]" LONG_VALUE = "15" BOOLEAN_VALUE = "[NULL]"/>
@@ -164,7 +166,7 @@
         FIRSTNAME = "Regular" LASTNAME = "Member"
         USERNAME = "member"
         PASSWORDHASH = "aa08769cdcb26674c6706093503ff0a3"
-        EMAIL = "member at domain.tld"
+        EMAIL = "christian.bauer at gmail.com"
         ACTIVATED = "true"
         ACTIVATION_CODE ="ebb0bce9eeeee191e8089afd1120c4a7"
         USER_PROFILE_ID = "3"




More information about the seam-commits mailing list