What's the best practice to get App Module on Jdev 10.1.3 using Struts/ADF?

Hi,
I read Mr. Muench's post stating that the best way to execute an App. Module method is to make the method part of the client interface and then drag and drop it on a form as a button ...
In another post Muench says that a another way to get the App Module is using getDataProvider() method, I tried and found that this worked in:
// standard event handler interface
// on PageController class
public class MyFormPageController extends PageController
public void onUpdate(PageLifecycleContext ctx)
AMServImp am;
am = (AMServImpl)ctx.getBindingContext().getDefaultDataControl().getDataProvider();
am.myMethod( ... );
am.getTransaction().commit();
I really like the second option because is closer to what I used to do in 10.1.2 with an event handler receiving DataActionContex parameter. Besides, is not clear to me in the former method with the drag and drop how the form inputs are assigned to the method parameters ....
I would like to know however what is the best way and why ?
Any comments ?
-OM
Message was edited by:
omar71

According to JSR 227, which ADFm is implementing, the view/controller portions of your application aren't really supposed to be touching the business services, or even the data controls, at all. They're supposed to do all model manipulation entirely through the databindings.
This is just another bit of "code separation"--much like MVC code separation--that should make the application a bit easier to maintain. Your application module could change dramatically--maybe even be replaced by an EJB session bean--and all you have to do is change the .dcx file and your page model files, rather than searching through your code. Maintainability and readability is the advantage here; I don't think there could possibly be any slowdown by calling ctx.getBindingContext().getDefaultDataControl().getDataProvider(), since that's what the bindings would do anyway.
Well, of course there's the "ADF supports going this way declaratively", which is not to be sneezed at as an advantage.
As to how to put the form values in to the method binding: Look up the <af:setActionListener> tag (e.g., using full-text search in the help). You can nest that into your commandButton or commandLink tags and use it to set method parameters.
Best,
Avrom

Similar Messages

  • What is the best practice to get thumbnail of photo which I get from cameraUI

    Hi,
    I building a photo sharing application in android and I want to upload a smaller size of photo just after I receive the photo from the cameraUI.
    What is the best practice to resize the photo and to upload it, At the moment I doesn't resize it And the file size is big (1MB) for HTC DESIRE HD ?
    Is it possible to resize the image and keep the EXIF data ?
    Thanks,
    Nimrod.

    Yep,
    Media Manager is the way to go.
    Read the manual aout it.
    It is all explained in there.
    Rienk

  • What is the best practice to get database connection?

    What are best best practices in database connection to follow?

    &#24335; &#21487; &#20197; &#37319; &#29992;Class.forName &#26041; &#27861; &#26174; &#31034; &#21152; &#36733;&#65292; &#22914; &#19979; &#38754; &#30340; &#35821; &#21477; &#21152; &#36733;Sun &#20844; &#21496; &#30340;JDBC-ODBCbridge &#39537; &#21160; &#31243; &#24207;&#65306;
    Class.forName&#65288;�sun.jdbc.odbc.JdbcOdbcDriver�)&#65307;
    &#28982; &#21518; &#36816; &#29992;DriverManager &#31867; &#30340;getConnection &#26041; &#27861; &#24314; &#31435; &#19982; &#25968; &#25454; &#28304; &#30340; &#36830; &#25509;&#65306;
    Connectioncon=DrivenManagerget-
    Connection(url);
    &#35813; &#35821; &#21477; &#19982;url &#23545; &#35937; &#25351; &#23450; &#30340; &#25968; &#25454; &#28304; &#24314; &#31435; &#36830; &#25509;&#12290; &#33509; &#36830; &#25509; &#25104; &#21151;&#65292; &#21017; &#36820; &#22238; &#19968; &#20010;Connection &#31867; &#30340; &#23545; &#35937;con&#12290; &#20197; &#21518; &#23545; &#36825; &#20010; &#25968; &#25454; &#28304; &#30340; &#25805; &#20316; &#37117; &#26159; &#22522; &#20110;con &#23545; &#35937; &#30340;&#12290;
    &#25191; &#34892; &#26597; &#35810; &#35821; &#21477;&#12290; &#26412; &#25991; &#20171; &#32461; &#22522; &#20110;Statement &#23545; &#35937; &#30340; &#26597; &#35810; &#26041; &#27861;&#12290; &#25191; &#34892;SQL &#26597; &#35810; &#35821; &#21477; &#38656; &#35201; &#20808; &#24314; &#31435; &#19968; &#20010;Statement &#23545; &#35937;&#12290; &#19979; &#38754; &#30340; &#35821; &#21477; &#24314; &#31435; &#21517; &#20026;guo &#30340;Statement &#23545; &#35937;&#65306;
    Statement guo=con.creatStatement()&#65307;
    &#22312;Statement &#23545; &#35937; &#19978;&#65292; &#21487; &#20197; &#20351; &#29992;execQuery &#26041; &#27861; &#25191; &#34892; &#26597; &#35810; &#35821; &#21477;&#12290;execQuery &#30340; &#21442; &#25968; &#26159; &#19968; &#20010;String &#23545; &#35937;&#65292; &#21363; &#19968; &#20010;SQL &#30340;Select &#35821; &#21477;&#12290; &#23427; &#30340; &#36820; &#22238; &#20540; &#26159; &#19968; &#20010;ResultSet &#31867; &#30340; &#23545; &#35937;&#12290;
    ResultSet result=guo.execQuery(�SELECT*FROM A�)
    &#35813; &#35821; &#21477; &#23558; &#22312;result &#20013; &#36820; &#22238;A &#20013; &#30340; &#25152; &#26377; &#34892;&#12290;
    &#23545;Result &#23545; &#35937; &#36827; &#34892;&#65288; &#19979; &#36716;76 &#39029;&#65289;( &#19978; &#25509;73 &#39029;&#65289; &#22788; &#29702; &#21518;&#65292; &#25165; &#33021; &#23558; &#26597; &#35810; &#32467; &#26524; &#26174; &#31034; &#32473; &#29992; &#25143;&#12290;Result &#23545; &#35937; &#21253; &#25324; &#19968; &#20010; &#30001; &#26597; &#35810; &#35821; &#21477; &#36820; &#22238; &#30340; &#19968; &#20010; &#34920;&#65292; &#36825; &#20010; &#34920; &#20013; &#21253; &#21547; &#25152; &#26377; &#30340; &#26597; &#35810; &#32467; &#26524;&#12290; &#23545;Result &#23545; &#35937; &#30340; &#22788; &#29702; &#24517; &#39035; &#36880; &#34892;&#65292; &#32780; &#23545; &#27599; &#19968; &#34892; &#20013; &#30340; &#21508; &#20010; &#21015;&#65292; &#21487; &#20197; &#25353; &#20219; &#20309; &#39034; &#24207; &#36827; &#34892; &#22788; &#29702;&#12290;Result &#31867; &#30340;getXXX &#26041; &#27861; &#21487; &#23558; &#32467; &#26524; &#38598; &#20013; &#30340;SQL &#25968; &#25454; &#31867; &#22411; &#36716; &#25442; &#20026;Java &#25968; &#25454; &#31867; &#22411;

  • What is the best practice for creating primary key on fact table?

    what is the best practice for primary key on fact table?
    1. Using composite key
    2. Create a surrogate key
    3. No primary key
    In document, i can only find "From a modeling standpoint, the primary key of the fact table is usually a composite key that is made up of all of its foreign keys."
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/logical.htm#i1006423
    I also found a relevant thread states that primary key on fact table is necessary.
    Primary Key on Fact Table.
    But, if no business requires the uniqueness of the records and there is no materilized view, do we still need primary key? is there any other bad affect if there is no primary key on fact table? and any benifits from not creating primary key?

    Well, natural combination of dimensions connected to the fact would be a natural primary key and it would be composite.
    Having an artificial PK might simplify things a bit.
    Having no PK leads to a major mess. Fact should represent a business transaction, or some general event. If you're loading data you want to be able to identify the records that are processed. Also without PK if you forget to make an unique key the access to this fact table will be slow. Plus, having no PK will mean that if you want to used different tools, like Data Modeller in Jbuilder or OWB insert / update functionality it won't function, since there's no PK. Defining a PK for every table is a good practice. Not defining PK is asking for a load of problems, from performance to functionality and data quality.
    Edited by: Cortanamo on 16.12.2010 07:12

  • What is the best practice to handle JPA methods in JSF app?

    I am building a JSF-JPA web app(No EJB).
    I have several methods that has JPA QL inside.
    Because I have to put those methods inside JSF beans to inject EntityManagerFactory (am I right about this?).
    And I do want to separate those methods from regular JSF beans which are used by page authors.
    And I may need to use them in different JSF managed beans.
    My question here is that what is the best practice to handle that?
    I. write a or a few separate JSF Beans and inject them into regular Beans?
    II. write a or a few separate JSF Beans and access them into regular Beans using FacesContext?
    III. others?
    Waiting to hear from you opinions.

    You can create named queries on your Entities themselves then just call entityMgr.createNamedQuery("nameOfQuery");
    Normally, we put these named queries in the class of the entity which will be returned. This allows for all information pertaining to a given entity and all ways of accessing that entity (except em.find() and stuff, of course) to be in one place. As long as the entity is defined in your persistence.xml file, any named queries which reside on that entity will be available through the EntityManager.
    As for the EntityManagerFactory, we normally create an application scope bean which holds the factory itself (because this is a heavy-weight object) and then just get all EntityManager instances from that by injecting this bean into whatever needs it. For example, I might have:
    //emfBB is the injected app scope bean which holds the entity manager factory.
    private EmfBB emfBB;
    private void lookupSomeData()
    EntityManager em = this.getEmfBB().getEmf()
    I hope this answered your question?
    ~Zack
    Edited by: zmarr on Nov 6, 2008 1:29 PM

  • What is the best practice for AppleScript deployment on several machines?

    Hi,
    I am developing some AppleScripts for my colleagues at work and I don't want to visit each of them to deploy my AppleScript on their Macs.
    So, what is the best practice for AppleScript deployment on several machines?
    Is there an installer created by the Automator available?
    I would like to have something like an App to run which puts all my AppleScript relevant files into the right place onto a destination Mac.
    Thanks in advance.
    Regards,

    There's really no 'right place' to put applescripts.  folder action scripts nees to go in ~/Library/Scripts/Folder Action Scripts (or /Library/Scripts/Folder Action Scripts), anything you want to appear in the script menu needs to go in ~/Library/Scripts (or /Library/Scripts), script applications should probably go in the Applications folder, but otherwise scripts can be placed anywhere.  conventional places to put them are in ~/Library/Scripts or in a subfolder of ~/Library/Application Support if they are run by an application.  The more important issue is to make sure you generalize the scripts: use the path to command to get local paths rather than hard-coding them in, make sure you test to make sure applications or unic executables you call are present ont he machine, use script bundles rather tna scripts if you scripts have private resources.
    You can write a quick installer script if you want to make sure scripts go where you want them.  Skeleton verion looks like this:
    set scriptsFolder to path to scripts folder from user domain
    set scriptsToExport to path to resource "xxx.scpt" in directory "yyy"
    tell application "Finder"
      duplicate scriptsToExport to scriptsFolder with replacing
    end tell
    say "Scripts are installed"
    save this as a script application, then open the application pacckage and create a folder called "yyy" in the resources folder and copy your script "xxx.scpt" into it.  other people can run the app to install the script.

  • What is the best practice in securing deployed source files

    hi guys,
    Just yesterday, I developed a simple image cropper using ajax
    and flash. After compiling the package, I notice the
    package/installer delivers the same exact source files as in
    developed to the installed folder.
    This doesnt concern me much at first, but coming to think of
    it. This question keeps coming out of my head.
    "What is the best practice in securing deployed source
    files?"
    How do we secure application installed source files from
    being tampered. Especially, when it comes to tampering of the
    source files after it's been installed. E.g. modifying spraydata.js
    files for example can be done easily with an editor.

    Hi,
    You could compute a SHA or MD5 hash of your source files on
    first run and save these hashes to EncryptedLocalStore.
    On startup, recompute and verify. (This, of course, fails to
    address when the main app's swf / swc / html itself is
    decompiled)

  • What is the best practice for full browser video to achieve the highest quality?

    I'd like to get your thoughts on the best way to deliver full-browser (scale to the size of the browser window) video. I'm skilled in the creation of the content but learning to make the most out of Flash CS5 and would love to hear what you would suggest.
    Most of the tutorials I can find on full browser/scalable video are for earlier versions of Flash; what is the best practice today? Best resolution/format for the video?
    If there is an Adobe guide to this I'm happy to eat humble pie if someone can redirect me to it; I'm using CS5 Production Premium.
    I like the full screen video effect they have on the "Sounds of pertussis" web-site; this is exactly what I'm trying to create but I'm not sure what is the best way to approach it - any hints/tips you can offer would be great?
    Thanks in advance!

    Use the little squares over your video to mask the quality. Sounds of Pertussis is not full screen video, but rather full stage. Which is easier to work with since all the controls and other assets stay on screen. You set up your html file to allow full screen. Then bring in your video (netstream or flvPlayback component) and scale that to the full size of your stage  (since in this case it's basically the background) . I made a quickie demo here. (The video is from a cheapo SD consumer camera, so pretty poor quality to start.)
    In AS3 is would look something like
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.ui.Mouse;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.display.StageDisplayState;
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    // determine current stage size
    var sw:int = int(stage.stageWidth);
    var sh:int = int(stage.stageHeight);
    // load video
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    var vid:Video = new Video(656, 480); // size off video
    this.addChildAt(vid, 0);
    vid.attachNetStream(ns);
    //path to your video_file
    ns.play("content/GS.f4v"); 
    var netClient:Object = new Object();
    ns.client = netClient;
    // add listener for resizing of the stage so we can scale our assets
    stage.addEventListener(Event.RESIZE, resizeHandler);
    stage.dispatchEvent(new Event(Event.RESIZE));
    function resizeHandler(e:Event = null):void
    // determine current stage size
        var sw:int = stage.stageWidth;
        var sh:int = stage.stageHeight;
    // scale video size depending on stage size
        vid.width = sw;
        vid.height = sh;
    // Don't scale video smaller than certain size
        if (vid.height < 480)
        vid.height = 480;
        if (vid.width < 656)
        vid.width = 656;
    // choose the smaller scale property (x or y) and match the other to it so the size is proportional;
        (vid.scaleX > vid.scaleY) ? vid.scaleY = vid.scaleX : vid.scaleX = vid.scaleY;
    // add event listener for full screen button
    fullScreenStage_mc.buttonMode = true;
    fullScreenStage_mc.mouseChildren = false;
    fullScreenStage_mc.addEventListener(MouseEvent.CLICK, goFullStage, false, 0, true);
    function goFullStage(event:MouseEvent):void
        //vid.fullScreenTakeOver = false; // keeps flvPlayer component from becoming full screen if you use it instead  
        if (stage.displayState == StageDisplayState.NORMAL)
            stage.displayState=StageDisplayState.FULL_SCREEN;
        else
            stage.displayState=StageDisplayState.NORMAL;

  • Database Log File becomes very big, What's the best practice to handle it?

    The log of my production Database is getting very big, and the harddisk is almost full, I am pretty new to SAP, but familiar with SQL Server, if anybody can give me advice on what's the best practice to handle this issue.
    Should I Shrink the Database?
    I know increase hard disk is need for long term .
    Thanks in advance.

    Hi Finke,
    Usually the log file fills up and grow huge, due to not having regular transaction log backups. If you database is in FULL recovery mode, every transaction is logged in Transaction file, and it gets cleared when you take a log backup. If it is a production system and if you don't have regular transaction log backups, the problem is just sitting there to explode, when you need a point in time restore. Please check you backup/restore strategy.
    Follow these steps to get transactional file back in normal shape:
    1.) Take a transactional backup.
    2.) shrink log file. ( DBCC shrinkfile('logfilename',10240)
          The above command will shrink the file to 10 GB.(recommended size for high transactional systems)
    >
    Finke Xie wrote:
    > Should I Shrink the Database? .
    "NEVER SHRINK DATA FILES", shrink only log file
    3.) Schedule log backups every 15 minutes.
    Thanks
    Mush

  • What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera?

    What is the BEST way to get my macbook with lion on it, to communicate with my Canon 40D camera? It says the utility disk is a PowerPC app and that is no longer supported. What do I do now? I can't upload photos from my camera.

    Also, I had the same problem happen when I tried to install an older version of Corel Painter. Are Macbook Pro users just NOT supposed to be able to use their laptops for the purposes they are best designed for?
    -Frustrated new Mac user

  • Iphone 4s coming friday, what is the best way to get the notes content from iphone 4 to 4s without doing a restore? i want the new phone to be totally new but not sure how to get notes content across.

    What is the best way to get the notes content from iphone 4 to 4s without doing a restore? i want the new phone to be totally new but not sure how to get notes content across. If I do a restore as I have when previously from one iphone to another it has shown (in settings, usage) the cumulative usage from previous phones so all the hours of calls on all previous iphones will be displayed even though its brand new. Anyone know how I can get my notes (from standard iphone notes app) to my new iphone 4s without restoring from previous iphone 4. Thanks for any help offered.

    First, if you haven't updated to iTunes 10.5, please update now as you will need it for the iPhone 4S and iOS 5.
    Once you're done installing iTunes 10.5, open it. Connect your iPhone to iTunes using the USB cable. Once your iPhone pops up right click on it. For example: an iPhone will appear and it will say "Ryan's iPhone."
    Right click on it and select "Backup" from the dropdown menu. It will start backing up. This should backup your notes.
    Please tell me if you have any problems with backing up.
    Once you backup and get your iPhone 4S, you must follow these steps. If you don't follow these steps, you will not be able to get your notes on your new iPhone 4S.
    Open up iTunes again then right click on your device (iPhone 4S). Once you do you will see a dropdown menu. It will say "Restore from Backup..." Select this and it'll ask for a backup, select it from the dropdown menu. For example "Ryan's iPhone - October 12, 2011." Pick that and it will restore to your backup. Do this when you get your iPhone 4S so you will not lose anything. Even though you're restoring, you're getting back, since you're getting the previous settings, notes, contacts, mail and other settings from your old iPhone. You'll still have Siri though! So, restore when you first get it. Also frequently backup your device, as it will be worth it. You can restore from a backup if something goes wrong or save your data for a future update.
    Once you do that, you should have your notes on your new iPhone 4S and iOS 5.
    Please tell me if you need any help.
    I hoped I answered your questions and solved your problem!

  • What is the best ipad to get? ipad 1 with 64 gb or a i pad 2 with 16 gb

    What is the best ipad to get? Ipad 1 with 64gb or a ipad2 with 16gb?  Does a ipad2 *** with a 64gb?

    Welcome, trishkay!
    King_Penguin has given you some great input, but you have not given him any feedback.  Perhaps you are waiting for more suggestions from others?  Here are my thoughts on your question:
    trishkay wrote: What is the best ipad to get?...
    Wait for iPad 3 and buy as many "gb" as you can afford.
    trishkay wrote: ... Ipad 1 with 64gb or a ipad2 with 16gb? ...
    What you can afford with enough room for the music, pictures, videos, and apps you must have.
    trishkay wrote:  Does a ipad2 *** with a 64gb?
    Definitely.
    Message was edited by: EZ Jim

  • What are the best practices to create surrounding borders?

    Good day everyone,
    I was wondering what is the best practices to create a look in my iOS app like the one below? How are they accomplishing the creation of the borders, is there a tool in Xcode IB to do that?
    Thank you in advance

    Once again thanks for your input, however I am still not clear how you have accomplish the rounded corners, you do not mention that in your reply.
    I did some research on my end and I was able to accomplish what I want with a UIView using the code below in an outlet:
    redView.layer.cornerRadius = 10;
    redView.layer.borderColor = [UIColor greenColor].CGColor;
    redView.layer.borderWidth = 5;
    However, I cannot do the same for the UITableView or UITableView cell.
    Thanks

  • What are the best practices for generating an EPS logo from InDesign?

    Our costomer is running into technical issues with the logo we sent them, which was exported from Indesign. Images were not embedded and fonts missing. I was able to embed the images and fonts. However, we DO NOT want them to be able to make any text changes. So after exporting an eps, I opened the file in Adobe Illustrator and made all the text outlines. I hope this works. But I just wanted to post the question on what are the best practices for doing this?
    The client needs the logo with transparent background, images emebdded and type in outlines. Also, they need some space around the text. When I exported the eps, the file is right up on the edge of the type.

    It sounds like you are pretty far from "best practice" with regard to logo design and delivery.
    These days, the very use of the EPS format should be considered bad practice, and some other terms in your post, (i.e., 'images,' 'missing fonts'), make it sound like there is not a seasoned logo designer involved.
    That said, you probably already got the advice you need to get out of the immediate jam. However, without proper logo design, you and the client will soon be facing other problems. You should be delivering a 100% vector graphic in single-color (black) and corporate-color(s) versions, with no live font data, that has been test-scaled to very small and very large sizes; ensuring it will work at postage-stamp size and on the side of a truck or building, with specific spot color(s) and proportions that will enable it to be offset printed, embroidered and screen-printed on apparel, and cut into signage materials and decals.

  • What is the best practice to perform DB Backup on Sun Cluster using OSB

    I have a query on OSB 10.4.
    I want to configure OSB 10.4 on 2 Node Sun Cluster where the oracle database is running.
    When im performing DB backup, my DB backup job should not get failed if my node1 fails. What is the best practice to achieve this?

    Hi,
    Each Host that participates in an OSB administrative domain must also have some pre-configured way to resolve a host name to an IP address.Use DNS, NIS etc to do this.
    Specify cluster IP in OSB, so that OSB always looks for Cluster IP only instead of physical IPs of each node.
    Explanation :
    If it is 2-Node OR 4-Node, when Cluster software installed in these nodes we have to configure Cluster IP so that when one node fails Cluster IP will automatically move to the another node.
    This cluster IP we have to specify whether it is RMAN backup or Application JDBC connection. Failing to second node/another Node is the job of Cluster IP. So wherever we install cluster configuration we have to specify in all the failover places specify CLUSTER IP.
    Hope it helps..
    Thanks
    LaserSoft

Maybe you are looking for

  • Message mapping problem / experts needed / UDF?

    Hello experts, I have the following problem in a message mapping: Source structure is as follows: - Node a (min 1, max 999)   - Subnode b (min 0, max 999)   - Each Subnode b has the element "number" (1,1) This structure must be mapped to the followin

  • Nokia pro cam

    I have Nokia lumia 920,updated and all with the l'asta versions(it id updated) when i want to put the Application "Nokia pro CAM". It tells me that My phone canot. Have it i download ed Others and no problema. But pro CAM does not let me download????

  • Want to open 2nd tab and have it load the home page which the first tab opens.

    Want to open 2nd tab and have it load the home page which the first tab opens. The first tab opens Google's advance search, the second tab opens a blank window. I always want Google to be in a new page. == This happened == Every time Firefox opened =

  • IE and Realtors on Mac

    I am a realtor and I need Internet explorer for mac. The sites I do BPOs for are starting to require only IE. What is my options other thatn paralles, VM? I need this to work properly and not cause me grief. What I am looking to see what other realto

  • Backup/Restore iOS7

    I backed up my iPhone earlier today, after downloading iOS7, I plugged the phone in and it synched. It seems to be fully restored with all my apps/contacts, etc. Is this possible without selecting "restore" in iTunes in this case?