JBoss Rich Faces SVN: r13082 - trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-20 14:46:22 -0400 (Fri, 20 Mar 2009)
New Revision: 13082
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java
Log:
Delete uploadRoot on startup
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java 2009-03-20 18:45:58 UTC (rev 13081)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java 2009-03-20 18:46:22 UTC (rev 13082)
@@ -85,9 +85,10 @@
String uploadRootPath = System.getProperty("java.io.tmpdir") + REALWORLD_FOLDER + File.separator;
if (uploadRootPath != null) {
uploadRoot = new File(uploadRootPath);
- if (!uploadRoot.exists()) {
- uploadRoot.mkdir();
+ if (uploadRoot.exists()) {
+ FileUtils.deleteDirectory(uploadRoot);
}
+ uploadRoot.mkdir();
this.uploadRootPath = uploadRoot.getCanonicalPath();
}else {
throw new NullPointerException("Upload root was not created");
15 years, 10 months
JBoss Rich Faces SVN: r13081 - in trunk/test-applications/realworld2/web/src/main/webapp: includes/misc and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-20 14:45:58 -0400 (Fri, 20 Mar 2009)
New Revision: 13081
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/slideshow.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
Log:
Effect for slider; Add close button for slider modal;
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-03-20 17:51:16 UTC (rev 13080)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-03-20 18:45:58 UTC (rev 13081)
@@ -179,6 +179,11 @@
border: none;
}
+.slider-image {
+ opacity: 0.1;
+ filter: opacity=10;
+}
+
.all-images{
border: none;
}
15 years, 10 months
JBoss Rich Faces SVN: r13080 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/manager and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-20 13:51:16 -0400 (Fri, 20 Mar 2009)
New Revision: 13080
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java
Removed:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/listener/
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml
Log:
refactor copy image stuff
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-03-20 17:49:48 UTC (rev 13079)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-03-20 17:51:16 UTC (rev 13080)
@@ -26,21 +26,21 @@
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
-import java.util.Properties;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageInputStream;
+import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.service.Constants;
@@ -50,12 +50,14 @@
@AutoCreate
public class FileManager {
- private static final String REALWORLD_PROPERTIES = "realworld.properties";
private static final String _SMALL160 = "_small160";
private static final String _SMALL120 = "_small120";
private static final String _SMALL80 = "_small80";
private static final String _MEDIUM = "_medium";
private static final String _MINI = "_mini";
+
+ static final String UPLOAD_ROOT_COMPONENT_NAME = "uploadRoot";
+ static final String UPLOAD_ROOT_PATH_COMPONENT_NAME = "uploadRootPath";
private File uploadRoot;
private String uploadRootPath;
@@ -64,13 +66,10 @@
return uploadRoot;
}
- public FileManager() throws FileNotFoundException, IOException{
- if(uploadRoot != null){
- return;
- }
- Properties prop = new Properties();
- prop.load(new FileInputStream(REALWORLD_PROPERTIES));
- this.setUploadRoot(prop.get("uploadRoot").toString());
+ @Create
+ public void create() {
+ uploadRoot = (File)Component.getInstance(UPLOAD_ROOT_COMPONENT_NAME, ScopeType.APPLICATION);
+ uploadRootPath = (String)Component.getInstance(UPLOAD_ROOT_PATH_COMPONENT_NAME, ScopeType.APPLICATION);
}
public void setUploadRoot(String uploadRootPath) throws IOException {
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java 2009-03-20 17:51:16 UTC (rev 13080)
@@ -0,0 +1,104 @@
+/**
+ *
+ */
+package org.richfaces.realworld.startup;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
+import org.richfaces.realworld.util.FileUtils;
+
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+
+@Name("CopyImagesStuff")
+(a)Scope(ScopeType.APPLICATION)
+@Startup
+public class CopyImageStuff {
+
+ static final String WEB_INF = "WEB-INF";
+
+ static final String IMAGE_FOLDER = "/Upload";
+
+ static final String REALWORLD_FOLDER = "realworld";
+
+ @Out(scope = ScopeType.APPLICATION)
+ File uploadRoot;
+
+ @Out(scope = ScopeType.APPLICATION)
+ String uploadRootPath;
+
+ String imageSrc;
+
+ @Create
+ public void create() throws Exception {
+ resolveImageFolder();
+ resolveUploadRoot();
+
+ copyImages();
+ }
+
+ @Destroy
+ public void destroy()throws IOException {
+ FileUtils.deleteDirectory(uploadRoot);
+ }
+
+
+ void resolveImageFolder() {
+ URLClassLoader loader = (URLClassLoader)getClass().getClassLoader();
+ URL path = loader.getResource("");
+ String classLoadPath = null;
+ String realPath = null;
+
+ if (path != null) {
+ classLoadPath = path.getFile();
+ }
+
+ if (classLoadPath != null) {
+ int index = classLoadPath.indexOf(WEB_INF);
+ if (index != -1) {
+ realPath = classLoadPath.substring(0, index + WEB_INF.length()) + IMAGE_FOLDER;
+ }
+ }
+
+ if (realPath != null) {
+ this.imageSrc = realPath;
+ }else {
+ throw new NullPointerException("Cannot bound image folder path");
+ }
+
+ }
+
+ void resolveUploadRoot()throws IOException {
+ String uploadRootPath = System.getProperty("java.io.tmpdir") + REALWORLD_FOLDER + File.separator;
+ if (uploadRootPath != null) {
+ uploadRoot = new File(uploadRootPath);
+ if (!uploadRoot.exists()) {
+ uploadRoot.mkdir();
+ }
+ this.uploadRootPath = uploadRoot.getCanonicalPath();
+ }else {
+ throw new NullPointerException("Upload root was not created");
+ }
+ }
+
+
+ void copyImages()throws IOException {
+ FileUtils.copyDirectory(new File(imageSrc), uploadRoot);
+ }
+
+
+
+}
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java 2009-03-20 17:51:16 UTC (rev 13080)
@@ -0,0 +1,227 @@
+package org.richfaces.realworld.util;
+
+import java.io.*;
+import java.util.zip.*;
+
+
+
+/**
+ * Command line program to copy a file to another directory.
+ *
+ * @author Marco Schmidt
+ */
+public class FileUtils {
+ // constant values for the override option
+ public static final int OVERWRITE_ALWAYS = 1;
+ public static final int OVERWRITE_NEVER = 2;
+ public static final int OVERWRITE_ASK = 3;
+
+ // program options initialized to default values
+ private static int bufferSize = 4 * 1024;
+ private static boolean clock = true;
+ private static boolean copyOriginalTimestamp = true;
+ private static boolean verify = true;
+ private static int override = OVERWRITE_ASK;
+
+ public static Long copyFile(File srcFile, File destFile) throws IOException {
+ if(!srcFile.getPath().toLowerCase().endsWith("jpg") && !srcFile.getPath().toLowerCase().endsWith("jpeg")){
+ return -1L;
+ }
+ InputStream in = new FileInputStream(srcFile);
+ OutputStream out = new FileOutputStream(destFile);
+ long millis = System.currentTimeMillis();
+ CRC32 checksum = null;
+ if (verify) {
+ checksum = new CRC32();
+ checksum.reset();
+ }
+ byte[] buffer = new byte[bufferSize];
+ int bytesRead;
+ while ((bytesRead = in.read(buffer)) >= 0) {
+ if (verify) {
+ checksum.update(buffer, 0, bytesRead);
+ }
+ out.write(buffer, 0, bytesRead);
+ }
+ out.close();
+ in.close();
+ if (clock) {
+ millis = System.currentTimeMillis() - millis;
+ System.out.println("Second(s): " + (millis / 1000L));
+ }
+ if (verify) {
+ return new Long(checksum.getValue());
+ } else {
+ return null;
+ }
+ }
+
+ public static Long createChecksum(File file) throws IOException {
+ long millis = System.currentTimeMillis();
+ InputStream in = new FileInputStream(file);
+ CRC32 checksum = new CRC32();
+ checksum.reset();
+ byte[] buffer = new byte[bufferSize];
+ int bytesRead;
+ while ((bytesRead = in.read(buffer)) >= 0) {
+ checksum.update(buffer, 0, bytesRead);
+ }
+ in.close();
+ if (clock) {
+ millis = System.currentTimeMillis() - millis;
+ System.out.println("Second(s): " + (millis / 1000L));
+ }
+ return new Long(checksum.getValue());
+ }
+
+ /**
+ * Determine if data is to be copied to given file. Take into consideration
+ * override option and ask user in case file exists and override option is
+ * ask.
+ *
+ * @param file
+ * File object for potential destination file
+ * @return true if data is to be copied to file, false if not
+ */
+ public static boolean doCopy(File file) {
+ boolean exists = file.exists();
+ if (override == OVERWRITE_ALWAYS || !exists) {
+ return true;
+ } else if (override == OVERWRITE_NEVER) {
+ return false;
+ } else if (override == OVERWRITE_ASK) {
+ return readYesNoFromStandardInput("File exists. "
+ + "Overwrite (y/n)?");
+ } else {
+ throw new InternalError("Program error. Invalid "
+ + "value for override: " + override);
+ }
+ }
+
+ public static void main(String[] args) throws IOException {
+ // make sure there are exactly two arguments
+ if (args.length != 2) {
+ System.err.println("Usage: CopyFile SRC-FILE-NAME DEST-DIR-NAME");
+ System.exit(1);
+ }
+ // make sure the source file is indeed a readable file
+ File srcFile = new File(args[0]);
+ if (!srcFile.isFile() || !srcFile.canRead()) {
+ System.err.println("Not a readable file: " + srcFile.getName());
+ System.exit(1);
+ }
+ // make sure the second argument is a directory
+ File destDir = new File(args[1]);
+ if (!destDir.isDirectory()) {
+ System.err.println("Not a directory: " + destDir.getName());
+ System.exit(1);
+ }
+ // create File object for destination file
+ File destFile = new File(destDir, srcFile.getName());
+
+ // check if copying is desired given overwrite option
+ if (!doCopy(destFile)) {
+ return;
+ }
+
+ // copy file, optionally creating a checksum
+ Long checksumSrc = copyFile(srcFile, destFile);
+
+ // copy timestamp of last modification
+ if (copyOriginalTimestamp) {
+ if (!destFile.setLastModified(srcFile.lastModified())) {
+ System.err.println("Error: Could not set "
+ + "timestamp of copied file.");
+ }
+ }
+
+ // optionally verify file
+ if (verify) {
+ System.out.print("Verifying destination file...");
+ Long checksumDest = createChecksum(destFile);
+ if (checksumSrc.equals(checksumDest)) {
+ System.out.println(" OK, files are equal.");
+ } else {
+ System.out.println(" Error: Checksums differ.");
+ }
+ }
+ }
+
+ /**
+ * Print a message to standard output and read lines from standard input
+ * until yes or no (y or n) is entered.
+ *
+ * @param message
+ * informative text to be answered by user
+ * @return user answer, true for yes, false for no.
+ */
+ public static boolean readYesNoFromStandardInput(String message) {
+ System.out.println(message);
+ String line;
+ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+ Boolean answer = null;
+ try {
+ while ((line = in.readLine()) != null) {
+ line = line.toLowerCase();
+ if ("y".equals(line) || "yes".equals(line)) {
+ answer = Boolean.TRUE;
+ break;
+ } else if ("n".equals(line) || "no".equals(line)) {
+ answer = Boolean.FALSE;
+ break;
+ } else {
+ System.out.println("Could not understand answer (\"" + line
+ + "\"). Please use y for yes or n for no.");
+ }
+ }
+ if (answer == null) {
+ throw new IOException("Unexpected end of input from stdin.");
+ }
+ in.close();
+ return answer.booleanValue();
+ } catch (IOException ioe) {
+ throw new InternalError(
+ "Cannot read from stdin or write to stdout.");
+ }
+ }
+
+ public static void copyDirectory(File srcDir, File dstDir)
+ throws IOException {
+
+ if (".svn".equals(srcDir.getName())) {
+ return;
+ }
+
+ if (srcDir.isDirectory()) {
+ if (!dstDir.exists()) {
+ dstDir.mkdir();
+ }
+
+ String[] children = srcDir.list();
+ for (int i = 0; i < children.length; i++) {
+ copyDirectory(new File(srcDir, children[i]), new File(dstDir,
+ children[i]));
+ }
+ } else {
+ FileUtils.copyFile(srcDir, dstDir);
+ }
+ }
+
+ public static void deleteDirectory(File dir) throws IOException {
+ if (dir.isDirectory()) {
+ if (dir.exists()) {
+ File [] children = dir.listFiles();
+ for (int i = 0; i < children.length; i++) {
+ deleteDirectory(children[i]);
+ }
+ }
+
+ } else {
+ if (dir.exists()) {
+ System.out.println(dir.delete());
+ }
+ }
+ dir.delete();
+ }
+
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml 2009-03-20 17:49:48 UTC (rev 13079)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml 2009-03-20 17:51:16 UTC (rev 13080)
@@ -77,12 +77,7 @@
<param-value>.xhtml</param-value>
</context-param>
- <context-param>
- <param-name>uploadRoot</param-name>
- <param-value>/srv/upload/as</param-value>
- </context-param>
-
- <context-param>
+ <context-param>
<param-name>storeStrategy</param-name>
<param-value>database</param-value>
</context-param>
@@ -117,8 +112,4 @@
<auth-constraint />
</security-constraint>
- <listener>
- <display-name>copyImageListener</display-name>
- <listener-class>org.richfaces.realworld.listener.CopyImagesStuff</listener-class>
- </listener>
</web-app>
15 years, 10 months
JBoss Rich Faces SVN: r13079 - in trunk/test-applications/richfaces-docs/web/src/main/java/org/docs: tree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:49:48 -0400 (Fri, 20 Mar 2009)
New Revision: 13079
Added:
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/tree/
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/tree/Tree.java
Log:
Added: trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/tree/Tree.java
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/tree/Tree.java (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/tree/Tree.java 2009-03-20 17:49:48 UTC (rev 13079)
@@ -0,0 +1,35 @@
+
+package org.docs.tree;
+
+
+public class Tree {
+
+
+
+ String[] nodes = {"asdfa", "asdfasd", "asdf"};
+ String[] root = {"root1", "root2", "root3"};
+
+
+
+
+ public String[] getRoot() {
+ return root;
+ }
+
+ public void setRoot(String[] root) {
+ this.root = root;
+ }
+
+ public String[] getNodes() {
+ return nodes;
+ }
+
+ public void setNodes(String[] nodes) {
+ this.nodes = nodes;
+ }
+
+
+
+
+
+}
15 years, 10 months
JBoss Rich Faces SVN: r13078 - trunk/test-applications/richfaces-docs/web/src/main/java/org/docs.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:47:34 -0400 (Fri, 20 Mar 2009)
New Revision: 13078
Added:
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/Queue.java
Log:
https://jhttps://jira.jboss.org/jira/browse/RF-6419
added some features
Added: trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/Queue.java
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/Queue.java (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/Queue.java 2009-03-20 17:47:34 UTC (rev 13078)
@@ -0,0 +1,47 @@
+package org.docs;
+
+public class Queue {
+
+ String a="";
+ String b="";
+ String c="";
+
+ boolean check;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ public boolean isCheck() {
+ return check;
+ }
+
+ public void setCheck(boolean check) {
+ this.check = check;
+ }
+
+
+
+
+
+}
15 years, 10 months
JBoss Rich Faces SVN: r13077 - in trunk/test-applications/richfaces-docs/web/src/main/java/org/docs: util and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:38:55 -0400 (Fri, 20 Mar 2009)
New Revision: 13077
Added:
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/GlobalQueue.java
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuBean.java
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuState.java
trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/Skin.java
Log:
https://jira.jboss.org/jira/browse/RF-6419
added some features
Added: trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/GlobalQueue.java
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/GlobalQueue.java (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/GlobalQueue.java 2009-03-20 17:38:55 UTC (rev 13077)
@@ -0,0 +1,21 @@
+package org.docs.util;
+
+public class GlobalQueue {
+
+
+ private boolean globalQueue;
+
+ public boolean isGlobalQueue() {
+ return globalQueue;
+ }
+
+ public void setGlobalQueue(boolean globalQueue) {
+ this.globalQueue = globalQueue;
+ }
+
+
+
+
+
+
+}
Added: trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuBean.java
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuBean.java (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuBean.java 2009-03-20 17:38:55 UTC (rev 13077)
@@ -0,0 +1,22 @@
+package org.docs.util;
+
+import javax.faces.event.ActionEvent;
+
+
+
+public class MenuBean {
+
+ private MenuState menuState;
+
+ public MenuState getMenuState() {
+ return menuState;
+ }
+ public void setMenuState(MenuState menuState) {
+ this.menuState = menuState;
+ }
+ public MenuBean() {}
+
+ public void select (ActionEvent event) {
+ menuState.setSelectedMenuItem(event.getComponent().getId());
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuState.java
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuState.java (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/MenuState.java 2009-03-20 17:38:55 UTC (rev 13077)
@@ -0,0 +1,40 @@
+package org.docs.util;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.PostConstruct;
+
+
+public class MenuState {
+
+
+ private Map <String, Boolean> menu;
+
+ private String selectedMenuItem;
+
+ public String getSelectedMenuItem() {
+ return selectedMenuItem;
+ }
+ public Map<String, Boolean> getMenu() {
+ return menu;
+ }
+ public void setMenu(Map<String, Boolean> menu) {
+ this.menu = menu;
+ }
+ public void setSelectedMenuItem(String selectedMenuItem) {
+ this.selectedMenuItem = selectedMenuItem;
+ }
+ public MenuState() {
+ }
+ @PostConstruct
+ public void init () {
+ menu = new HashMap <String, Boolean>();
+ menu.put("group1", false);
+ menu.put("group2", false);
+ menu.put("group3", false);
+ menu.put("group4", false);
+ }
+
+
+
+}
Added: trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/Skin.java
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/Skin.java (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/java/org/docs/util/Skin.java 2009-03-20 17:38:55 UTC (rev 13077)
@@ -0,0 +1,24 @@
+package org.docs.util;
+
+public class Skin {
+ private String skin;
+ private String standardSkinning;
+
+
+
+
+ public String getStandardSkinning() {
+ return standardSkinning;
+ }
+ public void setStandardSkinning(String standardSkinning) {
+ this.standardSkinning = standardSkinning;
+ }
+ public String getSkin() {
+ return skin;
+ }
+ public void setSkin(String skin) {
+ this.skin = skin;
+ }
+
+
+}
15 years, 10 months
JBoss Rich Faces SVN: r13076 - trunk/test-applications/richfaces-docs/web/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:37:23 -0400 (Fri, 20 Mar 2009)
New Revision: 13076
Added:
trunk/test-applications/richfaces-docs/web/src/main/webapp/conventions.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-6419
added some features
Added: trunk/test-applications/richfaces-docs/web/src/main/webapp/conventions.xhtml
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/conventions.xhtml (rev 0)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/conventions.xhtml 2009-03-20 17:37:23 UTC (rev 13076)
@@ -0,0 +1,48 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+
+ <h:messages globalOnly="true" styleClass="message"/>
+
+
+
+ <rich:panel>
+ <f:facet name="header">Coding Conventions</f:facet>
+<div class="simpletext">
+<h3>General</h3>
+
+<ol>
+
+<li>Make sure the code you committed is 100% valid and will not fail the deployment of the application.</li>
+<li>Leave as many comments as possible.
+Do not assume that the code example is too obvious to be commented.
+ Your comments can help other techwriters (or users) understand how your code functions. </li>
+</ol>
+<h3>Managed Beans and View Pages</h3>
+
+<ol>
+ <li>If you need just a single bean for your code sample you can place it in org.docs package.</li>
+ <li>If your sample requires multiple beans make a separate package for the beans. For example,
+<i>org.docs.tree</i> that houses <i>Tree.java</i> and <i>Nodes.java</i>. This will keep the app clean and facilitate navigation.
+
+ </li>
+ <li>Name view pages the same way as the component you are documenting. Example: <i>rich:colorPicker</i> is documented in <i>colorPicker.xhtml</i></li>
+ <li>When a new view page is created do not forget to include it in the main menu. Location: <i>webapp\layout\mainMenu.xthml</i></li>
+</ol>
+
+
+</div>
+ </rich:panel>
+
+
+</ui:define>
+</ui:composition>
15 years, 10 months
JBoss Rich Faces SVN: r13075 - trunk/test-applications/richfaces-docs/web/src/main/webapp/stylesheet.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:33:41 -0400 (Fri, 20 Mar 2009)
New Revision: 13075
Modified:
trunk/test-applications/richfaces-docs/web/src/main/webapp/stylesheet/theme.css
Log:
https://jira.jboss.org/jira/browse/RF-6419
added some features
Modified: trunk/test-applications/richfaces-docs/web/src/main/webapp/stylesheet/theme.css
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/stylesheet/theme.css 2009-03-20 17:33:21 UTC (rev 13074)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/stylesheet/theme.css 2009-03-20 17:33:41 UTC (rev 13075)
@@ -130,4 +130,9 @@
}
.richcomponentsmenu a:HOVER {background: #FFFFFF; display: block}
-.dr-pmenu-hovered-element {background-color: #FFFFFF;}
\ No newline at end of file
+.dr-pmenu-hovered-element {background-color: #FFFFFF;}
+
+.dr-toolbar-int {padding: 2px 3px 2px 3px;}
+
+.menuToolBar .rich-toolbar-item {font-weight: 100; font-size: 10px;}
+.dr-pnl-b .simpletext p {font-size: 12px;}
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r13074 - trunk/test-applications/richfaces-docs/web/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:33:21 -0400 (Fri, 20 Mar 2009)
New Revision: 13074
Modified:
trunk/test-applications/richfaces-docs/web/src/main/webapp/stskinning.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-6419
added some features
Modified: trunk/test-applications/richfaces-docs/web/src/main/webapp/stskinning.xhtml
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/stskinning.xhtml 2009-03-20 17:33:01 UTC (rev 13073)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/stskinning.xhtml 2009-03-20 17:33:21 UTC (rev 13074)
@@ -47,6 +47,25 @@
<h:commandButton value="Submit" />
+
+<select id="form:menu" name="form:menu" multiple="true" size="1">
+ <option value="1">News</option>
+ <option value="2">Sports</option>
+ <option value="3">Music</option>
+ <option value="4">Java</option>
+ <option value="5">Web</option>
+</select>
+
+
+<select id="form:subscriptions" name="form:subscriptions" size="1">
+ <option value="1">News</option>
+ <option value="2">Sports</option>
+ <option value="3">Music</option>
+ <option value="4">Java</option>
+ <option value="5">Web</option>
+</select>
+
+
</rich:panel>
</ui:define>
15 years, 10 months
JBoss Rich Faces SVN: r13073 - trunk/test-applications/richfaces-docs/web/src/main/webapp/layout.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-03-20 13:33:01 -0400 (Fri, 20 Mar 2009)
New Revision: 13073
Modified:
trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/template.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-6419
added some features
Modified: trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/menu.xhtml
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/menu.xhtml 2009-03-20 17:32:37 UTC (rev 13072)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/menu.xhtml 2009-03-20 17:33:01 UTC (rev 13073)
@@ -1,27 +1,53 @@
-<rich:toolBar
+<rich:toolBar
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:s="http://jboss.com/products/seam/taglib"
- xmlns:rich="http://richfaces.org/rich">
+ xmlns:rich="http://richfaces.org/rich"
+ styleClass="menuToolBar"
+
+ >
+
<rich:toolBarGroup>
<h:outputText value="#{projectName}:"/>
<s:link view="/home.xhtml" value="Home"/>
-
+ <span>|</span>
+
+ <s:link view="/conventions.xhtml" value="Conventions" />
+
+
</rich:toolBarGroup>
<!-- @newMenuItem@ -->
<rich:toolBarGroup location="right">
+
+ <h:outputText value="Load Script Stategy" />
+
+
+ <span>|</span>
+ <h:outputText value="Global Queue:" style="margin: 0px; padding: 0px;"/>
+ <h:form>
+
+
+ <h:selectOneMenu value="#{globalQueue.globalQueue}" onchange="submit()">
+ <f:selectItem itemLabel="Enable" itemValue="true" />
+ <f:selectItem itemLabel="Disable" itemValue="false" />
+
+ </h:selectOneMenu>
+ </h:form>
+
+ <span>|</span>
- <h:outputText value="Standard controls skinning:" />
+
+ <h:outputText value="Standard controls skinning:" />
<h:form>
-
- <h:selectOneRadio value="#{skin.standardSkinning}" onchange="submit()" >
- <f:selectItem id="item1" itemLabel="Enable" itemValue="enable" />
- <f:selectItem id="item2" itemLabel="Disable" itemValue="disable" />
- </h:selectOneRadio>
+ <h:selectOneMenu value="#{skin.standardSkinning}">
+ <f:selectItem itemLabel="Enable" itemValue="enable"/>
+ <f:selectItem itemLabel="Disable" itemValue="disable" />
+ </h:selectOneMenu>
+
</h:form>
-
+ <span>|</span>
<h:outputText value="Select skin:" />
<h:form>
Modified: trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/template.xhtml
===================================================================
--- trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/template.xhtml 2009-03-20 17:32:37 UTC (rev 13072)
+++ trunk/test-applications/richfaces-docs/web/src/main/webapp/layout/template.xhtml 2009-03-20 17:33:01 UTC (rev 13073)
@@ -8,7 +8,7 @@
xmlns:rich="http://richfaces.org/rich">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>RichFaces Docs</title>
+ <title>RichFaces Documentation Application</title>
<link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
</head>
@@ -19,50 +19,8 @@
</ui:include>
<div class="richcomponentsmenu">
-<rich:panelMenu
-mode="client"
- iconExpandedGroup="disc"
- iconCollapsedGroup="disc"
- iconExpandedTopGroup="chevronUp"
- iconGroupTopPosition="right"
- iconCollapsedTopGroup="chevronDown"
- iconCollapsedTopPosition="right"
-
- >
-<rich:panelMenuGroup label="Rich Components" id="group1" value="#{menuState.menu['group1']}" >
-
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
-<h:outputLink value="colorPicker.xhtml" >rich:colorPicker</h:outputLink>
-</rich:panelMenuItem>
-
-</rich:panelMenuGroup>
-<rich:panelMenuGroup label="A4J Components" id="group2" value="#{menuState.menu['group2']}">
-
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
-<h:outputLink value="queue.xhtml" >a4j:queue</h:outputLink>
-</rich:panelMenuItem>
-
-</rich:panelMenuGroup>
-<rich:panelMenuGroup label="Framework" id="group3" value="#{menuState.menu['group3']}">
-
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
-<h:outputLink value="framework.xhtml" >Framework</h:outputLink>
-</rich:panelMenuItem>
-
-</rich:panelMenuGroup>
-
-<rich:panelMenuGroup label="Skinnability" id="group4" value="#{menuState.menu['group4']}">
-
-<rich:panelMenuItem actionListener="#{menuBean.select}" mode="server">
-<h:outputLink value="stskinning.xhtml" >Standard Skinning</h:outputLink>
-</rich:panelMenuItem>
-
-</rich:panelMenuGroup>
-
-
-
-
-</rich:panelMenu>
+ <ui:include src="mainMenu.xhtml" />
+
</div>
<div class="body" >
15 years, 10 months