Author: maksimkaszynski
Date: 2008-05-10 10:45:29 -0400 (Sat, 10 May 2008)
New Revision: 8520
Added:
trunk/cdk/maven-cdk-plugin/src/main/mdo/
trunk/cdk/maven-cdk-plugin/src/main/mdo/resource-config.mdo
Modified:
trunk/cdk/maven-cdk-plugin/pom.xml
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/SkinInfo.java
trunk/cdk/maven-cdk-plugin/src/main/resources/skin/pom/pom.xml
trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.properties
trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.xcss
Log:
updated add-skin mojo
Modified: trunk/cdk/maven-cdk-plugin/pom.xml
===================================================================
--- trunk/cdk/maven-cdk-plugin/pom.xml 2008-05-09 16:28:46 UTC (rev 8519)
+++ trunk/cdk/maven-cdk-plugin/pom.xml 2008-05-10 14:45:29 UTC (rev 8520)
@@ -1,4 +1,5 @@
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>cdk</artifactId>
<groupId>org.richfaces</groupId>
@@ -58,4 +59,31 @@
<version>3.2.1-SNAPSHOT</version>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.modello</groupId>
+ <artifactId>modello-maven-plugin</artifactId>
+ <version>1.0-alpha-18</version>
+ <executions>
+ <execution>
+ <goals>
+ <!-- Generate the xpp3 reader code -->
+ <goal>xpp3-reader</goal>
+ <!-- Generate the xpp3 writer code -->
+ <goal>xpp3-writer</goal>
+ <!-- Generate the Java sources for the model itself -->
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <version>1.0.0</version>
+ <models>
+ <model>src/main/mdo/resource-config.mdo</model>
+ </models>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java 2008-05-09
16:28:46 UTC (rev 8519)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/CreateSkinMojo.java 2008-05-10
14:45:29 UTC (rev 8520)
@@ -1,6 +1,8 @@
package org.ajax4jsf.builder.mojo;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
@@ -8,6 +10,10 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
+import org.aja4jsf.builder.model.Resource;
+import org.aja4jsf.builder.model.ResourceConfig;
+import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Reader;
+import org.aja4jsf.builder.model.io.xpp3.ResourceConfigXpp3Writer;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
@@ -15,7 +21,6 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
import org.apache.velocity.VelocityContext;
/**
@@ -27,12 +32,22 @@
*/
public class CreateSkinMojo extends AbstractCDKMojo {
- private static final String TEMPLATES_PREFIX = "/skin/";
+ private static final String SRC_MAIN_RESOURCES = "src/main/resources";
- private static final String XCSS_TEMPLATE = TEMPLATES_PREFIX + "skin.xcss";
+ private static final String PROPERTIES = ".properties";
- private static final String PROPERTIES_TEMPLATE = TEMPLATES_PREFIX +
"skin.properties";
+ private static final String XCSS = ".xcss";
+ private static final String EXT_XCSS = "-ext.xcss";
+
+ private static final String RESOURCES_CONFIG_XML = "resources-config.xml";
+
+ private static final String SRC_MAIN_CONFIG_RESOURCES =
"src/main/config/resources";
+
+ private static final String META_INF_SKINS = "META-INF/skins/";
+
+ private static final String TEMPLATES_PREFIX = "/skin/";
+
private static final String POM_XML_TEMPLATE = TEMPLATES_PREFIX +
"pom/pom.xml";
/**
@@ -42,16 +57,23 @@
/**
* @parameter expression="${artifactId}"
- * @required
*/
private String artifactId;
/**
* @parameter expression="${groupId}"
- * @required
*/
private String groupId;
+ /**
+ * @parameter expression="${name}"
default-value="${project.artifactId}"
+ */
+ private String skinName;
+
+ /**
+ * @parameter expression="${package}"
default-value="${project.groupId}"
+ */
+ private String packageName;
/**
* @parameter expression="${version}" default-value="1.0-SNAPSHOT"
@@ -97,12 +119,19 @@
private File pluginJarFile = null;
- /** @component */
- private MavenProjectBuilder mavenProjectBuilder;
+ private File resourceDir;
-
private void createProjectIfNeeded() throws MojoExecutionException,
MojoFailureException{
//mavenProjectBuilder.build(project, localRepository, globalProfileManager)
+
+
+ if (groupId == null) {
+ throw new MojoExecutionException("Unable to create project. groupId is
null.");
+ }
+ if (artifactId == null) {
+ throw new MojoExecutionException("Unable to create project. artifactId is
null.");
+ }
+
project = new MavenProject();
project.setArtifactId(artifactId);
project.setGroupId(groupId);
@@ -136,9 +165,9 @@
getLog().info("Generating Skin");
- String name = artifactId;
+ String name = skinName;
- String packageName = groupId + "." + name;
+ String packageName = this.packageName + "." + name;
getLog().debug("Skin name is supposed to be " + name);
@@ -146,141 +175,179 @@
getLog().debug("Package detected " + packageName);
- SkinInfo skinInfo = new SkinInfo();
- skinInfo.setShortName(name);
- skinInfo.setPackageName(packageName);
- skinInfo.setBaseClassFileNames(getSkinTemplateNames("skin/baseclasses"));
- skinInfo.setExtClassFileNames(getSkinTemplateNames("skin/extclasses"));
+ SkinInfo skinInfoTemplate = new SkinInfo();
+ skinInfoTemplate.setShortName(name);
+ skinInfoTemplate.setPackageName(packageName);
+ skinInfoTemplate.setBaseClassResources(getArchetypeSkinTemplatesFromJar("skin/baseclasses"));
+ skinInfoTemplate.setExtClassResources(getArchetypeSkinTemplatesFromJar("skin/extclasses"));
+ skinInfoTemplate.setBaseSkin(baseSkin);
+ skinInfoTemplate.setPropertyFile(new Resource("skin/skin.properties"));
+ skinInfoTemplate.setMasterXcss(new Resource("skin/skin.xcss"));
+ skinInfoTemplate.setExtendedXcss(new Resource("skin/skin.xcss"));
+ skinInfoTemplate.setUseExt(useExt);
+ generateSkin(skinInfoTemplate);
- generateSkin(skinInfo);
-
getLog().info("Generating Skin successful");
}
-
- private List<File> writeComponentSkinTemplates(List<String> templateNames,
File skinDir) throws MojoExecutionException {
- List<File> filesInFolder = new ArrayList<File>(templateNames.size());
- for (String classFileName : templateNames) {
- int indexOf = classFileName.lastIndexOf("/");
- String newFileName = classFileName;
- if (indexOf > 0) {
- newFileName = classFileName.substring(indexOf + 1);
+
+
+ private void filterJarResource(Resource template, Resource skinResource, File baseDir,
VelocityContext context) throws Exception{
+ File newFile = new File(baseDir, skinResource.getPath());
+ if (newFile.exists()) {
+ getLog().debug("File " + newFile + " already exists. Skipping.");
+ } else {
+ try {
+ writeParsedTemplate(template.getPath(), context, newFile);
+ } catch (Exception e) {
+ throw new MojoExecutionException("Unable to write file " + newFile, e);
}
-
- File newFile = new File(skinDir, newFileName);
- if (newFile.exists()) {
- getLog().debug("File " + newFile + " already exists.
Skipping.");
- } else {
- try {
- writeParsedTemplate(classFileName, new VelocityContext(), newFile);
- } catch (Exception e) {
- throw new MojoExecutionException("Unable to write file " + newFile, e);
- }
+ }
+ }
+
+ private List<Resource> filterComponentSkinTemplates(List<Resource>
jarTemplates, SkinInfo skinInfo, File resourceDir) throws MojoExecutionException {
+ List<Resource> newResources = new
ArrayList<Resource>(jarTemplates.size());
+ for (Resource jarTemplate : jarTemplates) {
+ Resource newResource = new Resource();
+ String jarTemplateName = jarTemplate.getName();
+ int indexOfSlash = jarTemplateName.lastIndexOf('/');
+ if (indexOfSlash > 0) {
+ jarTemplateName = jarTemplateName.substring(indexOfSlash + 1);
}
- filesInFolder.add(newFile);
+ String resourceName = skinInfo.getPackageName().replace('.', '/') +
"/" + jarTemplateName;
+ newResource.setName(resourceName);
+ newResource.setPath(resourceName);
+ newResources.add(newResource);
+ try {
+ filterJarResource(jarTemplate, newResource, resourceDir, new VelocityContext());
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource
" + jarTemplate + " into " + newResource, e);
+ }
}
- return filesInFolder;
+ return newResources;
}
- private void generateSkin(SkinInfo skinInfo) throws MojoExecutionException,
MojoFailureException{
- File resourceDir = new File(project.getBasedir(), "src/main/resources");
+
+ private SkinInfo cloneSkinInfo(SkinInfo skinInfo) throws MojoExecutionException {
+ try {
+ return (SkinInfo) skinInfo.clone();
+ } catch(CloneNotSupportedException exception) {
+ throw new MojoExecutionException("Dunno why.", exception);
+ }
+ }
+
+ private void generateSkin(SkinInfo skinInfoTemplate) throws MojoExecutionException,
MojoFailureException{
+ resourceDir = new File(project.getBasedir(), SRC_MAIN_RESOURCES);
getLog().debug("Resources directory is supposed to be" + resourceDir);
checkAndCreateDirectory(resourceDir);
- String fullName = skinInfo.getPackageName();
+ String fullName = skinInfoTemplate.getPackageName();
String packageFolder = fullName.replace('.', '/');
getLog().debug("Relative path to package is " + packageFolder);
- File skinDir = new File(resourceDir, packageFolder);
- checkAndCreateDirectory(skinDir);
-
- File metaInfSkinsDir = new File(resourceDir, "META-INF/skins");
- getLog().debug("Property file and XCSS will be dropped into " + skinDir);
-
- checkAndCreateDirectory(metaInfSkinsDir);
-
VelocityContext velocityMasterContext = new VelocityContext();
velocityMasterContext.put("mojo", this);
velocityMasterContext.put("packagePath", packageFolder);
- velocityMasterContext.put("skinDir", skinDir);
- velocityMasterContext.put("name", skinInfo.getShortName());
+ velocityMasterContext.put("name", skinInfoTemplate.getShortName());
if (baseSkin != null) {
velocityMasterContext.put("baseSkin", baseSkin);
}
+ SkinInfo effectiveSkinInfo = cloneSkinInfo(skinInfoTemplate);
+ List<Resource> allResources = new ArrayList<Resource>();
+ velocityMasterContext.put("skinInfo", effectiveSkinInfo);
//Copy basic classes, and list them
- List<File> baseClassFiles =
writeComponentSkinTemplates(skinInfo.getBaseClassFileNames(), skinDir);
- velocityMasterContext.put("baseClassFiles", baseClassFiles);
+ List<Resource> baseClassResources =
filterComponentSkinTemplates(skinInfoTemplate.getBaseClassResources(), skinInfoTemplate,
resourceDir);
+
+ effectiveSkinInfo.setBaseClassResources(baseClassResources);
+ allResources.addAll(baseClassResources);
+ velocityMasterContext.put("baseClassResources", baseClassResources);
+
//Generate Master XCSS file
- File masterFile = new File(metaInfSkinsDir, skinInfo.getShortName() +
".xcss");
- velocityMasterContext.put("masterFile", masterFile);
+ Resource masterXcss = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() +
XCSS);
+ effectiveSkinInfo.setMasterXcss(masterXcss);
+ allResources.add(masterXcss);
try {
- generateMasterXCSSFile(masterFile, skinDir, baseClassFiles, packageFolder);
+ generateMasterXCSSFile(skinInfoTemplate.getMasterXcss(),
effectiveSkinInfo.getMasterXcss(), effectiveSkinInfo.getBaseClassResources());
} catch(Exception e) {
- throw new MojoExecutionException("Unable to generate master.xcss file " +
masterFile);
+ throw new MojoExecutionException("Unable to generate master.xcss file " +
masterXcss, e);
}
if (useExt) {
//Copy Ext classes, if needed
- List<File> extClassFiles =
writeComponentSkinTemplates(skinInfo.getExtClassFileNames(), skinDir);
- velocityMasterContext.put("extClassFiles", extClassFiles);
+ List<Resource> extClassResources =
filterComponentSkinTemplates(skinInfoTemplate.getExtClassResources(), skinInfoTemplate,
resourceDir);
+ effectiveSkinInfo.setExtClassResources(extClassResources);
+ allResources.addAll(extClassResources);
+ velocityMasterContext.put("extClassResources", extClassResources);
//Generate Master EXT XCSS file
- File extFile = new File(metaInfSkinsDir, skinInfo.getShortName() +
"-ext.xcss");
- velocityMasterContext.put("extFile", extFile);
+ Resource masterExtXcss = new Resource(META_INF_SKINS +
effectiveSkinInfo.getShortName() + EXT_XCSS);
+ effectiveSkinInfo.setExtendedXcss(masterExtXcss);
+ allResources.add(masterExtXcss);
try {
- generateMasterXCSSFile(extFile, skinDir, extClassFiles, packageFolder);
+ generateMasterXCSSFile(skinInfoTemplate.getExtendedXcss(),
effectiveSkinInfo.getExtendedXcss(), effectiveSkinInfo.getExtClassResources());
+
} catch(Exception e) {
- throw new MojoExecutionException("Unable to generate master.xcss file " +
masterFile);
+ throw new MojoExecutionException("Unable to generate master.xcss file " +
masterExtXcss, e);
}
}
+
+ Resource properties = new Resource(META_INF_SKINS + effectiveSkinInfo.getShortName() +
PROPERTIES);
+ effectiveSkinInfo.setPropertyFile(properties);
+ try {
+ filterJarResource(skinInfoTemplate.getPropertyFile(), properties, resourceDir,
velocityMasterContext);
+ } catch (Exception e) {
+ throw new MojoExecutionException("An exception occured while filtering resource
" + skinInfoTemplate.getPropertyFile() + " into " + properties, e);
+ }
-
- //Generate .properties file
- File propertyFile = new File(metaInfSkinsDir, skinInfo.getShortName() +
".properties");
+
+ File resourceConfigDir = new File(project.getBasedir(), SRC_MAIN_CONFIG_RESOURCES);
+ checkAndCreateDirectory(resourceConfigDir);
+ File resourceConfigFile = new File(resourceConfigDir, RESOURCES_CONFIG_XML);
try {
- writeParsedTemplate(PROPERTIES_TEMPLATE, velocityMasterContext, propertyFile);
+ addToResourceConfig(allResources, resourceConfigFile);
} catch (Exception e) {
- throw new MojoExecutionException("An exception occured when generating " +
propertyFile, e);
+ throw new MojoExecutionException("Unable to register newly added resources in
resource-config.xml", e);
}
-
+
}
- private void generateMasterXCSSFile(File masterFile, File skinDir, List<File>
includedFiles, String packagePath) throws Exception {
+ private void generateMasterXCSSFile(Resource template, Resource target,
List<Resource> includedResources) throws Exception {
VelocityContext context = new VelocityContext();
context.put("mojo", this);
- context.put("baseXcss", masterFile);
- context.put("xcssFiles", includedFiles);
- context.put("packagePath", packagePath);
- context.put("skinDir", skinDir);
- writeParsedTemplate(XCSS_TEMPLATE, context, masterFile);
-
+ context.put("includedResources", includedResources);
+ filterJarResource(template, target, resourceDir, context);
}
+ private Resource fromJarEntry(JarEntry entry) {
+ Resource resource = new Resource();
+ resource.setName(entry.getName());
+ resource.setPath(entry.getName());
+ return resource;
+ }
-
- private List<String> getSkinTemplateNames(String prefix) throws
MojoExecutionException{
+ private List<Resource> getArchetypeSkinTemplatesFromJar(String prefix) throws
MojoExecutionException{
try {
if (pluginJarFile == null) {
pluginJarFile = getPluginArtifactJar();
}
- List <String> fileNames = new ArrayList<String>();
+ List <Resource> fileNames = new ArrayList<Resource>();
JarFile jar = new JarFile(pluginJarFile);
Enumeration<JarEntry> entries = jar.entries();
while(entries.hasMoreElements()) {
JarEntry jarEntry = entries.nextElement();
String jarEntryName = jarEntry.getName();
if(jarEntryName.startsWith(prefix) && !jarEntry.isDirectory()) {
- fileNames.add(jarEntryName);
+ fileNames.add(fromJarEntry(jarEntry));
}
}
return fileNames;
@@ -309,4 +376,28 @@
}
}
+ private void addToResourceConfig(List<Resource> resources, File
resourceConfigFile) throws Exception{
+ ResourceConfig resourceConfig = null;
+
+ if (resourceConfigFile.exists()) {
+ resourceConfig = new ResourceConfigXpp3Reader().read(new
FileInputStream(resourceConfigFile));
+ }
+
+ if (resourceConfig == null) {
+ resourceConfig = new ResourceConfig();
+ resourceConfig.setResources(resources);
+ } else {
+ for (Resource resource : resources) {
+ if (!resourceConfig.containsResource(resource)) {
+ resourceConfig.addResource(resource);
+ }
+ }
+ }
+
+
+
+ new ResourceConfigXpp3Writer().write(new FileWriter(resourceConfigFile),
resourceConfig);
+
+ }
+
}
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/SkinInfo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/SkinInfo.java 2008-05-09
16:28:46 UTC (rev 8519)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/SkinInfo.java 2008-05-10
14:45:29 UTC (rev 8520)
@@ -3,23 +3,33 @@
*/
package org.ajax4jsf.builder.mojo;
-import java.io.File;
import java.util.ArrayList;
import java.util.List;
+import org.aja4jsf.builder.model.Resource;
+
/**
* @author Maksim Kaszynski
*
*/
-public class SkinInfo {
+public class SkinInfo implements Cloneable{
private String shortName;
private String packageName;
- private File masterFile;
- private File extFile;
- private List<String> baseClassFileNames = new ArrayList<String>();
- private List<String> extClassFileNames = new ArrayList<String>();
+ private String baseSkin;
+ private List<Resource> baseClassResources = new ArrayList<Resource>();
+ private List<Resource> extClassResources = new ArrayList<Resource>();
+ private Resource masterXcss;
+ private Resource extendedXcss;
+ private Resource propertyFile;
+ private boolean useExt;
+ public boolean isUseExt() {
+ return useExt;
+ }
+ public void setUseExt(boolean useExt) {
+ this.useExt = useExt;
+ }
public String getShortName() {
return shortName;
}
@@ -32,30 +42,46 @@
public void setPackageName(String packageName) {
this.packageName = packageName;
}
- public File getMasterFile() {
- return masterFile;
+ public List<Resource> getBaseClassResources() {
+ return baseClassResources;
}
- public void setMasterFile(File masterFile) {
- this.masterFile = masterFile;
+ public void setBaseClassResources(List<Resource> baseClassResources) {
+ this.baseClassResources = baseClassResources;
}
- public File getExtFile() {
- return extFile;
+ public List<Resource> getExtClassResources() {
+ return extClassResources;
}
- public void setExtFile(File extFile) {
- this.extFile = extFile;
+ public void setExtClassResources(List<Resource> extClassResources) {
+ this.extClassResources = extClassResources;
}
- public List<String> getBaseClassFileNames() {
- return baseClassFileNames;
+ public Resource getMasterXcss() {
+ return masterXcss;
}
- public void setBaseClassFileNames(List<String> baseClassFileNames) {
- this.baseClassFileNames = baseClassFileNames;
+ public void setMasterXcss(Resource masterXcss) {
+ this.masterXcss = masterXcss;
}
- public List<String> getExtClassFileNames() {
- return extClassFileNames;
+ public Resource getExtendedXcss() {
+ return extendedXcss;
}
- public void setExtClassFileNames(List<String> extClassFileNames) {
- this.extClassFileNames = extClassFileNames;
+ public void setExtendedXcss(Resource extendedXcss) {
+ this.extendedXcss = extendedXcss;
}
-
-
+ public Resource getPropertyFile() {
+ return propertyFile;
+ }
+ public void setPropertyFile(Resource propertyFile) {
+ this.propertyFile = propertyFile;
+ }
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+ public String getBaseSkin() {
+ return baseSkin;
+ }
+ public void setBaseSkin(String baseSkin) {
+ this.baseSkin = baseSkin;
+ }
+
+
}
Added: trunk/cdk/maven-cdk-plugin/src/main/mdo/resource-config.mdo
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/mdo/resource-config.mdo
(rev 0)
+++ trunk/cdk/maven-cdk-plugin/src/main/mdo/resource-config.mdo 2008-05-10 14:45:29 UTC
(rev 8520)
@@ -0,0 +1,72 @@
+<models>
+ <id>resource-config</id>
+ <name>ResourceConfig</name>
+ <description><![CDATA[Model for resource config.]]></description>
+ <defaults>
+ <default>
+ <key>package</key>
+ <value>org.aja4jsf.builder.model</value>
+ </default>
+ </defaults>
+ <classes>
+ <class rootElement="true" xml.tagName="resource-config">
+ <name>ResourceConfig</name>
+ <fields>
+ <field xml.listStyle="flat">
+ <name>resources</name>
+ <association xml.listStyle="flat"
xml.associationTagName="">
+ <type>Resource</type>
+ <multiplicity>*</multiplicity>
+ </association>
+ </field>
+ </fields>
+ <codeSegments>
+ <codeSegment>
+ <code><![CDATA[//
+ public boolean containsResource(Resource res) {
+ return resources != null && resources.contains(res);
+ }
+
+ //]]></code></codeSegment>
+ </codeSegments>
+ </class>
+ <class xml.tagName="resource">
+ <name>Resource</name>
+ <fields>
+ <field>
+ <name>name</name>
+ <type>String</type>
+ </field>
+ <field xml.attribute="true" xml.tagName="class">
+ <name>className</name>
+ <type>String</type>
+ </field>
+ <field>
+ <name>path</name>
+ <type>String</type>
+ </field>
+ </fields>
+ <codeSegments>
+ <codeSegment>
+ <code><![CDATA[//
+ public Resource() {
+ }
+ public Resource(String path) {
+ super();
+ this.path = path;
+ this.name = path;
+ }
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof Resource) {
+ Resource anotherResource = (Resource) obj;
+ return anotherResource.name.equals(name);
+ }
+ return super.equals(obj);
+ }
+
+ //]]></code></codeSegment>
+ </codeSegments>
+ </class>
+ </classes>
+</models>
\ No newline at end of file
Modified: trunk/cdk/maven-cdk-plugin/src/main/resources/skin/pom/pom.xml
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/skin/pom/pom.xml 2008-05-09 16:28:46 UTC
(rev 8519)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/skin/pom/pom.xml 2008-05-10 14:45:29 UTC
(rev 8520)
@@ -12,9 +12,6 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
<version>3.2.1-SNAPSHOT</version>
- <configuration>
- <name>${name}</name>
- </configuration>
</plugin>
</plugins>
</build>
Modified: trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.properties
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.properties 2008-05-09 16:28:46
UTC (rev 8519)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.properties 2008-05-10 14:45:29
UTC (rev 8520)
@@ -1,8 +1,8 @@
gradientType=glass
-generalStyleSheet=resource:///META-INF/skins/${masterFile.name}
-#if ($baseSkin)
-baseSkin=${baseSkin}
+generalStyleSheet=resource:///${skinInfo.masterXcss.path}
+#if ($skinInfo.baseSkin)
+baseSkin=${skinInfo.baseSkin}
#end
-#if ($extFile)
-extendedStyleSheet=resource:///META-INF/skins/${extFile.name}
+#if ($skinInfo.useExt)
+extendedStyleSheet=resource:///${skinInfo.extendedXcss.path}
#end
Modified: trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.xcss
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.xcss 2008-05-09 16:28:46 UTC
(rev 8519)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/skin/skin.xcss 2008-05-10 14:45:29 UTC
(rev 8520)
@@ -3,8 +3,8 @@
xmlns:u='http:/jsf.exadel.com/template/util'
xmlns="http://www.w3.org/1999/xhtml" >
- #foreach ($file in $xcssFiles)
- <f:importResource src="${packagePath}/${file.name}" />
+ #foreach ($resource in $includedResources)
+ <f:importResource src="${resource.path}" />
#end
</f:template>
\ No newline at end of file