atom feed35 messages in net.java.dev.ajax.devRe: Issues: ajax-137, widgets-1: Fix ...
FromSent OnAttachments
Gregory MurrayApr 10, 2007 10:44 pm 
Norbert TruchsessApr 11, 2007 12:03 am 
Norbert TruchsessApr 11, 2007 12:05 am 
Gregory MurrayApr 11, 2007 12:26 am 
Gregory MurrayApr 11, 2007 12:48 am 
Craig McClanahanApr 11, 2007 12:58 am 
Craig McClanahanApr 11, 2007 1:19 am 
Ed BurnsApr 11, 2007 6:32 pm 
Ed BurnsApr 11, 2007 7:52 pm 
Craig McClanahanApr 11, 2007 7:53 pm 
Ed BurnsApr 11, 2007 8:28 pm 
Craig McClanahanApr 11, 2007 9:41 pm 
Craig McClanahanApr 11, 2007 9:44 pm 
Craig McClanahanApr 11, 2007 9:51 pm 
Norbert TruchsessApr 11, 2007 10:08 pm 
Norbert TruchsessApr 11, 2007 10:15 pm 
Craig McClanahanApr 12, 2007 12:19 am 
Norbert TruchsessApr 12, 2007 1:19 pm 
Norbert TruchsessApr 12, 2007 2:54 pm 
Norbert TruchsessApr 12, 2007 3:43 pm 
Gregory MurrayApr 14, 2007 4:56 pm 
Gregory MurrayApr 14, 2007 5:03 pm 
Craig McClanahanApr 14, 2007 5:06 pm 
Ed BurnsApr 16, 2007 8:18 am 
Gregory MurrayApr 16, 2007 8:32 am 
Ed BurnsApr 16, 2007 8:55 am 
Gregory MurrayApr 16, 2007 9:09 am 
Norb...@t-online.deApr 16, 2007 9:21 am 
Ed BurnsApr 17, 2007 9:59 am 
Craig McClanahanApr 17, 2007 10:23 am 
Norbert TruchsessApr 17, 2007 1:05 pm 
Craig McClanahanApr 17, 2007 3:30 pm 
Gregory MurrayApr 18, 2007 1:54 am 
Norb...@t-online.deApr 18, 2007 4:44 am 
Norbert TruchsessApr 19, 2007 1:40 pm 
Subject:Re: Issues: ajax-137, widgets-1: Fix DynaFaces
From:Craig McClanahan (Crai@Sun.COM)
Date:Apr 11, 2007 9:51:08 pm
List:net.java.dev.ajax.dev

Ed Burns wrote:

I was given the mandate to make sure DynaFaces worked with jMaki. I had to make some small changes, covered in issues

https://ajax.dev.java.net/issues/show_bug.cgi?id=137

https://widgets.dev.java.net/issues/show_bug.cgi?id=1

Here are the change-bundles.

Please review.

I won't check it in until review, but I will update the maven repo to have these changes so DynaFaces will build and work for Rajiv.

Issue: https://ajax.dev.java.net/issues/show_bug.cgi?id=137

SECTION: Changes

M jmaki/ajax-wrapper-comp-pom.xml

- update pom version to 1.0-SNAPSHOT

M jmaki/build.xml

- Fix maven repo related targets to use correct version number

- Add mvn.install.jar target to manually install ajax-wrapper-comp.jar into local repo.

M jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java

- Roll back Greg's change to uuid generation mechanism.

+ // edburns: Greg, I've commented out the above line because the uuid + // needs to be the actual jsf client id, otherwise, how can the value + // of the component be associated with the component instance that + // is the second argument to this method?

FWIW, I agree with you on this change. It's also consistent with the way I have implemented the paramUuid() method in the AbstractRenderer base class in the "widgets" project. Both client side code and server side code need to be able to predict what the "id" attribute will be for the DOM elements that they want to affect. In a JSF based environment, the canonical assumption is to *always* use the client id for that purpose. Doing anything else is being gratuitously inconsistent with the rest of the world ... and I haven't yet been able to grok Greg's explanation for why it should be different.

Craig

M jmaki/shared/src/java/jmaki/runtime/jsf/JsfUriManagerImpl.java

- buildDynamicResourceReference was not correctly implemented with respect to JSF. See diffs.

SECTION: Diffs

Index: jmaki/ajax-wrapper-comp-pom.xml =================================================================== RCS file: /cvs/ajax/ws/jmaki/ajax-wrapper-comp-pom.xml,v retrieving revision 1.2 diff -u -r1.2 ajax-wrapper-comp-pom.xml --- jmaki/ajax-wrapper-comp-pom.xml 22 Nov 2006 21:43:08 -0000 1.2 +++ jmaki/ajax-wrapper-comp-pom.xml 12 Apr 2007 03:15:15 -0000 @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion> - <groupId>com.sun.jmaki</groupId> + <groupId>jmaki</groupId> <artifactId>ajax-wrapper-comp</artifactId> - <version>0.6-SNAPSHOT</version> + <version>1.0-SNAPSHOT</version> <description>This is the master POM file for Sun's Implementation of - the jMaki.</description> + jMaki.</description> <url>http://ajax.dev.java.net/</url> <issueManagement> <system>issueZilla</system> Index: jmaki/build.xml =================================================================== RCS file: /cvs/ajax/ws/jmaki/build.xml,v retrieving revision 1.76 diff -u -r1.76 build.xml --- jmaki/build.xml 11 Apr 2007 14:56:48 -0000 1.76 +++ jmaki/build.xml 12 Apr 2007 03:15:15 -0000 @@ -371,14 +371,14 @@

<!-- Create the source distribution --> <mkdir dir="${basedir}/dist" /> - <jar
destfile="${basedir}/dist/${name}-sources-0${jmaki.version}-SNAPSHOT.zip"> + <jar destfile="${basedir}/dist/${name}-sources-${jmaki.version}.zip"> <zipfileset dir="${basedir}/.." excludes="**/CVS/**,**/build/**,**/dist/**,**/target/**"/> </jar>

<delete dir="${basedir}/dist/maven-repo" /><!-- clean it --> <maven-repository-importer destdir="${basedir}/dist/maven-repo"
version="${snapshot.version}"> - <artifact jar="${basedir}/shared/dist/${name}.jar"
pom="ajax-wrapper-comp-pom.xml"
srczip="${basedir}/dist/${name}-sources-0${jmaki.version}-SNAPSHOT.zip"/> + <artifact jar="${basedir}/shared/dist/${name}.jar"
pom="ajax-wrapper-comp-pom.xml"
srczip="${basedir}/dist/${name}-sources-${jmaki.version}.zip"/> </maven-repository-importer> </target>

@@ -388,7 +388,7 @@ <echo>importing to CVS...</echo> <cvs dest="${basedir}/dist/maven-repo"> <commandline> - <argument value="-d:pserver:${user.name}@rejuniper.sfbay.sun.com:/cvs" /> + <argument value="-d:pserver:${user.name}@cvs.dev.java.net:/cvs" /> <argument line="-z9 import -ko -W *.jar -kb -m" /> <argument value="deploying new jars to the java.net maven repository" />

@@ -398,5 +398,13 @@ </cvs> </target>

+<target name="mvn.install.jar" description="install ajax-wrapper-comp into the
local maven repo."> + + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=jmaki
-DartifactId=ajax-wrapper-comp -Dversion=1.0-SNAPSHOT -Dpackaging=jar
-Dfile=${basedir}/shared/dist/ajax-wrapper-comp.jar" /> + </exec> +</target> + +

</project> Index: jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java =================================================================== RCS file:
/cvs/ajax/ws/jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java,v retrieving revision 1.4 diff -u -r1.4 AjaxWrapperRenderer.java --- jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java 11 Apr 2007
17:40:46 -0000 1.4 +++ jmaki/shared/src/java/jmaki/runtime/jsf/AjaxWrapperRenderer.java 12 Apr 2007
03:15:15 -0000 @@ -112,8 +112,12 @@ // unique ids are unique to a page and not to an session meaning that
if we inject // content from one page into another the same widget can be given the
same id thus // the same id appears 2x in the same page. - ajaxCommon.setUuid(wrapper.getName().replace('.', '_') + "_" +
nextId++); - //ajaxCommon.setUuid(wrapper.getClientId(context)); + // ajaxCommon.setUuid(wrapper.getName().replace('.', '_') + "_" +
nextId++); + // edburns: Greg, I've commented out the above line because the uuid + // needs to be the actual jsf client id, otherwise, how can the value + // of the component be associated with the component instance that + // is the second argument to this method? + ajaxCommon.setUuid(wrapper.getClientId(context)); ajaxCommon.setTemplate(wrapper.getTemplate()); ajaxCommon.setArgs(wrapper.getArgs());

Index: jmaki/shared/src/java/jmaki/runtime/jsf/JsfUriManagerImpl.java =================================================================== RCS file:
/cvs/ajax/ws/jmaki/shared/src/java/jmaki/runtime/jsf/JsfUriManagerImpl.java,v retrieving revision 1.1 diff -u -r1.1 JsfUriManagerImpl.java --- jmaki/shared/src/java/jmaki/runtime/jsf/JsfUriManagerImpl.java 11 Apr 2007
17:28:23 -0000 1.1 +++ jmaki/shared/src/java/jmaki/runtime/jsf/JsfUriManagerImpl.java 12 Apr 2007
03:15:16 -0000 @@ -14,10 +14,12 @@ public class JsfUriManagerImpl implements UriManager,UriManagerFactory {

public String buildClassPathResourceReference(AjaxContext ctx, String
resource) { - if (ctx.getIsExtensionMapped()) - return ctx.getApplicationRoot()+jsfRoot+resource; - else + if (ctx.getIsExtensionMapped()) { + return ctx.getApplicationRoot()+getJsfRoot()+resource; + } + else { return ctx.getServletRoot()+resource; + } }

public String buildWebAppResourceReference(AjaxContext ctx, String resource) { @@ -29,11 +31,37 @@ }

public String buildDynamicResourceReference(AjaxContext ctx, String resource)
{ - if (resource.startsWith("#{") && resource.endsWith("}")) { - resource = resource.substring(2,
resource.length()-1)+AjaxWrapperPhaseListener.JMAKI_AJAX; - } - return jsfRoot==null ? ctx.getServletRoot()+resource :
ctx.getApplicationRoot()+jsfRoot+resource; - } + String result = null; + FacesContext facesContext = FacesContext.getCurrentInstance(); + // PENDING(edburns): this is bogus! I'm sick of fixing this again
and + // again. If resource is a JSF ValueExpression. This method + // must return something that, when appended to the context-root + // of this application, will cause the postback to just be + // sent back to the faces page. + + if (resource.startsWith("#{") && resource.endsWith("}")) { + String facesMapping = + Util.getFacesMapping(facesContext); + String viewId = facesContext.getViewRoot().getViewId(); + String resultPath = null; + if (ctx.getIsExtensionMapped()) { + resultPath = ""; + } + else { + resultPath = facesMapping + "/" + viewId; + } + result = ctx.getServletRoot() + resultPath; + } + else { + result = ctx.getServletRoot() + + resource.substring(2,resource.length()-1) + + AjaxWrapperPhaseListener.JMAKI_AJAX; + } + return result; + } +//resource = +// } +// return jsfRoot==null ? resource :
ctx.getApplicationRoot()+jsfRoot+resource;

public UriManager getInstance(ServletContext ctx) { if (!this.isInitialized) init(ctx); @@ -43,16 +71,45 @@ private boolean isInitialized = false;

private void init(ServletContext ctx) { - if (ctx.getInitParameter(AjaxInitParameters.JSFROOT)!=null) { - jsfRoot = ctx.getInitParameter(AjaxInitParameters.JSFROOT); - } else - jsfRoot = "/faces"; if (ctx.getInitParameter(AjaxInitParameters.EXTERNALROOT)!=null) { - externalRoot = ctx.getInitParameter(AjaxInitParameters.EXTERNALROOT); - } + externalRoot =
ctx.getInitParameter(AjaxInitParameters.EXTERNALROOT); + } + + // Use either a user specified JSF Root + // (Can't see why this would be necessary) or a heuristic. + if (ctx.getInitParameter(AjaxInitParameters.JSFROOT)!=null) { + initTimeJsfRoot =
ctx.getInitParameter(AjaxInitParameters.JSFROOT); + } + else { + initTimeJsfRoot = "/faces"; + } + this.isInitialized = true; } - - private String jsfRoot = null; + private String externalRoot = null; + + private String initTimeJsfRoot = null; + + private String jsfRoot = null; + + private String getJsfRoot() { + if (null == jsfRoot) { + FacesContext facesContext = FacesContext.getCurrentInstance(); + // If we can't get a FacesContext, just use the initTime value + if (null != facesContext) { + jsfRoot = initTimeJsfRoot; + } + else { + jsfRoot = Util.getFacesMapping(facesContext); + // If the the FacesServlet is extension mapped... + if (!Util.isPrefixMapped(jsfRoot)) { + // the jsfRoot is the empty string, and care + // must be taken to append the proper mapping + jsfRoot = ""; + } + } + } + return jsfRoot; + } }

Issue: https://widgets.dev.java.net/issues/show_bug.cgi?id=1

SECTION: Changes

A code/widgets/scriptaculous/jmaki-resources-scriptaculous-pom.xml

- pom for putting the jar in the maven repo.

M
code/widgets/scriptaculous/src/resources/scriptaculous/inplace/component.js

- If the widget set an outResult property use that as the result. That's the contract!

M code/widgets/scriptaculous/build.xml M code/widgets/dojo/build.xml

- added target to install into local maven repo

SECTION: Diffs

Index: code/widgets/scriptaculous/jmaki-resources-scriptaculous-pom.xml =================================================================== --- code/widgets/scriptaculous/jmaki-resources-scriptaculous-pom.xml (revision
0) +++ code/widgets/scriptaculous/jmaki-resources-scriptaculous-pom.xml (revision
0) @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>jmaki</groupId> + <artifactId>jmaki-resources-scriptaculous</artifactId> + <version>1.0-SNAPSHOT</version> + <description>This is the master POM file for Sun's Implementation of + jMaki.</description> + <url>http://ajax.dev.java.net/</url> + <issueManagement> + <system>issueZilla</system> + <url>https://ajax.dev.java.net/servlets/ProjectIssues</url> + </issueManagement> + <mailingLists> + <mailingList> + <name>Sun's jMaki Implementation Dev List</name> + <post>de@ajax.dev.java.net</post> +
<archive>https://ajax.dev.java.net/servlets/SummarizeList?listName=dev</archive> + </mailingList> + </mailingLists> + <developers> + <developer> + <id>gmurray71</id> + <name>Gregory.Murray</name> + <email>Greg@sun.com</email> + <organization>Sun Microsystems, Inc.</organization> + <roles> + <role>project-owner</role> + </roles> + <timezone>-9</timezone> + </developer> + </developers> + <contributors> + <contributor> + <name>Ed Burns</name> + </contributor> + </contributors> + <licenses> + <license> + <name>Berkeley License</name> + <url>http://developers.sun.com/berkeley_license.html</url> + <distribution>repo</distribution> + </license> + </licenses> + <organization> + <name>Sun Microsystems, Inc</name> + <url>http://www.sun.com/</url> + </organization> + <dependencies> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet.jsp</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.faces</groupId> + <artifactId>jsf-api</artifactId> + <version>1.1_02</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> Index:
code/widgets/scriptaculous/src/resources/scriptaculous/inplace/component.js =================================================================== --- code/widgets/scriptaculous/src/resources/scriptaculous/inplace/component.js
(revision 126) +++ code/widgets/scriptaculous/src/resources/scriptaculous/inplace/component.js
(working copy) @@ -21,9 +21,8 @@ } else { result = Form.serialize(form); + if (!wargs.service) wInstance.wrapper.element.innerHTML = value; } - result = Form.serialize(form); - if (!wargs.service) wInstance.wrapper.element.innerHTML = value; return result; }, onComplete: function(transport, element) { Index: code/widgets/scriptaculous/build.xml =================================================================== --- code/widgets/scriptaculous/build.xml (revision 126) +++ code/widgets/scriptaculous/build.xml (working copy) @@ -46,6 +46,14 @@ </jar> </target>

+<target name="mvn.install.jar" description="install
jmaki-resources-scriptaculous into the local maven repo."> + + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=jmaki
-DartifactId=jmaki-resources-scriptaculous -Dversion=1.6.4 -Dpackaging=jar
-Dfile=${basedir}/dist/jmaki-resources-scriptaculous.jar " /> + </exec> +</target> + + <target name="clean"> <delete dir="${build.dir}" /> <delete dir="dist" /> Index: code/widgets/dojo/build.xml =================================================================== --- code/widgets/dojo/build.xml (revision 126) +++ code/widgets/dojo/build.xml (working copy) @@ -47,5 +47,13 @@ includes="META-INF/**"/> </jar> </target> + +<target name="mvn.install.jar" description="install jmaki-resources-dojo into
the local maven repo."> + + <exec executable="mvn"> + <arg line="install:install-file -DgroupId=jmaki
-DartifactId=jmaki-resources-dojo -Dversion=0.4.2 -Dpackaging=jar
-Dfile=${basedir}/dist/jmaki-resources-dojo.jar " /> + </exec> +</target> +

</project>