best way to embed LIGHTWEIGHT GWT 'widgets' into websites - gwt

I know this is similar to other topics, but I've not yet found a satisfactory answer.
I have a GWT / GAEJ application that essentially allows users to interact with the web app as if it were a desktop app. i.e. they login, and use the application in full-html mode (i.e. the GWT app occupies the entire html page). They are typically power users and so don't mind a few seconds dowload / login time when starting to use the app. Typically they might stay logged in for several hours.
I would also like to make available some small subsets of functionality, pointing to the same Back end, as widgets to be included in OTHER existing websites. I know one of the features of GWT is that you can either embed your GWT into existing html pages or go full page.
My question is how do I partition the GWT components into small tidy parcels so that only the relevant bits are downloaded for these embedded 'widgets' whist not having to duplicate my backend code. (for example I could create a new GWT project write only my small widget and copy the server side code - but I really don't want to do this!) Each widget still needs to interact with the same backend so none of them will be stand alone GWT. Communication is GWT-RPC.
anyone done this?

Seems like you want to split your GWT stuff into multiple GWT modules that you want to later combine in possibly more than one project. One way is having a multi-module maven setup (gwt-maven-plugin), there's no need to copy/paste code.

Related

A/B Test a Page Step in a Single Page without a new URL

I am trying to figure out how to run an A/B Test for a change on a Page Step for a Single Page. The idea is we have a payment flow with several page steps each containing a form. We'd like to swap out forms and test how our users react. We are trying to avoid changing the URL.
I looked into tools such as Google Analytics, but that requires a different URL to run the A/B test. The hesitation about creating a new URL is because our users are known to bookmark them, and we don't want to keep a backlog of redirects from invalid URLs, also we'd like to avoid constantly deploying new URLs for our tests.
I cannot seem to find any tool to do this, so I've tried to think of a few solutions but I'm not having a lot of luck.
My best idea is to build both a and b forms into the page, and when a user accesses the flow, the session randomly(based on a preset%) stores a value that dictates whether the user is in test a or b. Then when they step into that form, the server will serve the proper form to them. If they abandon their session, we'd track that, and if they complete the action, we'd track that.
I feel like there should be a better solution, but I just cannot come up with one.
My results online were either blogs showing how to approach it from a high level, and all of them used different URLs, I have found almost no developer resources.
Thanks.
We're using ExtJS 4.2.2, and .NET as our server.
Whenever you need the server to be involved, you need server-side instrumentation. No free tools offer that, but you could consider Optimizely "full-stack" (has support for C#) or Variant (does not yet).

.NET CMS to manage copy changes

We have web application that renders dynamic content. We want to manage our content copy changes via separate managed system where developer does not get involved in writing copy and just leave place holder and later on copy writer adds copy.
Per my knowledge, any CMS takes control most of front end and leaves developer to just do design and layout level control.
I am looking for some CMS that does not take control page structure but instead it runs as a thin layer before page rendering and replace the place holders with content.
To give an example, https://localizejs.com/ simply do localization with a JS on client, I can use that but I guess SEO will an issue since content is replaced with Javascript which most search engine won't execute.
I think what you are looking for is called a headless CMS. That means it is a back-end interface for users to manage their content, but there is no front-end to render it - just APIs to access the content. You can call those APIs from your application.
A few examples I've used or looked at in the past:
Directus
Blackstar
There's also a lot of momentum around using Drupal as a headless CMS.

Symfony design question - how can I share forms between apps?

I'm developing a site in Symfony, and I'm not sure what the best way is to handle this scenario.
I'm creating a party bookings system. Anyone can go to my frontend app and submit a new booking. Once they're finished, they'll just get a confirmation screen, they can't edit it. Easy.
Only certain users will be able to get to the admin app (it might be secured simply by being on an intranet, but that's not important, just assume it will be only accessible by admin users). They'll be able to view the list of submitted bookings. Easy.
My problem is around code re-use when allowing admin users to edit existing bookings. When you do generate-module in Symfony, the generated module (which as a newbie I'm assuming is a good example of structuring things) creates the form as a partial. I've had to customize this form a lot for my usage (lots of Javascript, etc), so of course I want to re-use this code, to be able to load an existing booking into this form. But there doesn't seem to be a way to share this partial between the apps (I've seen people mention making a plugin...but this seems complicated for this use).
I considered using an IFrame to load the form from the frontend and just passing an "id" parameter to load it in edit mode, but this would mean that the edit mode is not secure - anyone could go to the form on the frontend and pass this parameter to edit a booking.
I also considered putting all of the form display code (HTML, Javascript, etc) in a method on the form object, but this doesn't seem very MVC - all of the display code is then in the form. But this is only because I'm thinking of the form in the same way as a model - is that right?
I feel like this should be a common situation. You can share models and forms between apps, why can't you share this common form display code too?
Thanks!
You should reconsider having 2 applications in the first place. Not only you run into the code reuse problem, but also i18n, testings and other issues. I find it much easier to have 1 application with different bunch of modules for frontend and backend users. You can configure security per module. You can have one sign in form for all users and redirect them to appropriate module based on their credentials.
You can reuse partials between modules inside the same application, but you seem to be talking about two different applications (frontend and backend) so as far as i know the only way is to copy & paste the partial from one application to the other...

Facebook Application Design Question

Iam coding a dating application for facebook. The application has to have a standalone web application part and a Iframe based part which runs inside facebook canvas.
I want to know good ways to design the application. Iam using zend framework, so here is my idea.
One approach that am planning to use is this -
The application folder to contain 2 controllers, index controller being the entry point of the standalone web application and another controller- FacebookController to be the entry point of the Iframe being run inside facebook canvas. Both of them calling the same view files which get written based on which controller is writing to them.
The second approach is to have one single controller as the entry point and use 2 layout files. One for the standalone web application and one for the facebook canvas app.
The reason for choosing these approaches in that the authentication mechanism of the two applications is different.
To get an idea, have a look at www.areyouinterested.com, Iam planning to do something similar to what they have done.
Please suggest me what would be the best way to go around this.
Your first choice is best.
Two Controllers. Two layouts. Common views.
This gives you flexibility to change around a lot of one or the other without breaking the opposite one.
If you feel ambitions, I would even go with two modules. If your application is structured well enough each module will have common components that are re-usable.

Wordpress custom pages CMS

I'm considering Wordpress as my CMS platform for a client site I'm doing at the moment.
However, I need to create a couple of custom 'modules'. One of these modules is a form that people will be able to complete and have a quote, and once submitted, in a special place in the Wordpress panel (like a menu or something), there will be a listing of all the submitted quotes (just fetching it from a table in my database).
Another one is to manage a cafeteria menu, so the client can add a different meal to each day of the week.
I know perfectly how to do this kind of things using some kind of MVC framework and doing it 'by-hand', but I'm just wondering if this would be possible to do with WP and if yes, what kind of tools I'll have to use.
Thanks
Quite simply, yes, WordPress would be a more-than-capable asset to your criteria. But it's whether the learning curve in getting to know WP outweighs using a framework you're clearly already familiar with?
Personally, it sounds you like you're pretty solid with PHP, and considering the fact that, in my opinion, what you're planning on doing is relatively easy, I'd say WordPress is an excellent solution.
I'd recommend reading about WordPress 3.0's new custom post type API, and skimming the basics of hooks and filters in the Plugin API.
Submitted quotes would merely be a custom post type. You'd be better off writing the front-end code (like handling the form, UI etc.) yourself, either within a theme or plugin, then using wp_insert_post and let WordPress handle all the database administration. In fact, WP will go one step further and set up the entire admin for viewing, editing and deleting quotes.
Post meta (also known as custom fields) is also there for you if you need to store additional information about a quote that doesn't quite fit the post's table structure.
For the menu, this is even easier. I'd say just create a post category called 'Menu', and the client can publish 'dishes' to it as you would with a blog or any similar rolling format.
I've only licked the surface here. Get stuck in with the above, then check out some other goodies like meta boxes and custom taxonomies!
If you want to try a plugin instead of writing something yourself, Flutter might work. It's a little unpolished sometimes but it makes this sort of thing an absolute breeze.