XSLFOApp_Controller
// --------------------------------------------------------------------------- // This file has been generated partially by the Web Dynpro Code Generator. // MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end. // ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED. // --------------------------------------------------------------------------- package com.cmc; // // IMPORTANT NOTE: // _ALL_ IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED // BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN // AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateFopTest). // OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY // A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS // OF IMPORT STATEMENTS. // //@@begin imports import com.cmc.wdp.IPrivateFopTest; import com.cmc.wdp.IPublicFopTest.IMaterialsElement; //@@end //@@begin documentation //@@end public class FopTest { /** * Logging location. */ private static final com.sap.tc.logging.Location logger = com.sap.tc.logging.Location.getLocation(FopTest.class); static { //@@begin id String id = "$Id$"; //@@end com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id); } /** * Private access to the generated Web Dynpro counterpart * for this controller class. </p> * * Use <code>wdThis</code> to gain typed access to the context, * to trigger navigation via outbound plugs, to get and enable/disable * actions, fire declared events, and access used controllers and/or * component usages. * * @see com.cmc.wdp.IPrivateFopTest for more details */ private final IPrivateFopTest wdThis; /** * Root node of this controller's context. </p> * * Provides typed access not only to the elements of the root node * but also to all nodes in the context (methods node<i>XYZ</i>()) * and their currently selected element (methods current<i>XYZ</i>Element()). * It also facilitates the creation of new elements for all nodes * (methods create<i>XYZ</i>Element()). </p> * * @see com.cmc.wdp.IPrivateFopTest.IContextNode for more details. */ private final IPrivateFopTest.IContextNode wdContext; /** * A shortcut for <code>wdThis.wdGetAPI()</code>. </p> * * Represents the generic API of the generic Web Dynpro counterpart * for this controller. </p> */ private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdControllerAPI; /** * A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p> * * Represents the generic API of the Web Dynpro component this controller * belongs to. Can be used to access the message manager, the window manager, * to add/remove event handlers and so on. </p> */ private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI; public FopTest(IPrivateFopTest wdThis) { this.wdThis = wdThis; this.wdContext = wdThis.wdGetContext(); this.wdControllerAPI = wdThis.wdGetAPI(); this.wdComponentAPI = wdThis.wdGetAPI().getComponent(); } //@@begin javadoc:wdDoInit() /** Hook method called to initialize controller. */ //@@end public void wdDoInit() { //@@begin wdDoInit() /* put some values into the node. */ for (int i = 0; i < productData.length; i++) { IMaterialsElement element = wdContext.createMaterialsElement(); element.setId(productData[i][0]); element.setName(productData[i][1]); element.setDescription(productData[i][2]); element.setQtyinstock(productData[i][3]); element.setProducturl(productData[i][4]); element.setImgurl(productData[i][5]); wdContext.nodeMaterials().addElement(element); } //@@end } //@@begin javadoc:wdDoExit() /** Hook method called to clean up controller. */ //@@end public void wdDoExit() { //@@begin wdDoExit() //@@end } //@@begin javadoc:wdDoPostProcessing() /** * Hook called to handle data retrieval errors before rendering. * * After doModifyView(), the Web Dynpro Framework gets all context data needed * for rendering by validating the contexts (which in turn calls the supply * functions and supplying relation roles). In this hook, the application * should handle the errors which occurred during validation of the contexts. * * Using preorder depth-first traversal, this hook is called for all component * controllers starting with the current root component. * * Permitted operations: * - Flushing model queue * - Creating messages * - Reading context and model data * * Forbidden operations: * - Invalidating model data * - Manipulating the context * - Firing outbound plugs * - Creating components * - ... * * @param isCurrentRoot true if this is the root of the current request */ //@@end public void wdDoPostProcessing(boolean isCurrentRoot) { //@@begin wdDoPostProcessing() //@@end } //@@begin javadoc:wdDoBeforeNavigation() /** * Hook before the navigation phase starts. * * This hook allows you to flush the model queue and handle any * errors that occur. Firing outbound plugs is allowed in this hook. * * Using preorder depth-first traversal, this hook is called for all component * controllers starting with the current root component. * * @param isCurrentRoot true if this is the root of the current request */ //@@end public void wdDoBeforeNavigation(boolean isCurrentRoot) { //@@begin wdDoBeforeNavigation() //@@end } //@@begin javadoc:wdDoApplicationStateChange() /** * Hook that informs the application about a state change. * <p> * This hook is called e.g. to tell the application that will be * <ul> * <li>left via a suspend plug and therefore should go into a suspend/sleep * mode with minimal need of resources. errors that occur. Firing * outbound plugs is allowed in this hook. * <li>left due to a timeout and could write it's state to a data base if the * user comes back later on * </ul> * * The concrete reason is available via IWDApplicationStateChangeInfo * <p> * <b>Important</b>: This hook is called for the top level component only! * * @param stateChangeInfo contains the information about the nature of the state change * @param stateChangeReturn allows the application to ask for a different state change. * The framework is allowed to ignore it considering i.e. the current resources situation. */ //@@end public void wdDoApplicationStateChange(com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeInfo stateChangeInfo, com.sap.tc.webdynpro.progmodel.api.IWDApplicationStateChangeReturn stateChangeReturn) { //@@begin wdDoApplicationStateChange() //@@end } /* * The following code section can be used for any Java code that is * not to be visible to other controllers/views or that contains constructs * currently not supported directly by Web Dynpro (such as inner classes or * member variables etc.). </p> * * Note: The content of this section is in no way managed/controlled * by the Web Dynpro Designtime or the Web Dynpro Runtime. */ //@@begin others private static final String productData[][] = { { "1", "EM406A", "GPS Chip", "10", "http://www.usglobalsat.com/p-46-em-406a-sirf-iii.aspx", "http://www.usglobalsat.com/images/PRODUCT/medium/46.jpg" }, { "2", "Diecimilia", "Arduino Diecimilia", "5", "http://www.arduino.cc", "http://arduino.cc/en/uploads/Main/arduino316.jpg" }, { "3", "Duemilanove", "Arduino Duemilanove", "100", "http://www.arduino.cc", "http://arduino.cc/en/uploads/Main/ArduinoDuemilanove.jpg" }, { "4", "NG", "Arduino NG", "1", "http://www.arduino.cc", "http://arduino.cc/en/uploads/Main/ArduinoDuemilanove.jpg" }, { "5", "Hitachi8888", "8 bit 2 line LCD Display", "56", "http://www.blah.com", "http://www.blah.com/img/Hitachi8888.jpg" } }; //@@end }
page revision: 2, last edited: 12 Mar 2009 18:55