Running a GWT application (including Applets) inside an IFRAME from an ASP.NET 3.5 app? - asp.net

We are looking at integrating a full-blown GWT (Google Web Toolkit 2.0) application with an existing ASP.NET 3.5 application. My first gut reaction is that this is a horrible frankenstein idea. However, the customer has insisted that we use this application developed by a third-party.
I have almost NO CONTROL over the development of the GWT app.
My first thought is to actually attempt to embed this in an iFrame. Because GWT is running under Tomcat/Jakarta, it is hosted on a different server from the .NET app so the iFrame src will be to a URL on the other machine.
I need to utilize our own ASP.NET authorization scheme to restrict access to the embedded GWT application. The GWT app also uses embedded java applets, which don't seem to be working right now inside the iframe. The GWT app makes calls to a backend server (using GWT-RPC?).
Any major problems with this approach that anyone can see? Will GWT work on an iframe while hosted on a different machine?
NOTE: SIMPLY ADDING A DIV WITH THE SAME NAME DOES NOT WORK FOR THIS!

To expound on what Tony said, GWT can live on any page. At its lowest level, GWT hooks into a div by its ID or the body element, as its RootPanel, and adds widgets to it from there.
Simply add a div to your ASP page like <div id="gwt-root" /> and in your GWT code, start with RootPanel root = RootPanel.get("gwt-root"). Then you can start adding widgets to that panel to build the GWT portion of your page.
You'll also need to bring in your GWT generated code with a script tag, like so:
<script type="text/javascript" src="gwt-app-name/gwt-app-name.nocache.js">
Also, if you want, GWT can interact with the rest of the page using regular JavaScript using JSNI.

you do not need an IFRAME. Writeyour application so that the main panel is hosted inside a div with a specific id. If your ASP.net can provide a div with the same id, then all you have to do is include the generated JavaScript files (+ some style sheets) and your application will display inside the div.

Related

Sitecore fxm Add external website

I wanted to load angular application which generates dynamic DOM. Experience editor is loading only pre-render element and does not able to load dynamic HTML.
Is there any work around on it to load dynamic dom?
Sitecore 8 and 9 by default using the SPEAK framework for rendering the sitecore backend and Sitecore experience editor.
If you really want to use React or Angular you may want to look at Sitecore JSS.

Render HTML (response of an aspx page) in Pega User Interface

I am migrating an aspx application in to Pega which has heavy UI pages.
When I tried to render the respective HTML in the form/ user interface tab of PRPC, most of the UI controls did not render and have to do heavy Pega coding to make it work.
Are there any best practices or tools available to optimize UI design by converting aspx pages UI elements in to Pega?
I can understand out-of-the-box customized controls cannot be rendered unless there is a converter.
No, how should that be possible? PRPC runs on a Java Application Server (Tomcat, Websphere or Weblogic) and thereby executes Java / JSP code - acting as a platform. The same way you can't just reuse php snippets in your Pega application.
In PRPC one UI rule type are sections. Sections are preferably auto generated, but you can choose to put in HTML code or even JSP code instead. There you could leverage the JavaScript frameworks included in PRPC or do includes on an iFrame basis. But you can't paste there php or aspx code since it won't be executed on the php resp. aspx environment.

Insert HTML code to the page template via Sitecore CMS

I need to insert Google Tag Manager invocation code to a website powered with Sitecore CMS 6.3 – how do I do that? It it possible without the source code, recompiling and deploying the project? Is it doable at the CMS level? Thanks.
It would depend on how your site was implemented, but this is most likely not doable at the CMS level. You are supposed to put the code for the tag container immediately after the opening body tag. Most sites are not set up to insert arbitrary code at that location.
You do not necessarily need to do a recompile. You could just add the code to your main layout aspx file. However, your organization's deployment process may (and hopefully does) require that even this minor change go through the full build and deploy process.

Change tab page to iFrame

I have an old Facebook app that installs on Facebook Pages. The tab page is not being hosted in an iframe, but instead Facebook is embedding the HTML into their website (I think this is called FBML). How do I change the tab to be hosted in an iFrame like the new Apps do.
Thanks,
As of this writing, to change your tab to work as an iFrame instead of embedded HTML, you have to go to your app settings - advanced and under Migration enable Page Tab iFrames.
I beleive what you are referring to is one of the old "static FBML" applications that used to be around.
...tab page is not being hosted in an iframe, but instead Facebook is embedding the HTML into their website...
It would let you paste your FBML (Facebook Markup Language) code into a textarea in the settings of the static FBML app.
This is no longer a feasible option as Facebook has deprecated and is in the process of removing FBML.
FBML has been deprecated. Starting June 1, 2012 FBML apps will no longer work as all FBML endpoints will be removed...
What I believe you'll have to do is re-write your application utilizing the newer JavaScript/PHP SDK's (or any of the other non-official SDK's that are out there). You'll have to create a new app of your very own and then add it to your pages.

How do I embed an ASP.NET Web Site (or Web Application) into another?

I have very little experience with ASP.NET and I am doing some self-training before I start writing my first web site/application, which will be a calibration utility. How that utility works is not my concern right now. However, the utility eventually needs to end up embedded in someone else's web site, either just as a URL to the page with my code, or embedded (say, as an HTML frame or an iframe). To figure out the basics of this, I coded up two very simple ASP.NET web sites, a "parent" which contains the frameset, and a "child" which I am trying to put into one of the frames.
The parent's "Default.aspx" HTML code is basically this:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Parent Site Test 1</title>
</head>
<frameset cols="300,*">
<frame name="outer" src="parent.aspx" noresize></frame>
<frame name="inner" src="[what do I put here?]"</frame>
</frameset>
</html>
The "parent.aspx" page has only the most basic HTML in it:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
I am the parent web form.
</div>
</form>
</body>
</html>
The child web site (as I have it now) lives in a separate VS2008 solution, for the purposes of this exercise, because I am trying to reproduce the conditions in which someone else's web site has to reference my calibration web page/site/thing. I was originally thinking there would be some way to package the entire child into a single DLL, and then there would be some way to tell the parent to use that DLL as the source for the child frame. This comes from my experience in the Java world - using JBoss and J2EE, this would be easily solved because the child would just be deployed as another EAR file.
Being completely inexperienced with VS2008 and ASP.NET, I spent quite a few hours on Google over the past few days trying to find an answer, to no avail.
Is what I'm trying to do reasonable; is it the right way to think about solving the problem?
Can I deploy the child as a fairly independent and self-contained web site (or web application... I'm still unclear on the differences) by somehow packaging it into a single DLL? If yes, then how do I actually create this DLL from my web site/application in VS2008, and how do I then reference it in the parent web site?
If I am totally off track here, how can I create this parent/child combination in some other way? The child (really, the calibration utility I will eventually write) does need to be in ASP.NET (with C#) but I don't have any control over the parent site, since it's someone else's code, and they just want to be able to drop in my utility.
Thanks for the help! The more specific you can be, the better. I am very new to ASP.NET and Visual Studio, though I do have plenty of experience programming in other languages and IDEs.
If you know the client also uses ASP.Net, you could build it as a User Control.
If you have IIS6 or higher, you can run both of the web applications and in your src="[what goes here]" you put the local URL of the child website (maybe http://localhost/ChildTestWebsite/child.aspx). Then when you load up http://localhost/ParentTestWebsite/Default.aspx you should see the frames.
To package it into a single DLL, I believe you have to make it just a user control like Joel said, otherwise you have the DLL + aspx pages.
What you should do depends on how the interaction between the parent and child is.
If the parent is not going to access any server-side functionality on the child, you can just reference to the absolute http path in the src on the frame tag. You might get security issues in some browsers if you try to access javascript methods and the 2 apps are on diferent web servers, but this is not .NET specific.
If the parent is going to access server side functionality, you need to provide the server side components somewhere in the parent project. This is more complex. I think you have to build all child pages as web controls that is included in a parent aspx page.
1: Build the child project as a webcontrol library of server controls that can be used by the parent. This is best approach conserning deployment. Everything is built into one single dll. The biggest disadvantage to this, is that server controls can only be developed in code. You have no visual designer to help you.
2: Create a Web Application project. In VS2008 you do this by "New Project" and then find the "ASP.NET Web Application" template. This means a web project where all code behind (everything inside the cs files) is build into a single dll. In this scenario, you create user controls (ascx files) that can be used by the parent page. The disanvantage of this is that user controls must be loacted on the runnin web app, so you must copy all ascx files to the deployed location of the parent web site. The dll must also be copied to a bin folder in the parent web site. Here you have the advantage that it is much simpler to design the GUI in VisualStudio. Designing the gui and code behind for ascx user controls are very similar to creating full aspx web pages.

Resources