You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Johan Andries <jo...@gmail.com> on 2011/11/13 10:29:45 UTC

[RO] preview javascript application

Hi,

just uploaded a preview of the javascript application to
http://users.telenet.be/johanenhilde/claims.zip

It contains the complete Claims example. In
viewer-json/src/main/webapp you'll find the file index.jsp, that also
refers to files under the css, lib and js directories. In the web.xml
I added a Resource servlet mapping for *.css files. The mapping for
*.js files was already there.

To get started point your browser at
http://localhost:8080/claims-viewer-json/index.jsp (for .net users:
just rename to index.html and replace <%= request.getContextPath() %>
by the relative path to the RO home page). I've only tested it with a
recent Chrome version (in fact, Firefox won't work because it doesn't
know avout console. I'll fix that in a next version).

This is a scenario that shows some features:

1. Click the "all claims" link.
2. A list with 3 claims appear. Click one of those claims.
3. At the bottom of the new view click "add item".
4. At the arguments for the action (e.g. "5", "55" and "some test
item") and click "OK".
5. Verify that the new item appears in the claim's view.
6. Remove an other item from the claim. For this drag one of the items
from the claim's view to the action view that just opened. (Dragging a
domain object title is still a bit broken: it is only visible on the
browser background, not in a view.)
7. Choose the action "submit".
8. This action asks for an employee.
9. Click the "all employees" link.
10. Drag one of the employee names from the list and drop it on the
approver placeholder.
11. Click OK and verify that the status of the claim has been updated
in the claim's view and in the "all claims" list.

If you want to try this javascript application in an other Isis
application, just copy index.jsp and the "css", "js" and "lib"
directories to xxx-viewer-json/src/main/webapp.

This is just a first basic version and there are lots of things to be
done. Most important is adding javascript tests and refactoring of
what is there now.

All feedback welcome! (Most expected reaction: it doesn't work on my
computer -> let me know)

Johan.

Re: [RO] preview javascript application

Posted by Johan Andries <jo...@gmail.com>.
On Sun, Nov 13, 2011 at 9:48 PM, Dan Haywood
<da...@haywood-associates.co.uk> wrote:
> Hi Johan,
> Thanks for this, really great work.
>
> The only snags I had was that:
> a) JSP support isn't enabled in the Isis embedded jetty server, so I had to
> build the WAR (using mvn clean install) and drop it into a Tomcat instance

The only reason this is a JSP is the line

Isis.init('<%= request.getContextPath() %>');

That way you can copy it to any xxx-viewer-json project you like
(together with the css and js files) without changing anything. You
might as well change index.jsp to index.html and replace this line by

Isis.init('/claims-viewer-json');

of that's more convenient for you.

> b) I didn't realise that drag-n-drop was working, til I realized the label
> in the "slot" had changed

Yesterday I fixed the z-index stuff with the views and the draggable.
Now the object title appears in blue (with a different mouse pointer)
as soon as you start dragging.

> c) I couldn't view drill-down into the claim items, and (because of this?)
> wasn't able to get removeItem to work.

Drilling down to the claim items is also something I added yesterday
after I uploaded the zip file. Removing an item should work:

1. Click the "removeItem" link at the bottom of the claim view ->
"removeItem" action arguments view opens.2. Drag one of the item names
from the claim view to the "claimItem" field of the action arguments
view -> red arrow on screenshot.3. Click "OK" in the action arguments
view.

Anyway, I'll upload a second version tonight (with better visual
feedback when dragging and drill-down into the claim items) so that
your demo can be more convincing.

Johan.

Re: [RO] preview javascript application

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Johan,
Thanks for this, really great work.

The only snags I had was that:
a) JSP support isn't enabled in the Isis embedded jetty server, so I had to
build the WAR (using mvn clean install) and drop it into a Tomcat instance
b) I didn't realise that drag-n-drop was working, til I realized the label
in the "slot" had changed
c) I couldn't view drill-down into the claim items, and (because of this?)
wasn't able to get removeItem to work.

Even so, it's a fantastic initial piece of work.  Looking forward to seeing
you take this forward.

... and yes, if it's ok, I will give this a quick demo on Tuesday.

Thanks again,
Dan


On 13 November 2011 09:29, Johan Andries <jo...@gmail.com> wrote:

> Hi,
>
> just uploaded a preview of the javascript application to
> http://users.telenet.be/johanenhilde/claims.zip
>
> It contains the complete Claims example. In
> viewer-json/src/main/webapp you'll find the file index.jsp, that also
> refers to files under the css, lib and js directories. In the web.xml
> I added a Resource servlet mapping for *.css files. The mapping for
> *.js files was already there.
>
> To get started point your browser at
> http://localhost:8080/claims-viewer-json/index.jsp (for .net users:
> just rename to index.html and replace <%= request.getContextPath() %>
> by the relative path to the RO home page). I've only tested it with a
> recent Chrome version (in fact, Firefox won't work because it doesn't
> know avout console. I'll fix that in a next version).
>
> This is a scenario that shows some features:
>
> 1. Click the "all claims" link.
> 2. A list with 3 claims appear. Click one of those claims.
> 3. At the bottom of the new view click "add item".
> 4. At the arguments for the action (e.g. "5", "55" and "some test
> item") and click "OK".
> 5. Verify that the new item appears in the claim's view.
> 6. Remove an other item from the claim. For this drag one of the items
> from the claim's view to the action view that just opened. (Dragging a
> domain object title is still a bit broken: it is only visible on the
> browser background, not in a view.)
> 7. Choose the action "submit".
> 8. This action asks for an employee.
> 9. Click the "all employees" link.
> 10. Drag one of the employee names from the list and drop it on the
> approver placeholder.
> 11. Click OK and verify that the status of the claim has been updated
> in the claim's view and in the "all claims" list.
>
> If you want to try this javascript application in an other Isis
> application, just copy index.jsp and the "css", "js" and "lib"
> directories to xxx-viewer-json/src/main/webapp.
>
> This is just a first basic version and there are lots of things to be
> done. Most important is adding javascript tests and refactoring of
> what is there now.
>
> All feedback welcome! (Most expected reaction: it doesn't work on my
> computer -> let me know)
>
> Johan.
>