0

Saas

asked 2008-07-25 22:03:34 +0800

Phileas gravatar image Phileas
171 3

Would you think ZK adapted to achieve the following thing : Let's says you have your web site "A" which you created with ZK and that's fine. Now, you also want to offer applications with a software as a service approach from this website. So let's say you propose 3 services named here "A1", "A2" and "A3". To have an idea of these services and to keep things simple, let's say A1 = a forum, A2 = a Pet Shop, A3 = a wysiwyg wiki using fckeditor. We also suppose that some of these applications make use of great libraries like ExtJS to offer rich gui components.

On the other side, you have potential clients who may be interested into some of these applications or all of them. Let's take one of these clients we name here "B". B has his own web site which delivers simple content but unhappily, he does not have any added value in terms of application he wants to offer to his team members or community members. B web site is built with php and we will consider the B server can run only php code.

As "A" would like to have "B" among its customers, "A" develops a php specific piece of code (let's name it "local code") which role is to encapsulte the applications A1, A2 and A3 into some pages of the B web site. So, when a team member of B will navigate on the web site B and click on the forum link for example, "local code" installed on the B server will contact the web site "A" for asking the application service A1 which delivers back the page visual structure and related content. Of course, when the user navigate through the forum, each of his interactions will be taken into account by "local code" which comes again into action with server A and the A1 application. So, "local code" allow to offer B members the A1 application on the B server as a portion of the page.

"Local code" may have local resources like images and js librairies, this allowing B to custom some things in terms of appearance (and save bandwith and performance as images won't be delivered by server A). If B want to custom some layout, he would have to modify some templates (stored on the A server) dedicated to the B web site.

Can ZK be appropriate to such a situation without diving into weird things (this happens when we try to achieve a goal with a product not adapted to) ?
Hoping to have been clear with these explanations i tried to make brief :)

delete flag offensive retag edit

13 Replies

Sort by ยป oldest newest

answered 2008-07-29 08:57:39 +0800

robbiecheng gravatar image robbiecheng
1144 2
http://robbiecheng.sys-co...

There are two solutions, one is iframe, simply including the page from A site into B site directly.
The other is portlet, a way to integrate web services together. ZK is compliant to JSR168, so you can choose your preferred Portal Server to integrate services from A site into B site.

/robbie

link publish delete flag offensive edit

answered 2008-07-29 18:26:50 +0800

Phileas gravatar image Phileas
171 3

Thanks Robbie for these informations. In fact, in my example, i were searching a solution turning around some kind of a proxy, maybe not a good idea but i don't see any other better adapted logic for the following reasons :
While iframe is an idea, that also means that users on web site B won't be able to (bookmark anymore and also brings problems in terms of integration), which is a problem in case the application offered as a service is a forum or a wiki for example.
Regarding portlets, except if i miss something that would mean that the portal server would be on server A while the solution to be found is on server B, but whatever, while things are clearly established as a standard on the java side, i don't know any resources regarding others "platforms" like php, ruby, python and so on. And finally, even if we have portal resources whatever the language and when the purpose is to have a lot of B customers, that would be a problem to ask all of them to change their infrasttructure and adopt portal approach which by the way would prevent them from choosing others software there are interested in if they are not portal compliant.

link publish delete flag offensive edit

answered 2008-07-29 18:31:33 +0800

Phileas gravatar image Phileas
171 3

updated 2008-07-29 19:35:54 +0800

EDIT :

To be clear, among the requirements i see and look a solution for, there would be that a ZK application could act as a service application in some circonstances and behave something like this :
- "local code" (on B server as explained) would ask (through web services) ZK the service application which would send back the whole code without header and footer for example.
- Around the proxy idea, ajax and comet calls, links and submission of information have to be taken into account so that "local code" on server B would be the intermediate between a user and ZK on A server by submitting it these links, ajax and comet calls and submission of informations and retrieving back the results.

In the real world, i have first to develop some ZK applications in a traditional way and then add them this saas approach. At the end that means a single ZK application can delivers traditional web pages but also can on demand delivers and respond as a saas application. The question is : Would Potix be commercialy interested and technically able to customize ZK to achieve this goal ?

link publish delete flag offensive edit

answered 2008-08-03 01:27:58 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2008-08-03 01:29:07 +0800

It sounds interesting. I'd like to dig it further.

Proxy might be the right approach. There are basically two levels of proxy: proxying another ZK application and proxying non-ZK application (ruby, php...). Proxying ZK applications could be a good starting point, though comet might be a challenge.

On the other hand, proxying non-ZK application is not easy. First, we have to proxy the form submit, hyperlink and so on. If it uses some kind of Ajax technology, it is more complicated (Ajax is embedded in JavaScript which is not easy to intercept).

link publish delete flag offensive edit

answered 2008-08-03 18:38:53 +0800

Phileas gravatar image Phileas
171 3

updated 2008-08-03 19:17:20 +0800

Yes, i know this is a challenge to say the less... Do you think about others solutions when you say "Proxy might be the right approach" ? that may suggests that you have others ideas. Do you simply think the approach impossible regarding your arguments ? or even if it's not impossible, it will simply bring too many problems to keep this approach as a reasonable orientation ?

As i'm still thinking about all of this, maybe another frontend technology would be less problematic. Without being easy (diving into such an idea can't be easy) but i feel proxing Flex applications would be more adapted by using, for example, weborb on each server. That would preserves RIA experience (including comet and excluding javascript nightmares) and, in a away, simplifies developement as we would use flash from the start to the end (ok, yes a little of php or ruby or whatever but nothing essential or problematic). The main drawback of this second approach is that, to be ready to start, i don't know any equivalent in Flex of something like, let's say Ext JS (even if Flex is supposed to bring a higher level of gui experience). Of course, second problem would be that, contrary to the first solution, a single ZK application could not serve the two approachs. There would be the traditional ZK app and the ZK app adapted for flash but at least we won't have to develop again 100% of the things.

Is this second modified approach could be taken into account by Potix into ZK regarding the interests taken for Flash ? I mean a kind of ZK Flex (or even optionnaly ZK AIR:) ) which would simplify as much as possible :
- the Flex version of a traditional ZK app
- the proxy approach

link publish delete flag offensive edit

answered 2008-08-04 00:27:31 +0800

Phileas gravatar image Phileas
171 3

Well, change of thinking is needed as well as coming back to more simple things. So, let's forget the proxy idea and also extreme approachs like doing Flex app only for the reason i exposed.

I feeled that the most smooth approach would have been to have an ajax or flash invisible component (or even a pagebus) on B server that would ask (through web services) ZK the service application which would send back the whole code without header and footer for example (so this component would replace in most ways the proxy we talked about). But in fact, it's not an excellent approach for several reasons and the simple one is that B servers can use some applications bringing their ajax libraries that may conflict with the ones of ZK (Ext JS to name one). So, while i'm not a fan of frame, the iframe may be finally the solution. Now, we have to deal with some things but the obvious one is the famous bookmark problem. Long time ago, i were amazed to see a backbase demo where they managed to change the url without reloading page. This feature is needed because if we want being able to bookmark a B page including the iframe displaying itself the right page or application state later on, changing the url is a requirement. We would have to use some parameters in this url that will bring back in the iframe the right application but also the application state. So, the question being how Backbase did that, i suppose they follow this kind of informations : http://ajaxpatterns.org/Unique_URLs
By the way swfadress may also be of some interests http://www.asual.com/swfaddress/. Just the point where i 'm now, i now check these informations to identify potential problems. Do you see some ?

link publish delete flag offensive edit

answered 2008-08-06 05:32:16 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

You answered all most all questions:)

Proxy is not as straightforward as I thought. URL rewriting, JavaScript versioning and CSS conflicts are what we have to deal with. URL rewriting might be able to be handled with Encodes.URLEncoder (zweb), but JavaScript versioning is not easy. A1 and A2 might use different version of ZK and have their own private components (or customizing standard components).

So I agree iframe will be the most clean solution. Regarding bookmarking, what we missed as far as I can see is a way to notify the container that iframe's bookmark and/or URL is changed. Such kind of enhancement shall be straightforward.

link publish delete flag offensive edit

answered 2008-08-06 06:53:09 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

I posted the request here

link publish delete flag offensive edit

answered 2008-08-06 19:50:44 +0800

Phileas gravatar image Phileas
171 3

Thanks Tom for following the story :) and by taken it into account as a request.
To see if i well understand, do you mean the ZK client engine, in case it detects the zk app is in an iframe, will directly deals with the parent url and change it in a way so that later on the corresponding bookmark will call the parent page including the iframe, the application inside and its application state ? That would be too beautiful if ZK could do almost all the job for us in that particulary case. Did i well understand ? Do you plan to include this in 3.5 release (it seems you target it for this release on your sourceforge request) ?

In case you implement it and the way you will do it, i wonder what would happen if you have more than one iframe :) It would not be so stupid to imagine by taking an example : in that way, you would be able to inject into B site an "environment" that would clone facebook for example. So instead of bringing a social networking web site in this example, you bring social networking "aspects" to existing web sites. In a way, that allows B customer to choose among a "palette of social network components".

link publish delete flag offensive edit

answered 2008-08-07 04:54:32 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

updated 2008-08-18 02:23:48 +0800

It is similar but takes ZK approach:) That said, ZK notifies what happens, but does not assume what action to take. The application has to implement the action(s) (which usually depends on application requirements). And, ZK provides utilities to simplify the implementation of the action.

If the iframe container is implemented with ZK, then what you need to do is to listen the onURIChange event. If you want to use bookmark, you can do as follows. Of course, you could take other actions if you like.

<iframe onURIChange="desktop.setBookmark(do_something_to_store(event.getURI()))"
 src="${do_something_to_retrieve_correct_URI(desktop.bookmark)}"/>

So what you need to do is a mapping of bookmark (of the container page) and the iframe's URI. Again, it depends on application requirements.

If the iframe container is implemented in other technology (PHP or whatever), you have to provide a JavaScript method as follows:

function onIframeURLChange(uuid, url) {
  change_bookmark_based_on_the_technology_you_use();
}

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-07-25 22:03:34 +0800

Seen: 480 times

Last updated: Oct 01 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More