|By Jonas Martinsson||
|May 22, 2008 07:30 AM EDT||
- In Visual Studio, create a new “RSSReader” project from the Visual C# for Java EE > ASP.NET AJAX-enabled Web application template. Grasshopper adds two new project types to Visual Studio’s New Project dialog: Visual C# for Java EE and Visual Basic for Java EE.
- Open the RSS Reader Web site in the same solution.
- Drag-and-drop all project files (except for the references) from the Website to the RSSReader project, overwriting any default items.
- Right-click the RSSReader project node in the Solution Explorer and select Convert to Web Application.
The RSS Reader uses version 22.214.171.124 of the ASP.NET RSS Toolkit. Since the download package from CodePlex does not include any Visual Studio project file, create a new .NET class library project (“RSSToolkit”) from the source code and add it to the solution. To build RSS Toolkit, you also need to add references to System.Configuration, System.Design, System.Drawing, System.Web and System.Windows.Forms to the class library project. Verify that the build succeeds and then generate a Grasshopper project from RSS Toolkit.
Grasshopper adds a new context menu item to Solution Explorer’s project nodes: Generate Java EE Project. Choosing this option for the RSSToolkit project brings up a wizard that analyzes project dependencies and suggests alternatives for unresolved references. In this case, because the RSS Toolkit doesn’t have any non-framework dependencies, the wizard does not present any options. When finished, a new project is created in your solution: RSSToolkit.JavaEE.
Now, add a reference from RSSReader to the Java-version of RSSToolkit by selecting Add Java Reference... (another new menu item added by Grasshopper, see Figure 1) and select RSSToolkit.JavaEE from the Project tab.
Remove the .NET versions of the Web site and the RSS Toolkit project from the solution because they are no longer required.
Building for Java
If you try to build the newly generated Java projects, you’ll see errors referring to classes and methods that are “not supported.” Due to the fundamental differences between the .NET and Java platforms, there are some limitations in the Java runtime libraries used to implement the .NET Framework. These limitations are responsible for the build errors above, and they are caught when Grasshopper validates the .NET code.
To build the application successfully, modify the source code to use only supported methods and classes. When targeting the Java platform, the full Java Framework is callable from Visual C# or Visual Basic code, so you always have the choice of either using supported .NET classes and methods, or using the Java Framework. If you’re looking to maintain a single source code base for targeting both platforms, use the conditional compilation directives (#if JAVA) to separate sections that are unique to .NET or Java.
In the sample application, the errors you see are due to the usage of BuildProvider, which is unsupported due to its tight coupling to System.CodeDom. Inspect the RSS Toolkit classes that are generating errors and see that they are only needed for generating RSS feeds, and not for consuming them – which is the only requirement in the RSS Reader. The pragmatic solution here is to ignore the three classes that are responsible for generating RSS when building for Java. There are two ways to accomplish this, and the choice between them is more a matter of style than anything else. You can either exclude the files from the RSSToolkit.JavaEE project, or wrap them with a preprocessor directive:
// .NET specific code goes here
You also need to wrap the code accessing these classes with the #if !JAVA directive.
Another issue to keep in mind when moving from the .NET platform to Java is that you need to use the correct case for file names, because .NET and Windows don’t distinguish between lowercase or uppercase, while Java does.
Using ASP.NET AJAX in Grasshopper
The RSS Reader also depends on the AJAX Control Toolkit, a joint project between Microsoft and the developer community. Grasshopper provides full support for the AJAX Control Toolkit (as well as the Anthem.NET AJAX Toolkit), and comes bundled with the ported source code. To reference the AJAX Control Toolkit, open the project (by default available at C:\Program Files\Mainsoft for Java EE\Samples\CS\Tomcat\AjaxControlToolkit\), build it with Grasshopper, and add the output AjaxControlToolkit.jar file to your project’s references with the Add Java Reference... option. Make sure the assembly file (AjaxControlToolkit.dll) resides in the same folder as the .jar file.
The original RSS Reader project used a preview release of ASP.NET AJAX, and as such contains the tagMapping element in Web.config for enabling the AJAX validators. These types were removed from the official release of ASP.NET AJAX. To correct the problem, simply remove the tagMapping element from Web.config.
This time, the build succeeds. Start the Grasshopper bundled Tomcat server from Start > All Programs > Mainsoft for Java EE > Start Tomcat and run the application from Visual Studio with Ctrl-F5. Voilà! Tomcat runs the Java application, which was ported from ASP.NET.
Of course, this conversion is a one-time process. Now, you can continue to develop the source code in Visual C# or Visual Basic inside Visual Studio, as you would any .NET application, taking advantage of Visual Studio’s visual designer, debugger, IntelliSense, and other development features.
Adding new AJAX functionality to the RSS Reader for Java is virtually the same process as adding AJAX controls to an ASP.NET application deployed on Windows. As an example, use the AnimationExtender to blur the feed list when the mouse cursor isn’t hovering over it.
For the AJAX AnimationExtender control to be able to access the feed list, wrap it with an ASP.NET control; <asp:panel> serves this purpose well. Drag-and-drop the AnimationExtender control to the Default.aspx page’s design surface in Visual Studio and set its TargetControlID property to the ID of the <asp:Panel>. Now, define the animations for fading the list in and out on specific events:
<FadeOut MinimumOpacity=”.2” />
<FadeIn MinimumOpacity=”.2” Duration=”.3” />
<FadeOut MinimumOpacity=”.2” />
While you’re at it, also replace the “(read more)” link to the full article text with an Ajaxy HoverMenu. Drag-and-drop the HoverMenuExtender control, also found in the AJAX Control Toolkit, to the DataList’s Item Template. Then, drop a HyperLink control there and databind the NavigateUrl property to the item’s link value:
<asp:HyperLink ID=”Popup” runat=”server”
Text=”View Original Item” NavigateUrl=’<%#
<ajaxT:HoverMenuExtender TargetControlID=”panelHeader” runat=”server”
PopupControlID=”Popup” PopupPosition=Right OffsetX=15 />
Finally, build and run the application to see that the changes work.
Deploying on Linux
So far, you have deployed the Java build target on the Grasshopper-bundled Tomcat Web application server, running locally on Windows. Now, let’s fulfill our promise to run this Web application on Linux. This is a straightforward process. First, build the Release_Java configuration of RSSReader to create a deployment-friendly WAR file.
The release configuration’s default setting enables Full Deployment Package (WAR) (a Grasshopper-specific project property) and tells the build system to generate a Web Archive (WAR) file, a compressed archive with all needed resources (HTML, JAR, images files, etc.).
Then, upload the WAR file to Tomcat on Linux via Tomcat Manager’s Web administration interface. The WAR file created in the previous step is located inside the local Tomcat’s installation directory, by default at C:\Program Files\Mainsoft for Java EE\jakarta-tomcat\webapps\.
Figure 2 shows the ASP.NET AJAX application hosted on Linux/Apache Tomcat.
This article shows you how to use ASP.NET AJAX to build applications for Linux, which is a very practical tool for multi-platform deployments. But we’re only scraping the surface of Grasshopper’s full potential to enable.NET–Java interoperability here. Unleash your creativity and use the power of Visual Studio development and the ASP.NET Framework to deploy Web applications to open source Web application servers!
|Jonas Martinsson 05/27/08 04:24:47 AM EDT|
Prasanna, you can download the project source code at http://dev.mainsoft.com/Portals/0/Downloads/RSSReader.zip
|Prasanna 05/22/08 09:22:37 AM EDT|
Liked the article "Deploying an ASP.NET AJAX RSS Reader on Linux", if you could provide the document a little more detailed with sample examples, that might have been a great value add
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
Apr. 25, 2017 06:30 AM EDT
SYS-CON Events announced today that Hitachi, the leading provider the Internet of Things and Digital Transformation, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Hitachi Data Systems, a wholly owned subsidiary of Hitachi, Ltd., offers an integrated portfolio of services and solutions that enable digital transformation through enhanced data management, governance, mobility and analytics. We help globa...
Apr. 25, 2017 06:15 AM EDT Reads: 764
SYS-CON Events announced today that CollabNet, a global leader in enterprise software development, release automation and DevOps solutions, will be a Bronze Sponsor of SYS-CON's 20th International Cloud Expo®, taking place from June 6-8, 2017, at the Javits Center in New York City, NY. CollabNet offers a broad range of solutions with the mission of helping modern organizations deliver quality software at speed. The company’s latest innovation, the DevOps Lifecycle Manager (DLM), supports Value S...
Apr. 25, 2017 05:00 AM EDT Reads: 156
The 20th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held June 6-8, 2017, at the Javits Center in New York City, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Containers, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal ...
Apr. 25, 2017 05:00 AM EDT Reads: 805
SYS-CON Events announced today that Super Micro Computer, Inc., a global leader in compute, storage and networking technologies, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Supermicro (NASDAQ: SMCI), the leading innovator in high-performance, high-efficiency server technology, is a premier provider of advanced server Building Block Solutions® for Data Center, Cloud Computing, Enterprise IT, Hadoop/...
Apr. 25, 2017 04:30 AM EDT Reads: 1,985
Amazon has gradually rolled out parts of its IoT offerings in the last year, but these are just the tip of the iceberg. In addition to optimizing their back-end AWS offerings, Amazon is laying the ground work to be a major force in IoT – especially in the connected home and office. Amazon is extending its reach by building on its dominant Cloud IoT platform, its Dash Button strategy, recently announced Replenishment Services, the Echo/Alexa voice recognition control platform, the 6-7 strategic...
Apr. 25, 2017 04:15 AM EDT Reads: 4,991
With billions of sensors deployed worldwide, the amount of machine-generated data will soon exceed what our networks can handle. But consumers and businesses will expect seamless experiences and real-time responsiveness. What does this mean for IoT devices and the infrastructure that supports them? More of the data will need to be handled at - or closer to - the devices themselves.
Apr. 25, 2017 03:45 AM EDT Reads: 193
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists will examine how DevOps helps to meet th...
Apr. 25, 2017 03:45 AM EDT Reads: 949
@GonzalezCarmen has been ranked the Number One Influencer and @ThingsExpo has been named the Number One Brand in the “M2M 2016: Top 100 Influencers and Brands” by Analytic. Onalytica analyzed tweets over the last 6 months mentioning the keywords M2M OR “Machine to Machine.” They then identified the top 100 most influential brands and individuals leading the discussion on Twitter.
Apr. 25, 2017 03:45 AM EDT Reads: 801
Judith Hurwitz is president and CEO of Hurwitz & Associates, a Needham, Mass., research and consulting firm focused on emerging technology, including big data, cognitive computing and governance. She is co-author of the book Cognitive Computing and Big Data Analytics, published in 2015. Her Cloud Expo session, "What Is the Business Imperative for Cognitive Computing?" is scheduled for Wednesday, June 8, at 8:40 a.m. In it, she puts cognitive computing into perspective with its value to the busin...
Apr. 25, 2017 03:30 AM EDT Reads: 3,562
Five years ago development was seen as a dead-end career, now it’s anything but – with an explosion in mobile and IoT initiatives increasing the demand for skilled engineers. But apart from having a ready supply of great coders, what constitutes true ‘DevOps Royalty’? It’ll be the ability to craft resilient architectures, supportability, security everywhere across the software lifecycle. In his keynote at @DevOpsSummit at 20th Cloud Expo, Jeffrey Scheaffer, GM and SVP, Continuous Delivery Busine...
Apr. 25, 2017 03:15 AM EDT Reads: 514
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Apr. 25, 2017 03:00 AM EDT Reads: 5,832
Cognitive Computing is becoming the foundation for a new generation of solutions that have the potential to transform business. Unlike traditional approaches to building solutions, a cognitive computing approach allows the data to help determine the way applications are designed. This contrasts with conventional software development that begins with defining logic based on the current way a business operates. In her session at 18th Cloud Expo, Judith S. Hurwitz, President and CEO of Hurwitz & ...
Apr. 25, 2017 02:15 AM EDT Reads: 9,036
SYS-CON Events announced today that Juniper Networks (NYSE: JNPR), an industry leader in automated, scalable and secure networks, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Juniper Networks challenges the status quo with products, solutions and services that transform the economics of networking. The company co-innovates with customers and partners to deliver automated, scalable and secure network...
Apr. 25, 2017 02:15 AM EDT Reads: 934
The explosion of new web/cloud/IoT-based applications and the data they generate are transforming our world right before our eyes. In this rush to adopt these new technologies, organizations are often ignoring fundamental questions concerning who owns the data and failing to ask for permission to conduct invasive surveillance of their customers. Organizations that are not transparent about how their systems gather data telemetry without offering shared data ownership risk product rejection, regu...
Apr. 25, 2017 01:15 AM EDT Reads: 1,311
Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the USA and Europe, we work with a variety of customers from emerging startups to Fortune 1000 companies.
Apr. 24, 2017 11:30 PM EDT Reads: 2,180
Financial Technology has become a topic of intense interest throughout the cloud developer and enterprise IT communities. Accordingly, attendees at the upcoming 20th Cloud Expo at the Javits Center in New York, June 6-8, 2017, will find fresh new content in a new track called FinTech.
Apr. 24, 2017 11:15 PM EDT Reads: 2,284
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Apr. 24, 2017 11:00 PM EDT Reads: 901
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
Apr. 24, 2017 10:45 PM EDT Reads: 1,769
The age of Digital Disruption is evolving into the next era – Digital Cohesion, an age in which applications securely self-assemble and deliver predictive services that continuously adapt to user behavior. Information from devices, sensors and applications around us will drive services seamlessly across mobile and fixed devices/infrastructure. This evolution is happening now in software defined services and secure networking. Four key drivers – Performance, Economics, Interoperability and Trust ...
Apr. 24, 2017 09:45 PM EDT Reads: 3,631