Screencast 1 – Exposing Twitter Data with ADF in Oracle WebCenter

In our first episode of the Enterprise 2.0 Workbench, we walk through using ADF to consume and display XML from Twitter. From the ADF application we then create a portlet entry that allows our application to be produced as WSRP2 and consumed by WebCenter. This approach will work for any XML, even without an XSD file – as we will learn how to generate our own XSD from any XML.

Download Sample Source

Development Steps
  1. Open Twitter and find an account that you would like to follow
  2. View the RSS feed for that account and save it to a location on your local disk
  3. Open JDeveloper
  4. Create a new application called “Twitter Fusion” using the Application Template “Fusion Web Application (ADF)”
  5. Navigate to “Application” -> “Project Properties” -> “Java EE Application” and update “Java EE Web Application Name” and “Java EE Web Context Root” to “twitter”
  6. Add “WebCenter Portlet Creation Service” to the view project
  7. Create folder in “Web Content” called “xsd”, this will house the XSD file that let’s JDeveloper understand the content coming from Twitter
  8. Within the XSD folder create a new file “XML Schema from XML Document”, name this file twitter.xsd, browse to the XML document that you saved from Twitter’s RSS feed
  9. Within the “Web Content” folder create a new JSF page, name it twitter.jspx
  10. Run the JSF page and note the URL (http://x.x.x.x:7101/twitter/faces/xsd/twitter.xsd)
  11. Using the path copy the URL to the XSD file
  12. In the Model project create a new URL Data Control using the RSS feed as the URL and the URL to the XSD that was just created
  13. Drill into the newly created Data Control DC_URL -> loadData() -> Return -> rss -> channel -> item and drag and drop the item node into the JSF page
  14. On the ADF page select Table -> ADF Read-only Table from the options list
  15. Enable “Row Selection” and “Sorting”, remove description, guid and source
  16. Navigate to the “af:table” node in Structure pane in JDeveloper and select “af:table”
  17. In the Property Inspector pane under Apperance -> ColumnStretching select Last
  18. On the JSF page click and drag the Title column to the far right of the page
  19. Right click the JSF page and select Run to review the page
  20. In JDeveloper right click twitter.jspx and select “Create Portlet Entry”. Enter TwitterFusion in the first 4 fields and enter a description/
  21. Right click twitter.jspx and select Run
  22. In your browser adjust the URL to expose the WSDL for the WSRP entry for the new portlet – use the WSRP2 entry (http://x.x.x.x:7101/twitter/portlets/wsrp2?WSDL)
  23. Open the Enterprise Manager instance for WebCenter
  24. Navigate to the Register Producer section of Enterprise Manager and enter the WSRP2 URL from the WSDL displayed in your browser previously. Call the new entry Twitter Fusion
  25. Open your WebCenter instance, navigate to a page and open composer. Select Portlets -> Twitter Fusioon -> and TwitterFusion to add the Twitter portlet to your page.
1 Comments
  • Ksandhya
    Reply
    July 14, 2014

    Hi John, is there a way to get only the “Tweets” part and display it on the jsff page? Thanks.

Leave a comment