JBoss Rich Faces SVN: r12240 - trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-01-12 18:10:59 -0500 (Mon, 12 Jan 2009)
New Revision: 12240
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java
Log:
https://jira.jboss.org/jira/browse/RF-5626
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java 2009-01-12 23:10:16 UTC (rev 12239)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java 2009-01-12 23:10:59 UTC (rev 12240)
@@ -131,6 +131,39 @@
}
}
+ private String getResourceKey(String packageName, Object resource) {
+ try {
+ Class<? extends Object> resourceClass = resource.getClass();
+ Method method = resourceClass.getMethod("getKey");
+ String resourceKey = (String) method.invoke(resource);
+
+ if (resourceKey != null && !resourceKey.equals(resourceClass.getName())) {
+ ClassLoader loader = config.getClassLoader();
+
+ if (loader.getResource(resourceKey) == null) {
+ String packagePath = packageName.replace('.', '/');
+ if (packagePath.length() != 0) {
+ packagePath += "/";
+ }
+
+ if (loader.getResource(packagePath + resourceKey) == null) {
+ resourceKey = null;
+ }
+ } else {
+ if (!resourceKey.startsWith("/")) {
+ resourceKey = "/" + resourceKey;
+ }
+ }
+ }
+
+ return resourceKey;
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+
+ return null;
+ }
+
private String addResource(ResourcesConfigGeneratorBean configBean,
RendererBean renderer, BuilderConfig builderConfig,
CompilationContext compilationContext)
@@ -184,6 +217,11 @@
if (result instanceof Object[]) {
for (Object object : result) {
String resourceName = interceptor.getResourceName(object);
+
+ if (resourceName == null) {
+ resourceName = getResourceKey(packageName, object);
+ }
+
if (resourceName != null) {
locatedResources.add(resourceName);
configBean.addResource(resourceName, packageName, ResourceType.STYLE,
@@ -209,6 +247,11 @@
if (result instanceof Object[]) {
for (Object object : result) {
String resourceName = interceptor.getResourceName(object);
+
+ if (resourceName == null) {
+ resourceName = getResourceKey(packageName, object);
+ }
+
if (resourceName != null) {
locatedResources.add(resourceName);
configBean.addResource(resourceName, packageName, ResourceType.SCRIPT,
@@ -327,24 +370,6 @@
}
}
-interface NamedObject {
- public String getPath();
-}
-
-class NamedObjectImpl implements NamedObject {
-
- private String path;
-
- public NamedObjectImpl(String path) {
- super();
- this.path = path;
- }
-
- public String getPath() {
- return path;
- }
-}
-
class GetResourceInterceptor implements MethodInterceptor {
private static final Class<?>[] SIGNATURE = new Class<?>[] { String.class };
16 years, 11 months
JBoss Rich Faces SVN: r12239 - in trunk/ui: suggestionbox/src/test/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-01-12 18:10:16 -0500 (Mon, 12 Jan 2009)
New Revision: 12239
Modified:
trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java
trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
trunk/ui/tooltip/src/test/java/org/richfaces/component/TooltipComponentTest.java
trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java
Log:
Unit tests: fixed missing resources
Modified: trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java
===================================================================
--- trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java 2009-01-12 19:17:55 UTC (rev 12238)
+++ trunk/ui/panelbar/src/test/java/org/richfaces/component/PanelBarComponentTest.java 2009-01-12 23:10:16 UTC (rev 12239)
@@ -52,7 +52,7 @@
javaScripts.add("browser_info.js");
javaScripts.add("panelbar.js");
javaScripts.add("AjaxScript");
- javaScripts.add("prototype.js");
+ javaScripts.add("PrototypeScript");
javaScripts.add("ImageCacheScript");
}
Modified: trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
===================================================================
--- trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2009-01-12 19:17:55 UTC (rev 12238)
+++ trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2009-01-12 23:10:16 UTC (rev 12239)
@@ -54,12 +54,14 @@
static {
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
- javaScripts.add("prototype.js");
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("org.ajax4jsf.javascript.SmartPositionScript");
javaScripts.add("org/richfaces/renderkit/html/scripts/browser_info.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/scriptaculous/effects.js");
javaScripts.add("scripts/suggestionbox.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/available.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/jquery/jquery.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
}
private UISuggestionBox sb;
Modified: trunk/ui/tooltip/src/test/java/org/richfaces/component/TooltipComponentTest.java
===================================================================
--- trunk/ui/tooltip/src/test/java/org/richfaces/component/TooltipComponentTest.java 2009-01-12 19:17:55 UTC (rev 12238)
+++ trunk/ui/tooltip/src/test/java/org/richfaces/component/TooltipComponentTest.java 2009-01-12 23:10:16 UTC (rev 12239)
@@ -56,7 +56,7 @@
javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/jquery/jquery.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/tooltip.js");
- javaScripts.add("prototype.js");
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
}
public TooltipComponentTest(String testName) {
Modified: trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java
===================================================================
--- trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java 2009-01-12 19:17:55 UTC (rev 12238)
+++ trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java 2009-01-12 23:10:16 UTC (rev 12239)
@@ -40,7 +40,8 @@
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/tooltip.js");
- javaScripts.add("prototype.js");
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/jquery/jquery.js");
}
private UIToolTip toolTip;
16 years, 11 months
JBoss Rich Faces SVN: r12238 - in trunk/test-applications/realworld/web: src/main/java/org/richfaces/realworld/util and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-01-12 14:17:55 -0500 (Mon, 12 Jan 2009)
New Revision: 12238
Modified:
trunk/test-applications/realworld/web/pom.xml
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/test.java
Log:
Modified: trunk/test-applications/realworld/web/pom.xml
===================================================================
--- trunk/test-applications/realworld/web/pom.xml 2009-01-12 19:16:58 UTC (rev 12237)
+++ trunk/test-applications/realworld/web/pom.xml 2009-01-12 19:17:55 UTC (rev 12238)
@@ -12,6 +12,11 @@
<packaging>war</packaging>
<dependencies>
<dependency>
+ <groupId>com.drewnoakes</groupId>
+ <artifactId>metadata-extractor</artifactId>
+ <version>2.4.0-beta1</version>
+ </dependency>
+ <dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_08</version>
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/test.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/test.java 2009-01-12 19:16:58 UTC (rev 12237)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/test.java 2009-01-12 19:17:55 UTC (rev 12238)
@@ -3,6 +3,7 @@
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
+import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -17,10 +18,12 @@
/**
* @param args
+ * @throws IOException
*/
- public static void main(String[] args) {
- String directory ="C:\\Documents and Settings\\Administrator\\Desktop\\Fun";
- writeFiles(directory, "_mini", 100, 100);
+ public static void main(String[] args) throws IOException {
+ //String directory ="C:\\Documents and Settings\\Administrator\\Desktop\\Fun";
+ //writeFiles(directory, "_mini", 100, 100);
+ transform();
}
private static void writeFiles(String directory, String pattern, int width, int height) {
@@ -67,4 +70,21 @@
String end = target.substring(target.lastIndexOf("."));
return begin + substitute + end;
}
+
+ private static void transform() throws IOException{
+ File temp = new File("E:\\richfaces\\test-applications\\realworld\\Upload\\galleries\\Nature\\1.jpg");
+ BufferedImage bsrc =null;
+ bsrc = ImageIO.read(temp);
+ AffineTransform transform = new AffineTransform();
+ //transform.scale(scalex, scaley);
+ //transform.shear(30, 30);
+ transform.translate(100, 100);
+ //transform.rotate(radians, bufferedImage.getWidth()/2,
+ //bufferedImage.getHeight()/2);
+
+ AffineTransformOp op = new AffineTransformOp(transform,
+ AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
+ bsrc = op.filter(bsrc, null);
+ ImageIO.write(bsrc, "JPG", temp);
+ }
}
16 years, 11 months
JBoss Rich Faces SVN: r12237 - in trunk/test-applications/realworld: ejb/src/main/resources and 26 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-01-12 14:16:58 -0500 (Mon, 12 Jan 2009)
New Revision: 12237
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandler.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerInterceptor.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/RealworldException.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/EditorBean.java
trunk/test-applications/realworld/web/src/main/resources/messages_ru.properties
trunk/test-applications/realworld/web/src/main/resources/org/
trunk/test-applications/realworld/web/src/main/resources/org/richfaces/
trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/
trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/editor/
trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/editor/advanced.properties
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/error.xhtml
trunk/test-applications/realworld/web/src/main/webapp/img/gb.png
trunk/test-applications/realworld/web/src/main/webapp/img/ru.png
Removed:
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/lib/metadata-extractor-2.3.1.jar
Modified:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/gallery/GalleryBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/comments.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/slideshow.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/messages.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/sharedAlbums.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/tree.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/search/searchResults.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
Log:
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/SearchService.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -49,9 +49,6 @@
public List<Image> searchImages(String searchPattern, String additionalParams, Map<String, Object> paramMap){
String fullQuery = null;
- if(searchPattern.equals("")){
- return null;
- }
if(paramMap != null && paramMap.get(CASE_SENSITIVE_PARAMETER) != null){
boolean sensitive = (Boolean)paramMap.get(CASE_SENSITIVE_PARAMETER);
if(sensitive){
Modified: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -88,7 +88,7 @@
public boolean isUserExist(String login) {
return em.createNamedQuery(USER_EXIST_QUERY)
.setParameter(LOGIN_PARAMETER, login)
- .getResultList().size() == 0;
+ .getResultList().size() != 0;
}
public List<String> getUsers(String suggest) {
@@ -134,6 +134,7 @@
public void addSharedAlbum(Album album) {
user.addSharedAlbum(album);
+ album.getSharedOwners().add(user);
em.flush();
}
Modified: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2009-01-12 19:16:58 UTC (rev 12237)
@@ -1,6 +1,7 @@
INSERT INTO Users(user_id, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (1, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'amarkhel', '12345', '1985-01-08');
INSERT INTO Users(user_id, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (2, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'root', '12345', '1985-01-08');
INSERT INTO Users(user_id, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (3, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'qqqq', '12345', '1985-01-08');
+INSERT INTO Users(user_id, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (4, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.jpg', 'sss', '12345', '1985-01-08');
INSERT INTO albums(album_id, name, description, shared, album_user_id) VALUES (1, 'Cars', 'Photo of my dog', true, 1);
INSERT INTO albums(album_id, name, description, shared, album_user_id) VALUES (2, 'Tetki', 'Simple Album 2', true, 1);
INSERT INTO albums(album_id, name, description, shared, album_user_id) VALUES (3, 'Football', 'Simple Album 3', true, 2);
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandler.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandler.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandler.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,13 @@
+package org.richfaces.realworld.error;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.seam.annotations.intercept.Interceptors;
+
+(a)Target({ElementType.TYPE ,ElementType.METHOD })
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Interceptors(ErrorHandlerInterceptor.class)
+public @interface ErrorHandler {}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerBean.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerBean.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,47 @@
+package org.richfaces.realworld.error;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
+
+@Name("errorHandlerBean")
+(a)Scope(ScopeType.EVENT)
+@AutoCreate
+public class ErrorHandlerBean {
+
+ private List<Exception> errors = new ArrayList<Exception>();
+
+ public List<Exception> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(List<Exception> errors) {
+ this.errors = errors;
+ }
+
+ public boolean isErrorExist(){
+ return errors.size() > 0 ;
+ }
+
+ @Observer("clearErrorEvent")
+ public void clearEvents(){
+ errors.clear();
+ }
+
+ @Observer("addErrorEvent")
+ public void addToErrors(Exception e){
+ FacesContext context = FacesContext.getCurrentInstance();
+ AjaxContext ac = AjaxContext.getCurrentInstance(context);
+ ac.addRenderedArea("mainform:error");
+ errors.add(e);
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerInterceptor.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerInterceptor.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerInterceptor.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,18 @@
+package org.richfaces.realworld.error;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.intercept.AroundInvoke;
+import org.jboss.seam.annotations.intercept.Interceptor;
+import org.jboss.seam.core.BijectionInterceptor;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.intercept.InvocationContext;
+
+@Name("interceptor")
+public class ErrorHandlerInterceptor {
+
+ @AroundInvoke
+ public Object process(InvocationContext invocation) throws Exception {
+ Events.instance().raiseEvent("clearErrorEvent");
+ return invocation.proceed();
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/ErrorHandlerInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/RealworldException.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/RealworldException.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/RealworldException.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,21 @@
+package org.richfaces.realworld.error;
+
+import javax.ejb.ApplicationException;
+
+@ApplicationException
+public class RealworldException extends Exception{
+
+ private static final long serialVersionUID = -5514996140663854304L;
+
+ public RealworldException(String message) {
+ super(message);
+ }
+
+ public RealworldException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public RealworldException(Throwable cause) {
+ super(cause);
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/RealworldException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -26,7 +26,6 @@
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -157,7 +156,7 @@
g.drawRenderedImage(bsrc, at);
String dest = getUploadRoot() + transformPath(fileName, format);
- ImageIO.write(bsrc, "JPG", new File(dest));
+ ImageIO.write(bdest, "JPG", new File(dest));
inputStream.close();
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -36,7 +36,6 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
@Name("imageLoader")
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/gallery/GalleryBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/gallery/GalleryBean.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/gallery/GalleryBean.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -17,6 +17,7 @@
import org.richfaces.model.UploadItem;
import org.richfaces.realworld.domain.Gallery;
import org.richfaces.realworld.domain.GalleryImage;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.fileupload.FileItem;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.IGalleryAction;
@@ -67,7 +68,7 @@
image.setName(name);
image.setUploaded(new Date());
image.setPath(path);
- image.setSize(file.getLength());
+ image.setSize(file.getLength()/1000);
try {
InputStream in = new ByteArrayInputStream(file.getData());
Metadata metadata = JpegMetadataReader.readMetadata(in);
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -29,6 +29,7 @@
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.IAlbumAction;
import org.richfaces.realworld.tree.TreeAlbumItem;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -24,6 +24,7 @@
import java.io.Serializable;
import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -106,9 +107,9 @@
}
if(user.getChildAlbums().size() > 0){
selectionHelper.setSelectedAlbum(user.getChildAlbums().get(0));
- if(selectionHelper.getSelectedAlbum().getImages().size() > 0){
- selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
- }
+ //if(selectionHelper.getSelectedAlbum().getImages().size() > 0){
+ //selectionHelper.setSelectedImage(selectionHelper.getSelectedAlbum().getImages().get(0));
+ //}
}
Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
return true;
@@ -152,6 +153,9 @@
e.printStackTrace();
}
}
+
+ String messageTemplate = "You are successfully registered.";
+ facesMessages.add(messageTemplate);
return INDEX_OUTCOME;
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -31,6 +31,7 @@
import org.richfaces.realworld.domain.Comment;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.IImageAction;
import org.richfaces.realworld.tree.TreeAlbumItem;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -35,6 +35,7 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.Message;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.IMessageAction;
import org.richfaces.realworld.service.IUserAction;
@@ -119,7 +120,7 @@
throw new Exception("This user won't be your friend!");
}*/
}
-
+
public void addToSharedAlbums(Image image){
userAction.addSharedAlbum(image.getAlbum());
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/search/SearchBean.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -38,6 +38,7 @@
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.service.ISearchService;
import org.richfaces.realworld.service.SearchService;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -27,6 +27,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.tree.TreeSelectionManager;
@Name("slideshow")
@@ -76,8 +77,8 @@
public void updateInterval(){
this.setInterval((int)(DELAY * Long.valueOf(slideshowHelper.getInputSlider().getValue().toString())));
}
-
- public void incrementSlide(){
+ @ErrorHandler
+ public void incrementSlide() {
treeSelectionManager.incrementSlideshowIndex();
}
}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -28,7 +28,6 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import org.ajax4jsf.context.AjaxContext;
@@ -39,6 +38,7 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Synchronized;
+import org.jboss.seam.core.Events;
import org.richfaces.component.UIDatascroller;
import org.richfaces.component.UIDragSupport;
import org.richfaces.component.UITree;
@@ -51,6 +51,7 @@
import org.richfaces.model.TreeRowKey;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.error.ErrorHandler;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.manager.ImageManager;
import org.richfaces.realworld.navigation.NavigationEnum;
@@ -70,6 +71,8 @@
private static final String NEXT = "next";
private static final String LAST = "last";
+
+ private static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
private static final String PREVIOUS = "previous";
@@ -246,6 +249,7 @@
nodeTitle = ((TreeAlbumItem) (tree.getRowData())).getAlbum()
.getName();
}
+ Events.instance().raiseEvent(UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
TreeNode<String> currentNode = tree.getModelTreeNode(tree.getRowKey());
selectionHelper.setUserAlbumSelected(true);
if(currentNode instanceof TreeImageItem){
@@ -260,9 +264,10 @@
return;
}else if(currentNode instanceof TreeAlbumItem){
TreeAlbumItem node = (TreeAlbumItem)currentNode;
+ selectionHelper.setSelectedImage(null);
setDataScrollerIndex(0);
if (node.isLeaf()) {
- selectionHelper.setSelectedImage(null);
+ //selectionHelper.setSelectedImage(null);
Album album = node.getAlbum();
selectionHelper.setSelectedAlbum(album);
}else{
@@ -270,7 +275,7 @@
return;
}else{
selectionHelper.setSelectedAlbum(node.getAlbum());
- selectionHelper.setSelectedImage(node.getAlbum().getImages().get(0));
+ //selectionHelper.setSelectedImage(node.getAlbum().getImages().get(0));
}
}
}
@@ -280,9 +285,9 @@
}
}
- public void updateScroller(ActionEvent event){
- this.setDataScrollerIndex(selectionHelper.getSelectedImageIndex()- 1);
- }
+ //public void updateScroller(ActionEvent event){
+ //this.setDataScrollerIndex(selectionHelper.getSelectedImageIndex()- 1);
+ //}
private void setDataScrollerIndex(int index) {
UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
@@ -292,7 +297,12 @@
selectionHelper.setSelectedImageIndex(index+1);
}
+
public void incrementSlideshowIndex() {
+ if(null == selectionHelper.getSelectedAlbum()){
+ //Events.instance().raiseEvent("addErrorEvent", new RealworldException("You have no albums and images"));
+ return;
+ }
int index = selectionHelper.getSelectedAlbum().getIndex(selectionHelper.getSelectedImage());
if(selectionHelper.getSelectedAlbum().getImages().size() == index +1){
index = -1;
@@ -329,6 +339,7 @@
return group;
}
+ @ErrorHandler
public void updateSelectedItems(Image image){
selectionHelper.setSelectedImage(image);
Integer index = selectionHelper.getSelectedAlbum().getIndex(selectionHelper.getSelectedImage());
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/EditorBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/EditorBean.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/EditorBean.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,24 @@
+package org.richfaces.realworld.util;
+
+import org.jboss.seam.annotations.Name;
+
+@Name("editorBean")
+public class EditorBean {
+
+ private String currentConfiguration = "/org/richfaces/realworld/editor/advanced";
+
+ private boolean liveUpdatesEnabled=false;
+
+ public String getCurrentConfiguration() {
+ return currentConfiguration;
+ }
+
+ public boolean isLiveUpdatesEnabled() {
+ return liveUpdatesEnabled;
+ }
+
+ public void setLiveUpdatesEnabled(boolean liveUpdatesEnabled) {
+ this.liveUpdatesEnabled = liveUpdatesEnabled;
+ }
+
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/EditorBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/MessagePanelHelper.java 2009-01-12 19:16:58 UTC (rev 12237)
@@ -42,6 +42,8 @@
private boolean sendRequired;
+ private boolean messageSelected;
+
private boolean searchRequired = false;
@In
@@ -53,6 +55,10 @@
@In(create=true, required=true) @Out
private UserManager userManager;
+ public void closeMessage(){
+ this.setMessageSelected(false);
+ }
+
public void initReMessage(boolean sendRequired, Message message){
this.sendRequired = sendRequired;
this.message = new Message();
@@ -61,6 +67,7 @@
this.message.setOwner(message.getAuthor());
this.message.setReaded(false);
this.searchRequired = false;
+ this.setMessageSelected(true);
}
public void initMessage(boolean sendRequired, Message message, boolean userSearchRequired){
@@ -69,6 +76,7 @@
this.message = new Message();
this.message.setAuthor(user);
this.message.setReaded(false);
+ this.setMessageSelected(true);
}
public void initMessage(boolean sendRequired, Message message){
@@ -77,6 +85,7 @@
this.message.setReaded(true);
this.searchRequired = false;
userManager.setCountUnreadedMessages(null);
+ this.setMessageSelected(true);
}
public void initMessage(boolean sendRequired, User owner){
@@ -86,6 +95,7 @@
this.message.setOwner(owner);
this.message.setReaded(false);
this.searchRequired = false;
+ this.setMessageSelected(true);
}
public void initMessage(boolean sendRequired, User owner, String theme, String message){
@@ -97,6 +107,7 @@
this.message.setTheme(theme);
this.message.setMessage(message);
this.searchRequired = false;
+ this.setMessageSelected(true);
}
public void initMessage(boolean sendRequired, User owner, String theme, String message, boolean friendshipRequest){
@@ -109,11 +120,13 @@
this.message.setMessage(message);
this.message.setFriendshipRequest(friendshipRequest);
this.searchRequired = false;
+ this.setMessageSelected(true);
}
public void sendMessage(ActionEvent event){
this.message.setDate(new Date());
userManager.sendMessage(this.message);
+ this.setMessageSelected(false);
}
public boolean isSendRequired() {
@@ -131,4 +144,12 @@
public void setSearchRequired(boolean searchRequired) {
this.searchRequired = searchRequired;
}
+
+ public boolean isMessageSelected() {
+ return messageSelected;
+ }
+
+ public void setMessageSelected(boolean messageSelected) {
+ this.messageSelected = messageSelected;
+ }
}
Added: trunk/test-applications/realworld/web/src/main/resources/messages_ru.properties
===================================================================
--- trunk/test-applications/realworld/web/src/main/resources/messages_ru.properties (rev 0)
+++ trunk/test-applications/realworld/web/src/main/resources/messages_ru.properties 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,198 @@
+\ufeffvalidator.assertFalse=\u041f\u0440\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430
+validator.assertTrue=\u041F\u0440\u0438 \u0432\u0430\u043B\u0438\u0434\u0430\u0446\u0438\u0438 \u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430
+validator.future=\u042D\u0442\u0430 \u0434\u0430\u0442\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043C
+validator.length=\u0414\u043B\u0438\u043D\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u043C\u0435\u0436\u0434\u0443 {min} \u0438 {max}
+validator.max=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u044B\u043C {value}
+validator.min=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u044B\u043C {value}
+validator.notNull=\u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0443\u043B\u0435\u043C
+validator.past=\u042D\u0442\u0430 \u0434\u0430\u0442\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u0432 \u043F\u0440\u043E\u0448\u043B\u043E\u043C
+validator.pattern=\u0434\u043E\u043B\u0436\u043D\u043E \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u044E "{regex}"
+validator.range=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u044C\u0441\u044F \u043C\u0435\u0436\u0434\u0443 {min} \u0438 {max}
+validator.size=\u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043C\u0435\u0436\u0434\u0443 {min} \u0438 {max}
+validator.email=email \u0430\u0434\u0440\u0435\u0441 \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u044B\u043C
+
+org.jboss.seam.loginFailed=\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043B\u043E\u0433\u0438\u043D\u0435
+org.jboss.seam.loginSuccessful=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C, \#0
+
+javax.faces.component.UIInput.CONVERSION=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u044F \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043F\u0440\u0435\u043E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u043E \u043A \u043D\u0443\u0436\u043D\u043E\u043C\u0443 \u0444\u043E\u0440\u043C\u0430\u0442\u0443
+javax.faces.component.UIInput.REQUIRED=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E
+javax.faces.component.UIInput.UPDATE=\u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430
+javax.faces.component.UISelectOne.INVALID=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043D\u0435\u0432\u0435\u0440\u043D\u043E
+javax.faces.component.UISelectMany.INVALID=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043D\u0435\u0432\u0435\u0440\u043D\u043E
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0447\u0438\u0441\u043B\u043E\u043C
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u043B\u043E\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u043C \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C, \u0441\u043E\u0441\u0442\u043E\u044F\u0449\u0438\u043C \u0438\u0437 \u043E\u0434\u043D\u043E\u0439 \u0438\u043B\u0438 \u0431\u043E\u043B\u0435\u0435 \u0446\u0438\u0444\u0440, \u0430 \u0442\u0430\u043A\u0436\u0435 \u043E\u043F\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u043E \u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u043E \u0442\u043E\u0447\u043A\u043E\u0439, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 . {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0446\u0435\u043B\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u043B\u043E\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C, \u0441\u043E\u0441\u0442\u043E\u044F\u0449\u0438\u043C \u0438\u0437 \u043E\u0434\u043D\u043E\u0439 \u0438\u043B\u0438 \u0431\u043E\u043B\u0435\u0435 \u0446\u0438\u0444\u0440
+javax.faces.converter.BooleanConverter.BOOLEAN=\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043B\u0438\u0431\u043E \u0438\u0441\u0442\u0438\u043D\u043D\u044B\u043C \u043B\u0438\u0431\u043E \u043D\u0435\u0442
+javax.faces.converter.ByteConverter.BYTE=\u0447\u0438\u0441\u043B\u043E \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043C\u0435\u0436\u0434\u0443 0 \u0438 255
+javax.faces.converter.ByteConverter.BYTE_detail=\u0447\u0438\u0441\u043B\u043E \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043C\u0435\u0436\u0434\u0443 0 \u0438 255
+
+error=\u041E\u0448\u0438\u0431\u043A\u0430
+errorStub=\u0421\u043B\u0443\u0447\u0438\u043B\u043E\u0441\u044C \u0447\u0442\u043E-\u0442\u043E \u043D\u0435\u043F\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043D\u043D\u043E\u0435 \:-(
+
+fileUpload.header=\u0412\u0430\u0448\u0438 \u0444\u0430\u0439\u043B\u044B \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u044B \u0432 \u0430\u043B\u044C\u0431\u043E\u043C\: \#{selectionHelper.selectedAlbum.name}. \u0415\u0441\u043B\u0438 \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0445 \u0432 \u0434\u0440\u0443\u0433\u043E\u0439 \u0430\u043B\u044C\u0431\u043E\u043C, \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0435\u0433\u043E.
+fileUpload.header2=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\:
+fileUpload.uploadedPanelHeader=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u0430\u0445
+fileUpload.fileNameLabel=\u0418\u043C\u044F \u0444\u0430\u0439\u043B\u0430\:
+fileUpload.fileLengthLabel=\u0420\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445\:
+fileUpload.fileEditLabel=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C
+fileUpload.storeAllLabel=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0432\u0441\u0435
+fileUpload.storeSelectedLabel=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435
+fileUpload.clearLabel=\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435
+fileUpload.clearSelectedLabel=\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435
+
+comment.label=\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 (\#{selectionHelper.selectedImage.comments.size})
+comment.author=\u0410\u0432\u0442\u043E\u0440\: \#{record.author.login}
+comment.askForFriend=\u0417\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0434\u0440\u0443\u0436\u0431\u0443
+comment.askForFriend.message=\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043C\u0435\u043D\u044F \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0432\u0430\u0448\u0438\u0445 \u0434\u0440\u0443\u0437\u0435\u0439.
+comment.date=\u0414\u0430\u0442\u0430\: \#{record.date}
+comment.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
+comment.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
+comment.noComments=\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 \u043A \u044D\u0442\u043E\u0439 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442
+comment.add=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
+comment.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
+comment.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
+
+message.sendMessage=\u041F\u043E\u0441\u043B\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435
+message.sendToUser=\u041F\u043E\u0441\u043B\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044E
+message.readed=\u041E\u0442\u043C\u0435\u0442\u0438\u0442\u044C \u043A\u0430\u043A \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u043E\u0435
+message.authorHeader=\u0410\u0432\u0442\u043E\u0440
+message.themeHeader=\u0422\u0435\u043C\u0430
+message.dateHeader=\u0414\u0430\u0442\u0430
+message.theme=\u0422\u0435\u043C\u0430\:
+message.author=\u0410\u0432\u0442\u043E\u0440\:
+message.date=\u0414\u0430\u0442\u0430\: \#{record.date}
+message.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
+message.read=\u041F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C
+message.re=Re:
+message.message=\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435
+message.owner=\u041F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044C\:
+message.content=\u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435\:
+message.addFriend=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0434\u0440\u0443\u0437\u044C\u044F
+message.friendRequest=\u042D\u0442\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u043C \u043D\u0430 \u0434\u0440\u0443\u0436\u0431\u0443. Y\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0432 \u0434\u0440\u0443\u0437\u044C\u044F, \u043D\u0430\u0436\u0430\u0432 \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443 '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0434\u0440\u0443\u0437\u044C\u044F'.
+message.send=\u041F\u043E\u0441\u043B\u0430\u0442\u044C
+message.close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C
+
+confirm.confirm=\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435\:
+confirm.ok=OK
+confirm.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
+
+shared.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 shared \u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
+
+album.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C
+album.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
+album.delete.confirm=\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B? \u0412\u0441\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0432 \u044D\u0442\u043E\u043C \u0430\u043B\u044C\u0431\u043E\u043C\u0435 \u0442\u0430\u043A\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043B\u0435\u043D\u044B\! \u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u041E\u041A \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F \u0438\u043B\u0438 \u041E\u0442\u043C\u0435\u043D\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0440\u044B\u0432\u0430\u043D\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438.
+album.add=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C
+album.edit.long=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C\:
+album.addImages=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A
+album.name=\u0418\u043C\u044F\:
+album.shared=\u0414\u043E\u0441\u0442\u0443\u043F \u0434\u043B\u044F \u0432\u0441\u0435\u0445\:
+album.owner=\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446\:
+album.desc=\u041A\u043E\u0440\u043E\u0442\u043A\u043E\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\:
+album.store=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
+album.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
+
+scroller.first=\u041F\u0435\u0440\u0432\u0430\u044F
+scroller.last=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F
+scroller.prev=\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F
+scroller.next=\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F
+scroller.pager.begin=\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
+scroller.pager.end= \u0438\u0437 \#{selectionHelper.selectedAlbum.images.size}
+
+image.rating=\u0422\u0435\u043A\u0443\u0449\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043D\u0433\: \#{record.rank.rating}
+image.numberVotes=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0433\u043E\u043B\u043E\u0441\u043E\u0432\: \#{record.rank.hits}
+image.vote=\u041F\u0440\u043E\u0433\u043E\u043B\u043E\u0441\u043E\u0432\u0430\u0442\u044C \u0437\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
+image.vote.short=\u0413\u043E\u043B\u043E\u0441\u043E\u0432\u0430\u0442\u044C
+image.panelHeader=\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439\: \u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0430\u043B\u044C\u0431\u043E\u043C\: \#{selectionHelper.selectedAlbum.name}
+image.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
+image.delete.confirm=\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B?
+image.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430
+image.prop=\u0421\u0432\u043E\u0439\u0441\u0442\u0432\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\:
+image.name=\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435\:
+image.desc=\u041A\u043E\u0440\u043E\u0442\u043A\u043E\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\:
+image.album=\u0410\u043B\u044C\u0431\u043E\u043C
+image.date=\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F\:
+image.meta=\u041C\u0435\u0442\u0430-\u0438\u043D\u043E\u0444\u0440\u043C\u0430\u0446\u0438\u044F\:
+image.store=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
+image.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
+
+slideshow.start=\u041D\u0430\u0447\u0430\u0442\u044C \u0441\u043B\u0430\u0439\u0434-\u0448\u043E\u0443
+slideshow.stop=\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043B\u0430\u0439\u0434-\u0448\u043E\u0443
+slideshow.interval=\u0418\u043D\u0442\u0435\u0440\u0432\u0430\u043B \u0432 \u0441\u0435\u043A.
+
+index.header=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C\!
+
+login.header=\u0412\u0445\u043E\u0434 \u0432 \u0441\u0438\u0441\u0442\u0435\u043C\u0443
+login.login=\u041B\u043E\u0433\u0438\u043D
+login.userName=\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
+login.password=\u041F\u0430\u0440\u043E\u043B\u044C
+login.register=\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F
+login.anonymous=\u0410\u043D\u043E\u043D\u0438\u043C\u043D\u044B\u0439 \u0432\u0445\u043E\u0434
+
+friends.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439
+friends.choose=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u043B\u044C\u0431\u043E\u043C \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430\:
+
+search.advanced=\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u043F\u043E\u0438\u0441\u043A\:
+search.rank=\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u043E\u0446\u0435\u043D\u043A\u0430\:
+search.numberVotes=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u0440\u043E\u0433\u043E\u043B\u043E\u0441\u043E\u0432\u0430\u0432\u0448\u0438\u0445\:
+search.date=\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F
+search.addShared=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A 'shared' \u0430\u043B\u044C\u0431\u043E\u043C\u0430\u043C
+search.preview=\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440
+search.search=\u041F\u043E\u0438\u0441\u043A
+search.popular=\u041F\u043E\u043F\u0443\u043B\u044F\u0440\u043D\u044B\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438
+search.unpopular=\u041E\u0442\u0441\u0442\u043E\u0439
+search.nofound=\u041D\u0438 \u043E\u0434\u043D\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0445\u043E\u0434\u0438\u0442 \u043F\u043E\u0434 \u0432\u0430\u0448\u0438 \u043A\u0440\u0438\u0442\u0435\u0440\u0438\u0438
+
+user.loginPrefs=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430
+user.registration=\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F
+user.reginfo=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F, \u043A\u0430\u0441\u0430\u044E\u0449\u0430\u044F\u0441\u044F \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438\:
+user.firstname=\u0418\u043C\u044F
+user.secondname=\u0424\u0430\u043C\u0438\u043B\u0438\u044F
+user.login=\u041B\u043E\u0433\u0438\u043D
+user.password=\u041F\u0430\u0440\u043E\u043B\u044C
+user.email=Email
+user.birthdate=\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F
+user.avatar=\u0410\u0432\u0430\u0442\u0430\u0440
+user.userPrefs=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
+user.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
+user.reset=\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043D\u0430 \u043F\u0440\u0435\u0436\u043D\u0438\u0435
+user.confirm=\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u044C
+user.avatar.info=\u0418\u043D\u043E\u0444\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u0430\u0445
+user.avatar.name=\u0418\u043C\u044F \u0444\u0430\u0439\u043B\u0430\:
+user.avatar.length=\u0414\u043B\u0438\u043D\u0430 \u0444\u0430\u0439\u043B\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445\:
+user.register=\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F
+user.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
+user.exist=\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0441 \u0442\u0430\u043A\u0438\u043C \u043B\u043E\u0433\u0438\u043D\u043E\u043C \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442;
+user.confirm.error=\u041F\u0430\u0440\u043E\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u044B \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0442\u044C
+
+menu.welcome=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C, \#{identity.username}\!
+menu.welcome.guest=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C, \u0433\u043E\u0441\u0442\u044C\! \u0415\u0441\u043B\u0438 \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0438\u043C\u0435\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F \u043A\u043E \u0432\u0441\u0435\u043C \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044F\u043C \u0441\u0438\u0441\u0442\u0435\u043C\u044B, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044C
+menu.message.tooltip=\u0423 \u0432\u0430\u0441 \#{userManager.countUnreadedMessages} \u043D\u0435\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
+menu.messages=\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F
+menu.search=\u041F\u043E\u0438\u0441\u043A
+menu.image=\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A
+menu.user=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
+menu.file=\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A
+menu.logout=\u0412\u044B\u0445\u043E\u0434
+menu.login=\u0412\u0445\u043E\u0434
+
+realworld=RealWorld Demo application
+panel.albumHeader=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u0430\u043C\u0438
+panel.my=\u041C\u043E\u0438 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
+panel.friend=\u0410\u043B\u044C\u0431\u043E\u043C\u044B \u0434\u0440\u0443\u0437\u0435\u0439
+panel.shared=\u041B\u044E\u0431\u0438\u043C\u044B\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
+
+samplename=\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435
+sampledesc=\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435
+addedtofriends=\u0412\u044B \u0431\u044B\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0434\u0440\u0443\u0437\u0435\u0439
+addedtofriendsby=\u0412\u044B \u0431\u044B\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0434\u0440\u0443\u0437\u0435\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u043C
+removedfromfriends=\u0412\u044B \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439
+removedfromfriendsby=\u0412\u044B \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
+equals=\u0420\u0430\u0432\u043D\u043E
+more=\u041C\u0435\u043D\u044C\u0448\u0435
+less=\u0411\u043E\u043B\u044C\u0448\u0435
+nomatter=\u041D\u0435 \u0438\u043C\u0435\u0435\u0442 \u0437\u0430\u043D\u0447\u0435\u043D\u0438\u044F
+small=\u041C\u0430\u043B\u0435\u043D\u044C\u043A\u0430\u044F
+medium=\u0421\u0440\u0435\u0434\u043D\u044F\u044F
+full=\u041F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440
Property changes on: trunk/test-applications/realworld/web/src/main/resources/messages_ru.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/editor/advanced.properties
===================================================================
--- trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/editor/advanced.properties (rev 0)
+++ trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/editor/advanced.properties 2009-01-12 19:16:58 UTC (rev 12237)
@@ -0,0 +1,5 @@
+theme="advanced"
+theme_advanced_toolbar_location="top"
+theme_advanced_toolbar_align="left"
+plugins="preview,insertdatetime"
+theme_advanced_buttons3="hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
Property changes on: trunk/test-applications/realworld/web/src/main/resources/org/richfaces/realworld/editor/advanced.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2009-01-12 19:16:58 UTC (rev 12237)
@@ -22,6 +22,7 @@
<core:init transaction-management-enabled="false" debug="true" jndi-pattern="@jndiPattern@"/>
<web:context-filter url-pattern="/picture/*" />
+ <web:character-encoding-filter encoding="UTF-8" override-client="true" url-pattern="*.seam" />
<core:manager concurrent-request-timeout="20000"
conversation-timeout="120000"
conversation-id-parameter="cid"
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml 2009-01-12 19:16:58 UTC (rev 12237)
@@ -7,11 +7,8 @@
<application>
<locale-config>
<default-locale>en</default-locale>
- <supported-locale>bg</supported-locale>
- <supported-locale>de</supported-locale>
<supported-locale>en</supported-locale>
- <supported-locale>fr</supported-locale>
- <supported-locale>tr</supported-locale>
+ <supported-locale>ru</supported-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
Deleted: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/lib/metadata-extractor-2.3.1.jar
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2009-01-12 19:16:58 UTC (rev 12237)
@@ -11,6 +11,9 @@
<rule if-outcome="home">
<redirect view-id="/index.xhtml"/>
</rule>
+ <rule if-outcome="index">
+ <redirect view-id="/index.xhtml"/>
+ </rule>
<rule if-outcome="register">
<redirect view-id="/register.xhtml"/>
</rule>
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-01-12 19:00:22 UTC (rev 12236)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-01-12 19:16:58 UTC (rev 12237)
@@ -28,4 +28,8 @@
<tag-name>linkPanel</tag-name>
<source>templates/linkPanel.xhtml</source>
</tag>
+ <tag>
+ <tag-name>error</tag-name>
+ <source>templates/error.xhtml</source>
+ </tag>
</facelet-taglib>
\ No newline at end of file
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/error.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/error.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/message.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld/web/src/main/webapp/img/gb.png
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/gb.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Added: trunk/test-applications/realworld/web/src/main/webapp/img/ru.png
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/ru.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/image/comments.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/image/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/imagePreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/messages.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/sharedAlbums.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/tree.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/search/searchResults.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
16 years, 11 months
JBoss Rich Faces SVN: r12236 - trunk/sandbox/samples/maven-rd-plugin-sample.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-12 14:00:22 -0500 (Mon, 12 Jan 2009)
New Revision: 12236
Modified:
trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml
Log:
Modified: trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml 2009-01-12 18:59:40 UTC (rev 12235)
+++ trunk/sandbox/samples/maven-rd-plugin-sample/pom.xml 2009-01-12 19:00:22 UTC (rev 12236)
@@ -21,10 +21,19 @@
</configuration>
</plugin>
<plugin>
- <artifactId>maven-resource-dependency-plugin</artifactId>
- <groupId>org.richfaces.cdk.sandbox</groupId>
-
- </plugin>
+ <artifactId>maven-resource-dependency-plugin</artifactId>
+ <groupId>org.richfaces.cdk.sandbox</groupId>
+ <version>3.3.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>assemblyScripts</goal>
+ <goal>assemblyStyles</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
16 years, 11 months
JBoss Rich Faces SVN: r12235 - trunk/sandbox/cdk/maven-resource-dependency-plugin.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-12 13:59:40 -0500 (Mon, 12 Jan 2009)
New Revision: 12235
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml
Log:
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml 2009-01-12 18:59:14 UTC (rev 12234)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/pom.xml 2009-01-12 18:59:40 UTC (rev 12235)
@@ -22,8 +22,12 @@
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
-
<dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.4</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.0-beta-1</version>
16 years, 11 months
JBoss Rich Faces SVN: r12234 - in trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd: mojo and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-01-12 13:59:14 -0500 (Mon, 12 Jan 2009)
New Revision: 12234
Added:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentFilter.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentFilter.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichWebSourceWalker.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/XhtmlFileNameFilter.java
Modified:
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateStyleMojo.java
Log:
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentFilter.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentFilter.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentFilter.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -0,0 +1,16 @@
+package org.richfaces.cdk.rd;
+
+public interface ComponentFilter {
+
+ public static String A4J_NEW = "http://richfaces.org/a4j";
+
+ public static String A4J_OD = "";
+
+ public static String RICH_NEW = "http://richfaces.org/rich";
+
+ public static String RICH_OLD = "";
+
+
+ public boolean accept(String name);
+
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/ComponentsScanner.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -0,0 +1,16 @@
+package org.richfaces.cdk.rd;
+
+import java.io.File;
+import java.util.Set;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public interface ComponentsScanner {
+
+ public void doScan(File file) throws Exception;
+
+ public Set <String> getResult();
+
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentFilter.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentFilter.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentFilter.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -0,0 +1,9 @@
+package org.richfaces.cdk.rd;
+
+public class RichComponentFilter implements ComponentFilter{
+
+ public boolean accept(String name) {
+ return true;
+ }
+
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichComponentsScanner.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -0,0 +1,50 @@
+package org.richfaces.cdk.rd;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.parsers.SAXParser;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class RichComponentsScanner implements ComponentsScanner {
+
+ private SAXParser parser;
+
+ private Set <String> components = new HashSet<String>();
+
+
+ DefaultHandler defaultHandler = new DefaultHandler () {
+ @Override
+ public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException {
+ components.add(name);
+ }
+ };
+
+ public RichComponentsScanner(SAXParser parser) {
+ this.parser = parser;
+ }
+
+ public Set<String> getResult() {
+ return components;
+ }
+
+ public SAXParser getParser() {
+ return parser;
+ }
+
+ public void setParser(SAXParser parser) {
+ this.parser = parser;
+ }
+
+ public void doScan(File file) throws Exception {
+ parser.parse(file, defaultHandler);
+ }
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichWebSourceWalker.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichWebSourceWalker.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/RichWebSourceWalker.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -0,0 +1,52 @@
+package org.richfaces.cdk.rd;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class RichWebSourceWalker {
+
+
+ private FilenameFilter filter;
+
+ private ComponentsScanner scanner;
+
+ public RichWebSourceWalker(ComponentsScanner scanner) {
+ this(scanner, new FilenameFilter () {
+ public boolean accept(File dir, String name) {
+ return true;
+ }
+ }) ;
+ }
+
+ public RichWebSourceWalker(ComponentsScanner scanner, FilenameFilter filter) {
+ this.filter = filter;
+ this.scanner = scanner;
+ }
+
+ public void walk(File file) throws Exception{
+ if(file.isDirectory()) {
+ String[] children = file.list();
+ for (String child : children) {
+ walk((new File(file, child)));
+ }
+ } else {
+ if(filter.accept(file, file.getName())) {
+ System.out.println("Process File: " + file.getName());
+ scanner.doScan(file);
+ }
+ }
+ }
+
+ public FilenameFilter getFilter() {
+ return filter;
+ }
+
+ public void setFilter(FilenameFilter filter) {
+ this.filter = filter;
+ }
+}
Added: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/XhtmlFileNameFilter.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/XhtmlFileNameFilter.java (rev 0)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/XhtmlFileNameFilter.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -0,0 +1,21 @@
+/**
+ *
+ */
+package org.richfaces.cdk.rd;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class XhtmlFileNameFilter implements FilenameFilter {
+
+ public String XHTML_PAGE = ".xhtml";
+
+ public boolean accept(File dir, String name) {
+ return name.endsWith(XHTML_PAGE) ? true : false;
+ }
+
+}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-12 18:21:53 UTC (rev 12233)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateScriptMojo.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -22,9 +22,18 @@
package org.richfaces.cdk.rd.mojo;
import java.io.File;
+import java.util.Set;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.richfaces.cdk.rd.ComponentsScanner;
+import org.richfaces.cdk.rd.RichWebSourceWalker;
+import org.richfaces.cdk.rd.RichComponentsScanner;
+import org.richfaces.cdk.rd.XhtmlFileNameFilter;
/**
* @author Anton Belevich
@@ -35,6 +44,13 @@
*/
public class CreateScriptMojo extends AbstractMojo {
+ /** Top maven project.
+ *
+ * @parameter expression="${project}"
+ * @readonly
+ */
+ protected MavenProject project;
+
/**
* outputScriptDirectory
* @parameter
@@ -48,12 +64,35 @@
private String scriptPackName;
/**
+ * webSourceDirectory
+ * @parameter expression="${basedir}/src/main/webapp" ;
+ */
+ private File webSourceDirectory;
+
+ /**
* loadOrder
* @parameter;
*/
private String loadOrder;
public void execute() throws MojoExecutionException {
- System.out.println("CreateScriptMojo.execute()");
+ try {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ SAXParser saxParser = saxParserFactory.newSAXParser();
+
+ ComponentsScanner scanner = new RichComponentsScanner(saxParser);
+
+ RichWebSourceWalker walker = new RichWebSourceWalker(scanner, new XhtmlFileNameFilter());
+ walker.walk(webSourceDirectory);
+
+ Set <String>result = scanner.getResult();
+ for(String component: result) {
+ System.out.println(component);
+ }
+
+ } catch (Exception e) {
+ throw new MojoExecutionException(e.getMessage(),e);
+ }
+
}
}
Modified: trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateStyleMojo.java
===================================================================
--- trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateStyleMojo.java 2009-01-12 18:21:53 UTC (rev 12233)
+++ trunk/sandbox/cdk/maven-resource-dependency-plugin/src/main/java/org/richfaces/cdk/rd/mojo/CreateStyleMojo.java 2009-01-12 18:59:14 UTC (rev 12234)
@@ -46,6 +46,12 @@
private String stylePackName;
/**
+ * webSourceDirectory
+ * @parameter expression="${basedir}/src/main/webapp" ;
+ */
+ private File webSourceDirectory;
+
+ /**
* loadOrder
* @parameter;
*/
16 years, 11 months
JBoss Rich Faces SVN: r12233 - trunk/docs/realworld_app_guide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-01-12 13:21:53 -0500 (Mon, 12 Jan 2009)
New Revision: 12233
Modified:
trunk/docs/realworld_app_guide/en/src/main/docbook/modules/getting_started.xml
Log:
Modified: trunk/docs/realworld_app_guide/en/src/main/docbook/modules/getting_started.xml
===================================================================
--- trunk/docs/realworld_app_guide/en/src/main/docbook/modules/getting_started.xml 2009-01-12 17:58:40 UTC (rev 12232)
+++ trunk/docs/realworld_app_guide/en/src/main/docbook/modules/getting_started.xml 2009-01-12 18:21:53 UTC (rev 12233)
@@ -34,10 +34,10 @@
<itemizedlist>
<listitem><para><literallayout><emphasis>Checkout the project using installed SVN client</emphasis>.
URL of repository: <code>https://svn.jboss.org/repos/richfaces/trunk/test-applications/realworld/</code></literallayout></para></listitem>.
- <listitem><para><emphasis>Build the project</emphasis>. Open command line, point to the folder with checkouted project and tell Maven: <code>mvn clean install eclipse:eclipseMaven 2.0.9</code>.</para></listitem>
+ <listitem><para><emphasis>Build the project</emphasis>. Open command line, point to the folder with checkouted project and tell Maven: <code>mvn clean install eclipse:eclipse</code>.</para></listitem>
<listitem><para><emphasis>Import the project into your IDE</emphasis>. Steps to do for JBDS users: click <code>File</code> -> <code>Import</code> and select <code>Existing project into Workspace</code> as import source; in <code>Import Project</code> window click <code>Browse</code> button and point to the realworld project folder; сlick <code>OK</code>. Three SNAPSHOTS (ear, ejb, web) should appear in <code>Projects</code> area. Checkmark them all and click <code>Finish</code>. These projects should appear in JBDS <code>Package Explorer</code> window.</para></listitem>
- <listitem><para><emphasis>Register the pass to project images</emphasis>. Open project <code>web.xml</code> file (<code>realworld-web-1.0-SNAPSHOT\src\main\webapp\WEB-INF\web.xml</code>) and change <code>uploadRoot</code> parameter value from <code>E:\Andrey\Upload\</code> to yours e.g. <code>D:\realworld\Upload\</code>.</para></listitem>
- <listitem><para><emphasis>Run realworld-ear-1.0-SNAPSHOT</emphasis> on the <code>JBoss 4.2. Server</code> under 3 Runtime (those who prefer manual job ^) should deploy and start realqorld.ear file).</para></listitem>
+ <listitem><para><emphasis>Register the pass to project images</emphasis>. Open project <code>web.xml</code> file (<code>realworld-web-1.0-SNAPSHOT/src/main/webapp/WEB-INF/web.xml</code>) and change <code>uploadRoot</code> parameter value from <code>E:/Andrey/Upload/</code> to yours e.g. <code>D:/realworld/Upload/</code>.</para></listitem>
+ <listitem><para><emphasis>Run realworld-ear-1.0-SNAPSHOT</emphasis> on the <code>JBoss 4.2. Server</code> under 3 Runtime (those who prefer manual job should deploy and start <code>realworld.ear</code> file).</para></listitem>
<listitem><para>Browse to <code>http:/localhost:8080/realworld</code>.</para></listitem>
</itemizedlist>
16 years, 11 months
JBoss Rich Faces SVN: r12232 - trunk/docs/realworld_app_guide/en/src/main/docbook.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2009-01-12 12:58:40 -0500 (Mon, 12 Jan 2009)
New Revision: 12232
Modified:
trunk/docs/realworld_app_guide/en/src/main/docbook/master.xml
Log:
RF-4494: Tutorial about developing this sample application
Modified: trunk/docs/realworld_app_guide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/realworld_app_guide/en/src/main/docbook/master.xml 2009-01-12 17:55:34 UTC (rev 12231)
+++ trunk/docs/realworld_app_guide/en/src/main/docbook/master.xml 2009-01-12 17:58:40 UTC (rev 12232)
@@ -10,7 +10,7 @@
<book>
<bookinfo>
- <title>RichFaces Real World Application Guide</title>
+ <title>RichFaces Real World Application Tutorial</title>
<author>
<firstname>Alex</firstname>
16 years, 11 months
JBoss Rich Faces SVN: r12231 - in trunk/cdk: generator/src/main/resources/META-INF/templates12 and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-01-12 12:55:34 -0500 (Mon, 12 Jan 2009)
New Revision: 12231
Added:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourceType.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBeanEntry.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesDependenciesGenerator.java
trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-dependencies.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/component-dependencies.vm
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilder.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBean.java
trunk/cdk/maven-cdk-plugin/
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CompileMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateComponentMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateTestMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java
Log:
https://jira.jboss.org/jira/browse/RF-5626
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilder.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilder.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/AbstractClassStubBuilder.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -33,8 +33,10 @@
import net.sf.cglib.core.MethodInfo;
import net.sf.cglib.core.ReflectUtils;
import net.sf.cglib.core.Signature;
+import net.sf.cglib.proxy.Callback;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.NoOp;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Constants;
@@ -46,38 +48,96 @@
*
*/
public class AbstractClassStubBuilder {
+
+ public static Object buildInterfaceStub(final Class<?> clazz, ClassLoader classLoader) throws InstantiationException, IllegalAccessException {
+ Enhancer enhancer = new Enhancer() {
+ public void generateClass(ClassVisitor v) throws Exception {
+ ClassEmitter ce = new ClassEmitter(v);
+ ce.begin_class(Constants.V1_5,
+ Constants.ACC_PUBLIC,
+ getClassName(),
+ null,
+ new Type[]{Type.getType(clazz)},
+ null);
+ EmitUtils.null_constructor(ce);
+ List methods = new ArrayList();
+ getMethods(Object.class, new Class[]{clazz}, methods);
+
+ for (Iterator iterator = methods.iterator(); iterator
+ .hasNext();) {
+ Method method = (Method) iterator.next();
+
+ if (Modifier.isAbstract(method.getModifiers())) {
+ MethodInfo methodInfo = ReflectUtils.getMethodInfo(method);
+ Signature signature = methodInfo.getSignature();
+ Type returnType = signature.getReturnType();
+
+ CodeEmitter e = ce.begin_method(method.getModifiers() & ~Modifier.ABSTRACT,
+ signature, methodInfo.getExceptionTypes(),
+ methodInfo.getAttribute());
+
+ e.zero_or_null(returnType);
+ e.return_value();
+
+ Type[] argumentTypes = methodInfo.getSignature().getArgumentTypes();
+ int size = 0;
+ if (argumentTypes != null) {
+ for (int i = 0; i < argumentTypes.length; i++) {
+ size += argumentTypes[i].getSize();
+ }
+ }
+
+ // 1 is for this
+ e.visitMaxs(returnType.getSize(), size + 1);
+
+ e.end_method();
+ }
+ }
+
+ ce.end_class();
+ }
+ };
+
+ enhancer.setCallbackType(NoOp.class);
+ enhancer.setInterfaces(new Class[]{clazz});
+ enhancer.setClassLoader(classLoader != null ?
+ classLoader : clazz.getClassLoader());
+
+ return enhancer.createClass().newInstance();
+ }
+
public static <T> T buildStub(final Class<T> clazz, MethodInterceptor interceptor,
ClassLoader classLoader) {
Class<T> instrumentedClass;
-
+
if ((Modifier.ABSTRACT & clazz.getModifiers()) != 0) {
Enhancer enhancer = new Enhancer() {
@Override
public void generateClass(ClassVisitor v) throws Exception {
- ClassEmitter ce = new ClassEmitter(v);
- ce.begin_class(Constants.V1_5,
- Constants.ACC_PUBLIC,
- getClassName(),
- Type.getType(clazz),
- null,
- null);
- EmitUtils.null_constructor(ce);
- List methods = new ArrayList();
- getMethods(clazz, null, methods);
-
- for (Iterator iterator = methods.iterator(); iterator
- .hasNext();) {
+ ClassEmitter ce = new ClassEmitter(v);
+ ce.begin_class(Constants.V1_5,
+ Constants.ACC_PUBLIC,
+ getClassName(),
+ Type.getType(clazz),
+ null,
+ null);
+ EmitUtils.null_constructor(ce);
+ List methods = new ArrayList();
+ getMethods(clazz, null, methods);
+
+ for (Iterator iterator = methods.iterator(); iterator
+ .hasNext();) {
Method method = (Method) iterator.next();
-
+
if (Modifier.isAbstract(method.getModifiers())) {
MethodInfo methodInfo = ReflectUtils.getMethodInfo(method);
Signature signature = methodInfo.getSignature();
Type returnType = signature.getReturnType();
-
+
CodeEmitter e = ce.begin_method(method.getModifiers() & ~Modifier.ABSTRACT,
signature, methodInfo.getExceptionTypes(),
methodInfo.getAttribute());
-
+
e.zero_or_null(returnType);
e.return_value();
@@ -88,15 +148,15 @@
size += argumentTypes[i].getSize();
}
}
-
+
// 1 is for this
e.visitMaxs(returnType.getSize(), size + 1);
-
+
e.end_method();
}
- }
-
- ce.end_class();
+ }
+
+ ce.end_class();
}
};
enhancer.setSuperclass(clazz);
@@ -117,3 +177,4 @@
}
}
+
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourceType.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourceType.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourceType.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -0,0 +1,30 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.ajax4jsf.builder.generator;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public enum ResourceType {
+ SCRIPT, STYLE
+}
+
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -23,38 +23,22 @@
import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.Writer;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
-import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import net.sf.cglib.proxy.MethodInterceptor;
-import net.sf.cglib.proxy.MethodProxy;
-
import org.ajax4jsf.builder.config.BuilderConfig;
-import org.ajax4jsf.builder.config.ComponentBean;
-import org.ajax4jsf.builder.config.RendererBean;
-import org.ajax4jsf.templatecompiler.builder.CompilationContext;
-import org.ajax4jsf.templatecompiler.builder.CompilationException;
-import org.ajax4jsf.templatecompiler.builder.TemplateCompiler;
-import org.ajax4jsf.templatecompiler.elements.RootElement;
-import org.ajax4jsf.templatecompiler.elements.TemplateElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.FResourceTemplateElement;
-import org.ajax4jsf.templatecompiler.elements.vcp.HeaderResourceElement;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.xml.sax.Attributes;
@@ -63,271 +47,68 @@
import org.xml.sax.helpers.DefaultHandler;
/**
- * @author Nick - mailto:nbelaevski@exadel.com
- * created 17.04.2007
+ * @author Nick - mailto:nbelaevski@exadel.com created 17.04.2007
*
*/
public class ResourcesConfigGenerator extends FacesConfigGenerator {
private File resourcesConfig;
private File templatesDirectory;
-
- private static final SAXParserFactory parserFactory = SAXParserFactory.newInstance();
+ private ResourcesConfigGeneratorBean resourcesConfigGeneratorBean;
+ private static final SAXParserFactory parserFactory = SAXParserFactory
+ .newInstance();
+
public ResourcesConfigGenerator(JSFGeneratorConfiguration task, Logger log) {
super(task, log);
}
- private void addResources(ResourcesConfigGeneratorBean configBean, TemplateElement templateElement,
- String packageName, RendererBean renderer, BuilderConfig builderConfig) throws ClassNotFoundException {
- if (templateElement instanceof FResourceTemplateElement) {
- FResourceTemplateElement resourceTemplateElement = (FResourceTemplateElement) templateElement;
- String name = resourceTemplateElement.getName();
-
- addResource(name, packageName, configBean);
- } else if (templateElement instanceof RootElement) {
- RootElement rootElement = (RootElement) templateElement;
-
- CompilationContext compilationContext = rootElement.getComponentBean();
-
- addResource(configBean, renderer, builderConfig,
- compilationContext);
- } else if (templateElement instanceof HeaderResourceElement) {
- HeaderResourceElement resourceElement = (HeaderResourceElement) templateElement;
- String[] paths = resourceElement.getResourcePaths();
- if (paths != null) {
- for (int i = 0; i < paths.length; i++) {
- String string = paths[i];
-
- addResource(string, packageName, configBean);
- }
- }
- }
-
- ArrayList<TemplateElement> subElements = templateElement.getSubElements();
- for (TemplateElement element : subElements) {
- addResources(configBean, element, packageName, renderer, builderConfig);
- }
- }
+ private void parseXCSSResource(String resourcePath,
+ final ResourcesConfigGeneratorBean bean) throws SAXException,
+ IOException, ParserConfigurationException {
+ InputStream resourceStream = getClassLoader().getResourceAsStream(
+ resourcePath);
+ if (resourceStream != null) {
+ debug("XCSS file exists in classpath");
- private String addResource(ResourcesConfigGeneratorBean configBean,
- RendererBean renderer, BuilderConfig builderConfig,
- CompilationContext compilationContext)
- throws ClassNotFoundException {
- String packageName;
- String classname = renderer.getClassname();
- int idx = classname.lastIndexOf('.');
- if (idx != -1) {
- packageName = classname.substring(0, idx);
- } else {
- packageName = "";
- }
-
- ClassLoader loader = builderConfig.getLoader();
- Class cl = null;
-
- try {
- cl = loader.loadClass(classname);
- } catch (ClassNotFoundException e) {
- String superclass = compilationContext.getBaseclassPackageName() + "." + compilationContext.getBaseclassName();
- if (superclass != null) {
- cl = loader.loadClass(superclass);
- }
- }
-
- if (cl != null) {
try {
- GetResourceInterceptor interceptor = new GetResourceInterceptor();
+ SAXParser parser = parserFactory.newSAXParser();
+ parser.parse(resourceStream, new DefaultHandler() {
+ @Override
+ public void startElement(String uri, String localName,
+ String name, Attributes attributes)
+ throws SAXException {
- Object instance = AbstractClassStubBuilder.buildStub(cl, interceptor,
- builderConfig.getLoader());
-
- Method method = null;
- Object object = null;
-
- Class<?> cl1 = instance.getClass();
- while (cl1 != null && method == null) {
- try {
- method = cl1.getDeclaredMethod("getStyles", null);
- } catch (NoSuchMethodException e) {
- cl1 = cl1.getSuperclass();
- }
- }
-
- if (method != null) {
- method.setAccessible(true);
- object = method.invoke(instance, null);
- List<String> list = interceptor.getList();
- if (list != null) {
- for (String name : list) {
- addResource(name, packageName, configBean);
- }
- }
- }
-
- interceptor.clearList();
+ super.startElement(uri, localName, name, attributes);
- method = null;
- cl1 = instance.getClass();
- while (cl1 != null && method == null) {
- try {
- method = cl1.getDeclaredMethod("getScripts", null);
- } catch (NoSuchMethodException e) {
- cl1 = cl1.getSuperclass();
- }
- }
-
- if (method != null) {
- method.setAccessible(true);
- object = method.invoke(instance, null);
- List<String> list = interceptor.getList();
- if (list != null) {
- for (String name : list) {
- addResource(name, packageName, configBean);
- }
- }
- }
- } catch (SecurityException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- } catch (IllegalArgumentException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- } catch (IllegalAccessException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- } catch (InvocationTargetException e) {
- builderConfig.getLog().error(e.getMessage(), e);
- }
- }
- return packageName;
- }
+ if ("f:resource".equals(name)) {
+ String value = attributes.getValue("f:key");
- private void addResource(String name, String packageName,
- ResourcesConfigGeneratorBean configBean) {
+ if (value != null) {
+ debug("Adding resource: " + value);
- String resolvedPath = resolveResourcePath(name, packageName);
- // remove leading / from resource name.
- if(name.startsWith("/")){
- name = name.substring(1);
- }
- if (resolvedPath != null) {
- configBean.addPathResource(name, resolvedPath);
- } else {
- //couldn't resolve, treat as class name
- configBean.addClassResource(name, name);
- }
- }
-
- private String resolveResourcePath(String name, String packageName) {
- if (name.contains("/")) {
- String resolvedName;
-
- if (!name.startsWith("/")) {
- //need to resolve
- StringBuffer normalizedName = new StringBuffer();
- normalizedName.append(packageName.replace('.', '/'));
-
- if (!packageName.endsWith("/")) {
- normalizedName.append('/');
- }
-
- normalizedName.append(name);
-
- resolvedName = normalizedName.toString();
- } else {
- if (name.length() > 0) {
- resolvedName = name.substring(1);
- } else {
- resolvedName = null;
- }
- }
-
- return resolvedName;
- }
-
- return null;
- }
-
- private void addResources(ResourcesConfigGeneratorBean configBean, RendererBean renderer, BuilderConfig builderConfig) throws CompilationException, IOException, ClassNotFoundException {
- if (null != renderer) {
- CompilationContext compilationContext = new RendererCompilationContext(
- getLog(), getClassLoader(),getConfig());
-
- if (renderer.isGenerate()) {
- String templateString = renderer.getTemplate();
- if (templateString != null) {
- File template;
- if (null != getTemplates()) {
- template = new File(getTemplates(), templateString);
- } else {
- template = new File(templateString);
+ bean.addResource(value, "", null, true);
+ }
+ }
}
+ });
- TemplateCompiler templateCompiler = new TemplateCompiler();
- InputStream templateStream = new FileInputStream(template);
- templateCompiler.processing(templateStream, compilationContext);
-
- TemplateElement root = compilationContext.getTree();
-
- String classname = renderer.getClassname();
- String packageName;
- int idx = classname.lastIndexOf('.');
- if (idx != -1) {
- packageName = classname.substring(0, idx);
- } else {
- packageName = "";
- }
-
- addResources(configBean, root, packageName, renderer, builderConfig);
+ } finally {
+ try {
+ resourceStream.close();
+ } catch (IOException e) {
+ getLog().error(e.getLocalizedMessage(), e);
}
- } else {
- addResource(configBean, renderer, builderConfig, compilationContext);
}
+ } else {
+ getLog().error("Resource " + resourcePath + " hasn't been found!");
}
}
- private void parseXCSSResource(String resourcePath, final ResourcesConfigGeneratorBean bean) throws SAXException, IOException, ParserConfigurationException {
- InputStream resourceStream = getClassLoader().getResourceAsStream(resourcePath);
- if (resourceStream != null) {
- debug("XCSS file exists in classpath");
-
- try {
- SAXParser parser = parserFactory.newSAXParser();
- parser.parse(resourceStream, new DefaultHandler() {
- @Override
- public void startElement(String uri,
- String localName, String name,
- Attributes attributes)
- throws SAXException {
-
- super.startElement(uri, localName, name, attributes);
-
- if ("f:resource".equals(name)) {
- String value = attributes.getValue("f:key");
-
- if (value != null) {
- debug("Adding resource: " + value);
-
- addResource(value, "", bean);
- }
- }
- }
- });
-
- } finally {
- try {
- resourceStream.close();
- } catch (IOException e) {
- getLog().error(e.getLocalizedMessage(), e);
- }
- }
- } else {
- getLog().error("Resource " + resourcePath + " hasn't been found!");
- }
- }
-
private boolean isXCSSPath(String resourcePath) {
- return resourcePath != null && resourcePath.endsWith(".xcss");
+ return resourcePath != null && resourcePath.endsWith(".xcss");
}
-
+
public void createFiles(BuilderConfig config) throws GeneratorException {
VelocityContext context = new VelocityContext();
Template template = getTemplate();
@@ -335,86 +116,107 @@
// Put common properties
final ResourcesConfigGeneratorBean bean = new ResourcesConfigGeneratorBean();
-
- List<ComponentBean> components = config.getComponents();
- for (ComponentBean componentBean : components) {
- RendererBean rendererBean = componentBean.getRenderer();
-
- addResources(bean, rendererBean, config);
+ if (this.resourcesConfigGeneratorBean != null) {
+ bean.merge(resourcesConfigGeneratorBean);
}
-
- List<RendererBean> renderers = config.getRenderers();
- for (RendererBean rendererBean : renderers) {
- addResources(bean, rendererBean, config);
- }
-
+
String includedContent = getIncludeContent();
if (includedContent != null && includedContent.length() != 0) {
- String parseableContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-config>" + includedContent +
- "</resource-config>";
+ String parseableContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><resource-config>"
+ + includedContent + "</resource-config>";
SAXParser parser = parserFactory.newSAXParser();
- parser.parse(new InputSource(new StringReader(parseableContent)), new DefaultHandler() {
- private StringBuilder path;
-
- @Override
- public void startElement(String uri,
- String localName, String name,
- Attributes attributes)
- throws SAXException {
+ parser.parse(
+ new InputSource(new StringReader(parseableContent)),
+ new DefaultHandler() {
+ private StringBuilder path;
- super.startElement(uri, localName, name, attributes);
-
- if ("path".equals(name)) {
- this.path = new StringBuilder();
- }
- }
-
- public void characters(char[] ch, int start, int length) throws SAXException {
- if (this.path != null) {
- this.path.append(ch, start, length);
- }
- };
-
- @Override
- public void endElement(String uri, String localName, String name) throws SAXException {
- super.endElement(uri, localName, name);
+ @Override
+ public void startElement(String uri,
+ String localName, String name,
+ Attributes attributes) throws SAXException {
- if ("resource".equals(name)) {
- if (this.path != null && this.path.length() != 0) {
- String resourcePath = this.path.toString().trim();
- if (isXCSSPath(resourcePath)) {
- debug("XCSS file detected: " + resourcePath);
- try {
- parseXCSSResource(resourcePath, bean);
- } catch (IOException e) {
- throw new SAXException(e.getLocalizedMessage(), e);
- } catch (ParserConfigurationException e) {
- throw new SAXException(e.getLocalizedMessage(), e);
+ super.startElement(uri, localName, name,
+ attributes);
+
+ if ("path".equals(name)) {
+ this.path = new StringBuilder();
+ }
}
- }
- }
- this.path = null;
- }
- }
- });
+
+ public void characters(char[] ch, int start,
+ int length) throws SAXException {
+ if (this.path != null) {
+ this.path.append(ch, start, length);
+ }
+ };
+
+ @Override
+ public void endElement(String uri,
+ String localName, String name)
+ throws SAXException {
+ super.endElement(uri, localName, name);
+
+ if ("resource".equals(name)) {
+ if (this.path != null
+ && this.path.length() != 0) {
+ String resourcePath = this.path
+ .toString().trim();
+ if (isXCSSPath(resourcePath)) {
+ debug("XCSS file detected: "
+ + resourcePath);
+ try {
+ parseXCSSResource(resourcePath,
+ bean);
+ } catch (IOException e) {
+ throw new SAXException(e
+ .getLocalizedMessage(),
+ e);
+ } catch (ParserConfigurationException e) {
+ throw new SAXException(e
+ .getLocalizedMessage(),
+ e);
+ }
+ }
+ }
+ this.path = null;
+ }
+ }
+ });
}
+
+ Set<String> pathResourcesSet = new LinkedHashSet<String>();
+ for (ResourcesConfigGeneratorBeanEntry entry : bean.getDependencies()) {
+ if (entry.isPathResource()) {
+ pathResourcesSet.add(entry.getPath());
+ }
+ }
- Set<String> pathResourcesSet = new LinkedHashSet<String>(bean.getPathResources().values());
for (Iterator<String> iterator = pathResourcesSet.iterator(); iterator
.hasNext();) {
String resourcePath = iterator.next();
-
+
if (isXCSSPath(resourcePath)) {
- debug("XCSS file detected: " + resourcePath);
- parseXCSSResource(resourcePath, bean);
+ debug("XCSS file detected: " + resourcePath);
+ parseXCSSResource(resourcePath, bean);
}
}
+
+ Map<String, String> classResources = new HashMap<String, String>();
+ Map<String, String> pathResources = new HashMap<String, String>();
- context.put("classResources", bean.getClassResources());
- context.put("pathResources", bean.getPathResources());
- context.put("resourcesConfig", this);
+ for (ResourcesConfigGeneratorBeanEntry entry : bean.getDependencies()) {
+ if (entry.isPathResource()) {
+ pathResources.put(entry.getName(), entry.getPath());
+ } else {
+ classResources.put(entry.getName(), entry.getPath());
+ }
+ }
+ context.put("classResources", classResources);
+ context.put("pathResources", pathResources);
+ context.put("resourcesConfig", this);
+
File configFile = getResourcesConfig();
File javaDir = configFile.getParentFile();
if (!javaDir.exists()) {
@@ -428,8 +230,8 @@
out.flush();
out.close();
} catch (Exception e) {
- throw new GeneratorException("Error create new resources-config.xml ",
- e);
+ throw new GeneratorException(
+ "Error create new resources-config.xml ", e);
}
}
@@ -456,36 +258,13 @@
public File getTemplates() {
return this.templatesDirectory;
}
-}
-
-class GetResourceInterceptor implements MethodInterceptor {
-
- private static final Class<?>[] SIGNATURE = new Class<?>[] {
- String.class
- };
- private List<String> list = new ArrayList<String>();
-
- public List<String> getList() {
- return list;
+ public void setResourcesConfigGeneratorBean(
+ ResourcesConfigGeneratorBean resourcesConfigGeneratorBean) {
+ this.resourcesConfigGeneratorBean = resourcesConfigGeneratorBean;
}
- public void clearList() {
- list.clear();
+ public ResourcesConfigGeneratorBean getResourcesConfigGeneratorBean() {
+ return resourcesConfigGeneratorBean;
}
-
- public Object intercept(Object instance, Method method, Object[] args,
- MethodProxy methodProxy) throws Throwable {
-
- if ("getResource".equals(method.getName()) &&
- Arrays.equals(SIGNATURE, method.getParameterTypes())) {
-
- list.add((String) args[0]);
-
- return null;
- } else {
- return methodProxy.invokeSuper(instance, args);
- }
- }
-
}
\ No newline at end of file
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBean.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBean.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -21,33 +21,73 @@
package org.ajax4jsf.builder.generator;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
-
-
/**
* @author Nick - mailto:nbelaevski@exadel.com
* created 17.04.2007
*
*/
public class ResourcesConfigGeneratorBean {
- private HashMap<String, String> classResources = new HashMap<String, String>();
- private HashMap<String, String> pathResources = new HashMap<String, String>();
- public void addClassResource(String name, String className) {
- classResources.put(name, className);
- }
+ private List<ResourcesConfigGeneratorBeanEntry> dependencies = new ArrayList<ResourcesConfigGeneratorBeanEntry>();
+
+ private String resolveResourcePath(String name, String packageName) {
+ if (name.contains("/")) {
+ String resolvedName;
- public void addPathResource(String name, String path) {
- pathResources.put(name, path);
+ if (!name.startsWith("/")) {
+ // need to resolve
+ StringBuffer normalizedName = new StringBuffer();
+ normalizedName.append(packageName.replace('.', '/'));
+
+ if (!packageName.endsWith("/")) {
+ normalizedName.append('/');
+ }
+
+ normalizedName.append(name);
+
+ resolvedName = normalizedName.toString();
+ } else {
+ if (name.length() > 0) {
+ resolvedName = name.substring(1);
+ } else {
+ resolvedName = null;
+ }
+ }
+
+ return resolvedName;
+ }
+
+ return null;
}
- public Map<String, String> getClassResources() {
- return classResources;
+ public void addResource(String name, String path, ResourceType type, boolean isDerived) {
+ boolean isPathResource = true;
+ String resolvedPath = resolveResourcePath(name, path);
+
+ // remove leading / from resource name.
+ if (name.startsWith("/")) {
+ name = name.substring(1);
+ }
+
+ if (resolvedPath == null) {
+ // couldn't resolve, treat as class name
+ resolvedPath = name;
+ isPathResource = false;
+ }
+
+ this.dependencies.add(
+ new ResourcesConfigGeneratorBeanEntry(
+ name, resolvedPath, isPathResource, type, isDerived));
}
- public Map<String, String> getPathResources() {
- return pathResources;
+ public List<ResourcesConfigGeneratorBeanEntry> getDependencies() {
+ return dependencies;
}
+
+ public void merge(ResourcesConfigGeneratorBean bean) {
+ this.dependencies.addAll(bean.dependencies);
+ }
}
\ No newline at end of file
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBeanEntry.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBeanEntry.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGeneratorBeanEntry.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -0,0 +1,66 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.builder.generator;
+
+public final class ResourcesConfigGeneratorBeanEntry {
+
+ public ResourcesConfigGeneratorBeanEntry(String name, String path, boolean pathResource,
+ ResourceType type, boolean derived) {
+ super();
+ this.name = name;
+ this.path = path;
+ this.pathResource = pathResource;
+ this.type = type;
+ this.derived = derived;
+ }
+
+ private String name;
+
+ private String path;
+
+ private boolean pathResource;
+
+ private ResourceType type;
+
+ private boolean derived;
+
+ public boolean isPathResource() {
+ return pathResource;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public ResourceType getType() {
+ return type;
+ }
+
+ public boolean isDerived() {
+ return derived;
+ }
+}
\ No newline at end of file
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigParser.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -0,0 +1,403 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.builder.generator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import net.sf.cglib.proxy.MethodInterceptor;
+import net.sf.cglib.proxy.MethodProxy;
+
+import org.ajax4jsf.builder.config.BuilderConfig;
+import org.ajax4jsf.builder.config.ComponentBean;
+import org.ajax4jsf.builder.config.RendererBean;
+import org.ajax4jsf.builder.config.TagBean;
+import org.ajax4jsf.builder.config.TagHandlerBean;
+import org.ajax4jsf.templatecompiler.builder.CompilationContext;
+import org.ajax4jsf.templatecompiler.builder.CompilationException;
+import org.ajax4jsf.templatecompiler.builder.TemplateCompiler;
+import org.ajax4jsf.templatecompiler.elements.RootElement;
+import org.ajax4jsf.templatecompiler.elements.TemplateElement;
+import org.ajax4jsf.templatecompiler.elements.vcp.FResourceTemplateElement;
+import org.ajax4jsf.templatecompiler.elements.vcp.HeaderResourceElement;
+import org.ajax4jsf.templatecompiler.elements.vcp.HeaderScriptsElement;
+import org.ajax4jsf.templatecompiler.elements.vcp.HeaderStylesElement;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ResourcesConfigParser {
+
+ private JSFGeneratorConfiguration config;
+
+ private Logger log;
+
+ private File templates;
+
+ private ResourcesConfigGeneratorBean resourcesConfigGeneratorBean;
+
+ private Map<String, ResourcesConfigGeneratorBean> componentResourcesMap;
+
+ public ResourcesConfigParser(JSFGeneratorConfiguration config, Logger log) {
+ super();
+
+ this.config = config;
+ this.log = log;
+ this.resourcesConfigGeneratorBean = new ResourcesConfigGeneratorBean();
+ this.componentResourcesMap = new HashMap<String, ResourcesConfigGeneratorBean>();
+ }
+
+ public File getTemplates() {
+ return templates;
+ }
+
+ public void setTemplates(File templates) {
+ this.templates = templates;
+ }
+
+ private void addResources(ResourcesConfigGeneratorBean configBean,
+ TemplateElement templateElement, String packageName,
+ RendererBean renderer, BuilderConfig builderConfig)
+ throws ClassNotFoundException {
+ if (templateElement instanceof FResourceTemplateElement) {
+ FResourceTemplateElement resourceTemplateElement = (FResourceTemplateElement) templateElement;
+ String name = resourceTemplateElement.getName();
+
+ configBean.addResource(name, packageName, null, true);
+ } else if (templateElement instanceof RootElement) {
+ RootElement rootElement = (RootElement) templateElement;
+
+ CompilationContext compilationContext = rootElement
+ .getComponentBean();
+
+ addResource(configBean, renderer, builderConfig, compilationContext);
+ } else if (templateElement instanceof HeaderResourceElement) {
+ HeaderResourceElement resourceElement = (HeaderResourceElement) templateElement;
+
+ ResourceType type = null;
+ if (templateElement instanceof HeaderScriptsElement) {
+ type = ResourceType.SCRIPT;
+ } else if (templateElement instanceof HeaderStylesElement) {
+ type = ResourceType.STYLE;
+ }
+
+ String[] paths = resourceElement.getResourcePaths();
+ if (paths != null) {
+ for (int i = 0; i < paths.length; i++) {
+ String string = paths[i];
+
+ configBean.addResource(string, packageName, type, false);
+ }
+ }
+ }
+
+ ArrayList<TemplateElement> subElements = templateElement
+ .getSubElements();
+ for (TemplateElement element : subElements) {
+ addResources(configBean, element, packageName, renderer,
+ builderConfig);
+ }
+ }
+
+ private String addResource(ResourcesConfigGeneratorBean configBean,
+ RendererBean renderer, BuilderConfig builderConfig,
+ CompilationContext compilationContext)
+ throws ClassNotFoundException {
+ String packageName;
+ String classname = renderer.getClassname();
+ int idx = classname.lastIndexOf('.');
+ if (idx != -1) {
+ packageName = classname.substring(0, idx);
+ } else {
+ packageName = "";
+ }
+
+ ClassLoader loader = builderConfig.getLoader();
+ Class<?> cl = null;
+
+ try {
+ cl = loader.loadClass(classname);
+ } catch (ClassNotFoundException e) {
+ String superclass = compilationContext.getBaseclassPackageName()
+ + "." + compilationContext.getBaseclassName();
+ if (superclass != null) {
+ cl = loader.loadClass(superclass);
+ }
+ }
+
+ if (cl != null) {
+ try {
+ GetResourceInterceptor interceptor = new GetResourceInterceptor(builderConfig.getLoader());
+
+ Object instance = AbstractClassStubBuilder.buildStub(cl,
+ interceptor, builderConfig.getLoader());
+
+ //clear list - some resources could be requested during class/instance initialization
+ Object[] result = null;
+ Method method = null;
+ Set<String> locatedResources = new HashSet<String>();
+
+ Class<?> cl1 = instance.getClass();
+ while (cl1 != null && method == null) {
+ try {
+ method = cl1.getDeclaredMethod("getStyles");
+ } catch (NoSuchMethodException e) {
+ cl1 = cl1.getSuperclass();
+ }
+ }
+
+ if (method != null) {
+ method.setAccessible(true);
+ result = (Object[]) method.invoke(instance);
+ if (result instanceof Object[]) {
+ for (Object object : result) {
+ String resourceName = interceptor.getResourceName(object);
+ if (resourceName != null) {
+ locatedResources.add(resourceName);
+ configBean.addResource(resourceName, packageName, ResourceType.STYLE,
+ false);
+ }
+ }
+ }
+ }
+
+ method = null;
+ cl1 = instance.getClass();
+ while (cl1 != null && method == null) {
+ try {
+ method = cl1.getDeclaredMethod("getScripts");
+ } catch (NoSuchMethodException e) {
+ cl1 = cl1.getSuperclass();
+ }
+ }
+
+ if (method != null) {
+ method.setAccessible(true);
+ result = (Object[]) method.invoke(instance);
+ if (result instanceof Object[]) {
+ for (Object object : result) {
+ String resourceName = interceptor.getResourceName(object);
+ if (resourceName != null) {
+ locatedResources.add(resourceName);
+ configBean.addResource(resourceName, packageName, ResourceType.SCRIPT,
+ false);
+ }
+ }
+ }
+
+ List<String> list = interceptor.getList();
+ if (list != null) {
+ list.removeAll(locatedResources);
+ for (String resourceName : list) {
+ log.warn("Error detecting resource type: " + resourceName);
+ configBean.addResource(resourceName, packageName, null,
+ false);
+ }
+ }
+ }
+ } catch (SecurityException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ } catch (IllegalArgumentException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ } catch (IllegalAccessException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ } catch (InvocationTargetException e) {
+ builderConfig.getLog().error(e.getMessage(), e);
+ }
+ }
+ return packageName;
+ }
+
+ private void addResources(ResourcesConfigGeneratorBean configBean,
+ RendererBean renderer, BuilderConfig builderConfig)
+ throws CompilationException, IOException, ClassNotFoundException {
+ if (null != renderer) {
+ CompilationContext compilationContext = new RendererCompilationContext(
+ log, config.getClassLoader(), config);
+
+ if (renderer.isGenerate()) {
+ String templateString = renderer.getTemplate();
+ if (templateString != null) {
+ File template;
+ if (null != getTemplates()) {
+ template = new File(getTemplates(), templateString);
+ } else {
+ template = new File(templateString);
+ }
+
+ TemplateCompiler templateCompiler = new TemplateCompiler();
+ InputStream templateStream = new FileInputStream(template);
+ templateCompiler.processing(templateStream,
+ compilationContext);
+
+ TemplateElement root = compilationContext.getTree();
+
+ String classname = renderer.getClassname();
+ String packageName;
+ int idx = classname.lastIndexOf('.');
+ if (idx != -1) {
+ packageName = classname.substring(0, idx);
+ } else {
+ packageName = "";
+ }
+
+ addResources(configBean, root, packageName, renderer,
+ builderConfig);
+ }
+ } else {
+ addResource(configBean, renderer, builderConfig,
+ compilationContext);
+ }
+ }
+ }
+
+ public void parse(BuilderConfig config) throws CompilationException, IOException, ClassNotFoundException {
+ List<ComponentBean> components = config.getComponents();
+ for (ComponentBean componentBean : components) {
+ ResourcesConfigGeneratorBean localBeanInstance = new ResourcesConfigGeneratorBean();
+ RendererBean rendererBean = componentBean.getRenderer();
+
+ addResources(localBeanInstance, rendererBean, config);
+
+ String componentName = null;
+
+ TagBean tag = componentBean.getTag();
+ if (tag != null) {
+ componentName = tag.getName();
+ }
+
+ if (componentName == null) {
+ TagHandlerBean taghandler = componentBean.getTaghandler();
+ if (taghandler != null) {
+ componentName = taghandler.getName();
+ }
+ }
+
+ if (componentName != null) {
+ this.componentResourcesMap.put(componentName, localBeanInstance);
+ }
+
+ this.resourcesConfigGeneratorBean.merge(localBeanInstance);
+ }
+
+ List<RendererBean> renderers = config.getRenderers();
+ for (RendererBean rendererBean : renderers) {
+ addResources(this.resourcesConfigGeneratorBean, rendererBean, config);
+ }
+ }
+
+ public ResourcesConfigGeneratorBean getResourcesConfigGeneratorBean() {
+ return resourcesConfigGeneratorBean;
+ }
+
+ public Map<String, ResourcesConfigGeneratorBean> getComponentResourcesMap() {
+ return componentResourcesMap;
+ }
+}
+
+interface NamedObject {
+ public String getPath();
+}
+
+class NamedObjectImpl implements NamedObject {
+
+ private String path;
+
+ public NamedObjectImpl(String path) {
+ super();
+ this.path = path;
+ }
+
+ public String getPath() {
+ return path;
+ }
+}
+
+class GetResourceInterceptor implements MethodInterceptor {
+
+ private static final Class<?>[] SIGNATURE = new Class<?>[] { String.class };
+
+ private ClassLoader classLoader;
+
+ private List<String> list = new ArrayList<String>();
+
+ private Map<String, Object> resources = new HashMap<String, Object>();
+
+ private Map<Object, String> resourcesInverse = new IdentityHashMap<Object, String>();
+
+ public GetResourceInterceptor(ClassLoader loader) {
+ this.classLoader = loader;
+ }
+
+ public List<String> getList() {
+ return list;
+ }
+
+ public String getResourceName(Object resource) {
+ return resourcesInverse.get(resource);
+ }
+
+ public void clearList() {
+ list.clear();
+ }
+
+ public Object intercept(Object instance, Method method, Object[] args,
+ MethodProxy methodProxy) throws Throwable {
+
+ if ("getResource".equals(method.getName())
+ && Arrays.equals(SIGNATURE, method.getParameterTypes())) {
+
+ String resourceName = (String) args[0];
+ list.add(resourceName);
+
+ Object resource = resources.get(resourceName);
+ if (resource == null) {
+ Class<?> returnType = method.getReturnType();
+ if (returnType.isInterface()) {
+ Object interfaceStub = AbstractClassStubBuilder.buildInterfaceStub(returnType, classLoader);
+ resources.put(resourceName, interfaceStub);
+ resourcesInverse.put(interfaceStub, resourceName);
+
+ return interfaceStub;
+ }
+ }
+
+ return null;
+ } else {
+ return methodProxy.invokeSuper(instance, args);
+ }
+ }
+
+}
\ No newline at end of file
Added: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesDependenciesGenerator.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesDependenciesGenerator.java (rev 0)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesDependenciesGenerator.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -0,0 +1,143 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+package org.ajax4jsf.builder.generator;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.Writer;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.ajax4jsf.builder.config.BuilderConfig;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+
+/**
+ * @author Nick Belaevski
+ * @since 3.3.0
+ */
+public class ResourcesDependenciesGenerator extends InnerGenerator {
+
+ private Map<String, ResourcesConfigGeneratorBean> componentDependencies;
+ private String uri;
+ private File dependencyFile;
+
+ public ResourcesDependenciesGenerator(JSFGeneratorConfiguration config,
+ Logger log) {
+ super(config, log);
+ }
+
+ @Override
+ public void createFiles(BuilderConfig config) throws GeneratorException {
+ try {
+ VelocityContext context = new VelocityContext();
+ Template template = getTemplate();
+
+ Map<String, Map<String, Collection<String>>> componentsMap = new HashMap<String, Map<String, Collection<String>>>();
+ for (Entry<String, ResourcesConfigGeneratorBean> entry : componentDependencies.entrySet()) {
+ Map<String, Collection<String>> resourcesMap = new HashMap<String, Collection<String>>();
+ componentsMap.put(entry.getKey(), resourcesMap);
+
+ Collection<String> scripts = new LinkedHashSet<String>();
+ Collection<String> styles = new LinkedHashSet<String>();
+
+ ResourcesConfigGeneratorBean resourcesConfigBean = entry.getValue();
+ List<ResourcesConfigGeneratorBeanEntry> dependencies = resourcesConfigBean.getDependencies();
+ for (ResourcesConfigGeneratorBeanEntry beanEntry : dependencies) {
+ if (beanEntry.isDerived()) {
+ continue;
+ }
+
+ ResourceType type = beanEntry.getType();
+ if (type != null) {
+ switch (type) {
+ case SCRIPT:
+ scripts.add(beanEntry.getPath());
+ break;
+
+ case STYLE:
+ styles.add(beanEntry.getPath());
+ break;
+ }
+ }
+ }
+
+ resourcesMap.put("scripts", scripts);
+ resourcesMap.put("styles", styles);
+ }
+
+ context.put("uri", uri);
+ context.put("components", componentsMap);
+
+ File configFile = getDependencyFile();
+ File javaDir = configFile.getParentFile();
+ if (!javaDir.exists()) {
+ javaDir.mkdirs();
+ }
+ if (configFile.exists()) {
+ configFile.delete();
+ }
+ Writer out = new BufferedWriter(new FileWriter(configFile));
+ template.merge(context, out);
+ out.flush();
+ out.close();
+ } catch (Exception e) {
+ throw new GeneratorException(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ protected String getDefaultTemplateName() {
+ return "resources-dependencies.vm";
+ }
+
+ public Map<String, ResourcesConfigGeneratorBean> getComponentDependencies() {
+ return componentDependencies;
+ }
+
+ public void setComponentDependencies(
+ Map<String, ResourcesConfigGeneratorBean> componentDependencies) {
+ this.componentDependencies = componentDependencies;
+ }
+
+ public void setDependencyFile(File dependencyFile) {
+ this.dependencyFile = dependencyFile;
+ }
+
+ public File getDependencyFile() {
+ return dependencyFile;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+}
Added: trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-dependencies.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-dependencies.vm (rev 0)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-dependencies.vm 2009-01-12 17:55:34 UTC (rev 12231)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components>
+ <namespace>$uri</namespace>
+
+#foreach( $key in ${components.keySet()})
+ <component>
+ <name>$key</name>
+
+ #set($componentEntry = ${components.get($key)})
+ #set($scripts = ${componentEntry.get("scripts")})
+ #set($styles = ${componentEntry.get("styles")})
+
+ #if(!${scripts.isEmpty()})
+ <scripts>
+ #foreach($script in $scripts)
+ <script>$script</script>
+ #end
+ </scripts>
+ #end
+
+ #if(!${styles.isEmpty()})
+ <styles>
+ #foreach($style in $styles)
+ <style>$style</style>
+ #end
+ </styles>
+ #end
+ </component>
+#end
+
+</components>
Property changes on: trunk/cdk/maven-cdk-plugin
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
.settings
target
+ .classpath
.project
.settings
target
bin
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -43,7 +43,6 @@
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
-import org.codehaus.plexus.velocity.DefaultVelocityComponent;
import org.codehaus.plexus.velocity.VelocityComponent;
/**
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AssemblyLibraryMojo.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -72,8 +72,8 @@
* criteria. for accepted modules, unpack it to classes directory, and put
* config files in separate directories. 4. Append unpacked directory to
* resources, included in result jar. 5. Merge all META-INF/faces-config.xml ,
- * *.tld, *.taglib.xml , resources-config.xml into ones. 6. append dependencies
- * of included projects to this.
+ * *.tld, *.taglib.xml, *.component-dependencies.xml , resources-config.xml into ones.
+ * 6. append dependencies of included projects to this.
*
* @author shura
* @goal assembly
@@ -90,6 +90,8 @@
private static final String RESOURCES_CONFIG_TEMPLATE = "resources-config.vm";
+ private static final String COMPONENT_DEPENDENCIES_TEMPLATE = "component-dependencies.vm";
+
private static final String XCSS_TEMPLATE = "xcss.vm";
private static final String TLD_TEMPLATE = "tld.vm";
@@ -106,12 +108,19 @@
"library-class", "namespace", "tag", "function"
};
+ private static final String[] DEPENDENCIES_TAG_NAMES = new String[] {
+ "component"
+ };
+
private static final Comparator<Node> TLD_COMPARATOR = new NamesListComparator(
new XPathComparator("listener-class/text()", "name/text()"), TLD_TAG_NAMES);
private static final Comparator<Node> FACELET_COMPARATOR = new NamesListComparator(
new XPathComparator("function-name/text()", "tag-name/text()"), TAGLIB_TAG_NAMES);
+ private static final Comparator<Node> DEPENDENCIES_COMPARATOR = new NamesListComparator(
+ new XPathComparator("name/text()"), DEPENDENCIES_TAG_NAMES);
+
/**
* Used to look up Artifacts in the remote repository.
*
@@ -221,6 +230,11 @@
/**
* @parameter
*/
+ private String includeDependencies = "META-INF/*.component-dependencies.xml";
+
+ /**
+ * @parameter
+ */
private String includeXcss = "**/*.xcss";
/**
@@ -264,6 +278,7 @@
mergeXML(models, "META-INF/resources-config.xml", null,
RESOURCES_CONFIG_TEMPLATE, "/resource-config/resource",
"name/text()", new VelocityContext(), resourcesConfig, false, null);
+
if (null != commonStyle) {
File commonXcss = new File(outputDirectory, commonStyle);
mergeXML(models, includeXcss, excludeXcss, XCSS_TEMPLATE,
@@ -301,10 +316,10 @@
}
}
}
- generateTaglib(taglibModels, taglib);
+ generateTaglibAndDependencies(taglibModels, taglib);
}
} else {
- generateTaglib(models, library.getTaglib());
+ generateTaglibAndDependencies(models, library.getTaglib());
}
}
@@ -312,7 +327,7 @@
* @param models
* @throws MojoExecutionException
*/
- private void generateTaglib(List<Model> models, Taglib taglib)
+ private void generateTaglibAndDependencies(List<Model> models, Taglib taglib)
throws MojoExecutionException {
getLog().debug(
"Assembly taglib for uri " + taglib.getUri()
@@ -341,6 +356,14 @@
mergeXML(models, includeTaglib, null, TAGLIB_TEMPLATE, commonXPath, "tag-name/text() | function-name/text()", new VelocityContext(
taglibContext), faceletsTaglib, false, FACELET_COMPARATOR);
getLog().debug("Write Facelets taglib " + faceletsTaglib.getPath());
+
+ File dependenciesFile = new File(outputDirectory, "META-INF/"
+ + taglib.getTaglib() + ".component-dependencies.xml");
+ commonXPath = "/components/component" + createTagCondition(taglib, "name");
+
+ mergeXML(models, includeDependencies, null, COMPONENT_DEPENDENCIES_TEMPLATE, commonXPath, "name/text()", new VelocityContext(
+ taglibContext), dependenciesFile, false, DEPENDENCIES_COMPARATOR);
+ getLog().debug("Write dependencies file " + dependenciesFile.getPath());
}
/**
@@ -715,6 +738,7 @@
resource.addExclude("META-INF/faces-config.xml");
resource.addExclude("META-INF/resources-config.xml");
resource.addExclude("META-INF/*.taglib.xml");
+ resource.addExclude("META-INF/*.component-dependencies.xml");
resource.addExclude("META-INF/*.tld");
project.addResource(resource);
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CompileMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CompileMojo.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CompileMojo.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -26,13 +26,11 @@
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.model.Parent;
import org.apache.maven.plugin.MojoExecutionException;
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateComponentMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateComponentMojo.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateComponentMojo.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -26,7 +26,6 @@
import java.util.List;
import org.apache.maven.model.Plugin;
-import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.velocity.VelocityContext;
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -26,7 +26,6 @@
import org.ajax4jsf.builder.config.BuilderConfig;
import org.ajax4jsf.builder.config.ParsingException;
-import org.ajax4jsf.builder.generator.ComponentGenerator;
import org.ajax4jsf.builder.generator.ComponentGenerator2;
import org.ajax4jsf.builder.generator.ComponentTagGenerator;
import org.ajax4jsf.builder.generator.ConverterGenerator;
@@ -40,6 +39,8 @@
import org.ajax4jsf.builder.generator.RenderKitBean;
import org.ajax4jsf.builder.generator.RendererGenerator;
import org.ajax4jsf.builder.generator.ResourcesConfigGenerator;
+import org.ajax4jsf.builder.generator.ResourcesConfigParser;
+import org.ajax4jsf.builder.generator.ResourcesDependenciesGenerator;
import org.ajax4jsf.builder.generator.TagHandlerGenerator;
import org.ajax4jsf.builder.generator.TaglibGenerator;
import org.ajax4jsf.builder.generator.ValidatorGenerator;
@@ -211,9 +212,23 @@
faceletsTaglibGenerator.createFiles(config);
}
+ ResourcesConfigParser resourcesConfigParser = new ResourcesConfigParser(resourcesConfiguration, mavenLogger);
+ resourcesConfigParser.setTemplates(templatesDirectory);
+ resourcesConfigParser.parse(config);
+
+ if (taglib != null) {
+ ResourcesDependenciesGenerator resourcesDependenciesGenerator = new ResourcesDependenciesGenerator(resourcesConfiguration, mavenLogger);
+ resourcesDependenciesGenerator.setUri(taglib.getUri());
+ resourcesDependenciesGenerator.setDependencyFile(new File(outputResourcesDirectory,
+ "META-INF/" + taglib.getShortName() + ".component-dependencies.xml"));
+ resourcesDependenciesGenerator.setComponentDependencies(resourcesConfigParser.getComponentResourcesMap());
+ resourcesDependenciesGenerator.createFiles(config);
+ }
+
// Generate resources configuration file resources-config.xml
// for all images/scripts/css...
ResourcesConfigGenerator resourcesConfigGenerator = new ResourcesConfigGenerator(resourcesConfiguration, mavenLogger);
+ resourcesConfigGenerator.setResourcesConfigGeneratorBean(resourcesConfigParser.getResourcesConfigGeneratorBean());
resourcesConfigGenerator.setInclude(resourcesInclude);
resourcesConfigGenerator.setTemplates(templatesDirectory);
resourcesConfigGenerator.setResourcesConfig(new File(
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateTestMojo.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateTestMojo.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateTestMojo.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -27,8 +27,6 @@
import org.ajax4jsf.builder.maven.MavenLogger;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.velocity.Template;
/**
*
Modified: trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java 2009-01-12 17:49:53 UTC (rev 12230)
+++ trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/Taglib.java 2009-01-12 17:55:34 UTC (rev 12231)
@@ -21,7 +21,6 @@
package org.ajax4jsf.builder.mojo;
-import java.io.File;
/**
* @author shura
Added: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/component-dependencies.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/component-dependencies.vm (rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/component-dependencies.vm 2009-01-12 17:55:34 UTC (rev 12231)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components>
+ <namespace>${taglib.uri}</namespace>
+${content}
+</components>
16 years, 11 months