Re: Import.resource and jars, was Fwd: svn commit: r634629 - in /incubator/tuscany/java/sca/tutorial/store/uiservices: ./ store.html

2008-03-09 Thread Jean-Sebastien Delfino

Jean-Sebastien Delfino wrote:

Luciano Resende wrote:

Hi Sebastien

   What issues were you experiencing when using Import.resources with
jars ? Are there any specific steps to reproduce it ?

Thanks



I was using the tutorial/store module and the resource resolver was not 
able to find the HTML file in tutorial/assets.


To reproduce the problem, do the following:

1) in tutorial/domain start LaunchTutorialAdmin.

2) point your Web browser to http://localhost:9990/ui/workspace to make 
sure it started ok.


3) in tutorial/store start LaunchStore.

If you run into the same issue as me, you will see some warnings with 
the Widget component if uiservices/store.html is in tutorial/assets 
instead of tutorial/store (because store.html can't be found).




Actually the problem was caused by how I was reading the contribution 
and not populating the artifact resolver correctly, in module 
workspace-impl. I just fixed it in SVN revision r635371.


--
Jean-Sebastien

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Import.resource and jars, was Fwd: svn commit: r634629 - in /incubator/tuscany/java/sca/tutorial/store/uiservices: ./ store.html

2008-03-08 Thread Luciano Resende
Hi Sebastien

   What issues were you experiencing when using Import.resources with
jars ? Are there any specific steps to reproduce it ?

Thanks


-- Forwarded message --
From:  [EMAIL PROTECTED]
Date: Fri, Mar 7, 2008 at 4:04 AM
Subject: svn commit: r634629 - in
/incubator/tuscany/java/sca/tutorial/store/uiservices: ./ store.html
To: [EMAIL PROTECTED]


Author: jsdelfino
 Date: Fri Mar  7 04:04:38 2008
 New Revision: 634629

 URL: http://svn.apache.org/viewvc?rev=634629view=rev
 Log:
 Add store.html to the store module for now as import.resource does
not seem to work properly with JARs.

 Added:
incubator/tuscany/java/sca/tutorial/store/uiservices/
incubator/tuscany/java/sca/tutorial/store/uiservices/store.html
(with props)

 Added: incubator/tuscany/java/sca/tutorial/store/uiservices/store.html
 URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/store/uiservices/store.html?rev=634629view=auto
 ==
 --- incubator/tuscany/java/sca/tutorial/store/uiservices/store.html (added)
 +++ incubator/tuscany/java/sca/tutorial/store/uiservices/store.html
Fri Mar  7 04:04:38 2008
 @@ -0,0 +1,138 @@
 +!--
 +* Licensed to the Apache Software Foundation (ASF) under one
 +* or more contributor license agreements.  See the NOTICE file
 +* distributed with this work for additional information
 +* regarding copyright ownership.  The ASF licenses this file
 +* to you under the Apache License, Version 2.0 (the
 +* License); you may not use this file except in compliance
 +* with the License.  You may obtain a copy of the License at
 +*
 +*   http://www.apache.org/licenses/LICENSE-2.0
 +*
 +* Unless required by applicable law or agreed to in writing,
 +* software distributed under the License is distributed on an
 +* AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 +* KIND, either express or implied.  See the License for the
 +* specific language governing permissions and limitations
 +* under the License.
 +--
 +html
 +head
 +titleStore/title
 +
 +script type=text/javascript src=store.js/script
 +
 +script language=JavaScript
 +
 +   //@Reference
 +   var catalog = new Reference(catalog);
 +
 +   //@Reference
 +   var shoppingCart = new Reference(shoppingCart);
 +
 +   //@Reference
 +   var shoppingTotal = new Reference(shoppingTotal);
 +
 +   var catalogItems;
 +
 +   function catalog_getResponse(items) {
 +   var catalog = ;
 +   for (var i=0; iitems.length; i++) {
 +   var item = items[i].name + ' - ' + items[i].price;
 +   catalog += 'input name=items
type=checkbox value=' +
 +   item + '' + item + ' br';
 +   }
 +   document.getElementById('catalog').innerHTML=catalog;
 +   catalogItems = items;
 +   }
 +
 +   function shoppingCart_getResponse(feed) {
 +   if (feed != null) {
 +   var entries = feed.getElementsByTagName(entry);
 +   var list = ;
 +   for (var i=0; ientries.length; i++) {
 +   var content =
entries[i].getElementsByTagName(content)[0];
 +   var name =
content.getElementsByTagName(name)[0].firstChild.nodeValue;
 +   var price =
content.getElementsByTagName(price)[0].firstChild.nodeValue;
 +   list += name + ' - ' + price + ' br';
 +   }
 +
document.getElementById(shoppingCart).innerHTML = list;
 +
 +   if (entries.length != 0) {
 +
shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
 +   }
 +   }
 +   }
 +
 +   function shoppingTotal_getTotalResponse(total) {
 +   document.getElementById('total').innerHTML = total;
 +   }
 +
 +   function shoppingCart_postResponse(entry) {
 +   shoppingCart.get(, shoppingCart_getResponse);
 +   }
 +
 +   function addToCart() {
 +   var items  = document.catalogForm.items;
 +   var j = 0;
 +   for (var i=0; iitems.length; i++)
 +   if (items[i].checked) {
 +   var entry = 'entry
xmlns=http://www.w3.org/2005/Atom;titleitem/titlecontent
type=text/xml' +
 +   'Item xmlns=http://services/;' +
 +   'name xmlns=' + catalogItems[i].name +
'/name' + 'price xmlns=' + catalogItems[i].price + '/price' +
 +   '/Item' + '/content/entry';
 +   shoppingCart.post(entry,
shoppingCart_postResponse);
 +   items[i].checked = false;
 +   }
 +   }
 +   function checkoutCart() {
 +   

Re: Import.resource and jars, was Fwd: svn commit: r634629 - in /incubator/tuscany/java/sca/tutorial/store/uiservices: ./ store.html

2008-03-08 Thread Jean-Sebastien Delfino

Luciano Resende wrote:

Hi Sebastien

   What issues were you experiencing when using Import.resources with
jars ? Are there any specific steps to reproduce it ?

Thanks



I was using the tutorial/store module and the resource resolver was not 
able to find the HTML file in tutorial/assets.


To reproduce the problem, do the following:

1) in tutorial/domain start LaunchTutorialAdmin.

2) point your Web browser to http://localhost:9990/ui/workspace to make 
sure it started ok.


3) in tutorial/store start LaunchStore.

If you run into the same issue as me, you will see some warnings with 
the Widget component if uiservices/store.html is in tutorial/assets 
instead of tutorial/store (because store.html can't be found).


--
Jean-Sebastien

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]