Batch Command Processor

I have a page that needs to handle updates to multiple recordsets. Each of these updates takes roughly 3 seconds to do. Therefore, we want to present a progress bar to the user so they know how close they are to being done. The progress bar is in a popup window.
My idea is, make a stack of "Command" classes with a ".execute" method, pass the stack to the page, pop off the first element, run .execute, write my progress bar, submit to myself thereby passing the updated stack, and when there aren't any more elements on the stack, I'm done. Cool. Very low coupling. Very reusable.
The problem is that I can't pass objects through forms. I would need to use a session scope bean to keep that stack of objects around. The problem with this is that if the user closes the window in the middle of the process, the stack is left hanging around since the user only closed the popup, and didn't end their session. Then, next time the user went to do this, I have all these old commands trying to be executed.
What would be IDEAL, is if I could pass an object through the request on the backend. Unless this is possible, however, I think I'm going to have to do something like serialize my object and put it as the value in a hidden input. However, I have no idea how this works.
So, in order of descending idyllity (??):
1) If anyone knows how to pass an object through a form, much obliged.
2) If anyone knows an easy way to use serialized objects in forms, coo.
3) If anyone has a better solution to this problem, fantastic.
4) ANY WAY to keep objects between requests besides session.

Here is how I would handle the situation.
Use Sesssion, but reference the complete transaction by a unique identifier.
long batchId;
if ( request.getParameter( "BATCH_ID" ) == null )
  //create new batch transaction id
  batchId = (new java.util.Date()).getTime();
} else {
  //Must be second or third update so read batch Id from client
  batchId = Long.parseLong(request.getParameter "BATCH_ID" ) ).longValue();
Stack myCmds;
if ( session.getValue( "BATCH_ID_" + batchId ) == null )
   //create your Stack Object & dump to session
   myCmds = getCommandStack();
   session.putValue( "BATCH_ID_" + batchId , myCmds );
} else {
   //retrieve obj from session
   myCmds = (Stack)session.getValue( "BATCH_ID_" + batchId );
}Make sure you print back to the client a hidden field called BATCH_ID with the batchId;
With this model, if a user closes the window in the middle of the batch update, they will lose their batchId, since the only place it is stored is in client html. Because they have lost their batchId, when they attempt to start again, they will receive a new batchId and a new Command stack.
let me know if this makes sense
I think this satisfies your requirements, and it also utilizes the preferred way to store temporary objects between asynchronis client requests.

Similar Messages

  • Batch Command Warning Dialog

    Hello All    
    I've set-up an action to resize a folder of photos.  Recorded the action, all is good.  I go to AUTOMATE > BATCH and go through the set-ups, etc., but when I activate the run, I keep getting this warning dialog:
    "Could not complete the Batch command because the disk is not available". 
    At first I thought it may be looking for the SD card the photos were copied from, but that's not the case as I have imported all the photos and they now reside on the HD.  I've tried restarting Photoshop and even restarting the system - both to no avail.
    Any idea as to what this dialog is referring to?
    Running :
    Photoshop CC
    27" Late 2013 iMac
    3.5 GHz Intel i7
    16 GB RAM
    NVIDIA GeForce GTX 780 Graphics
    OSX 10.9.1
    Any help would be MOST appreciated!!
    Keith

    If all your doing is resizing image to fit within some size you don't even need an action unless you replacing the original files which is not a good idea in any case. For if something goes wrong you could wind up loose everything.
    Use menu File Scripts>Image Processor.  In the Image Processor Dialog point to the source folder set the output locarion set image file types yoo want to save and the size and option. You can even include actions.
    There is also Image Processor Pro a free download which is a more powerful script.

  • Batch command not closing files automatically

    Hi,
    Photoshop CS6
    Windows 7
    How do you make Photoshop automatically save and close a batch of raw files during batch runs?
    I'm just now trying the File>Automate>Batch command. I want to run an action on a bunch of .NEF raw files.
    How do you get rid of all the dialogs and just make the thing do the action? i.e., just OpenTheRawFile>RunTheAction>SaveAndClose>DoTheNextFile
    First it opened them all up one by one in Camera Raw and the ACR window stayed open until I clicked Open Image. So I checked Suppress File Open Options Dialog in the Batch command. That fixed that problem. But Batch left all the files open in Photoshop, didn't close any of them.
    So I went back into my action and added a file close. While recording the action I clicked Yes to save changes before closing the file.
    However, the batch now pops up that same dialog box after each file asking me if I want to save the file before exiting. This defeats the whole purpose of the Batch command.

    Do not use Batch, use one of the available Image Processor scripts instead.  If your RAW files have been converted before and have associated ACR setting, The RAW files will be converted  using these settings by ACR and ACR will bypass displaying its dialog. If the RAW files have no associated ACR settings the Image Processor scripts have an option that you can use to have the Image Processor open the first RAW file via ACR  where ACR will open its dialog. The settings you set will be used to convert all the RAW files processed in the current run of the Image Processor.
    Image Processor Pro is available on the web for downloading and is more flexible and powerful then the Image Processor that is shipped with Photoshop. You can set it up to save as many Image File for each file processed. The size and File Type you need.
    You can have the Image Processor Pro include in its process an action you create for file that are saved. It can be the same action or different action for each of the file save you set up.

  • Batch command in FileAdapter

    Till yesterday the batch command in file adapter working fine, from today none of the batch commands in file adapter are not working. Please suggest the solution?

    I have a requirment where i have to raise PI alerts when proxy exceptions getting triggered.
    I came to know , we have to call function module 'SALRT_CREATE_API' in the proxy.
    Can any one let me know the step by step configuration as iam already reffering to
    http://help.sap.com/saphelp_nw04/helpdata/en/d0/5e073c8e56f658e10000000a114084/content.htm
    Any pdf would be appreciated?

  • Order in a query in SQL Command Processor

    Hi all
    I'm trying 'HTML DB 1.6' @htmldb.oracle.com.
    Now when i run a simple query against a table in the 'SQL Command Processor', the order by doesn't work proparly. It seems that the ORDER BY clause is ignored.
    Here is the query:
    SELECT ng
    FROM ges_rep_adr
    ORDER BY ng
    By the way the same happens in a report.
    Has anybody an idea what's the problem?
    Thanks in advance and best regards
    Martin

    Martin,
    Try:  select replace(substr(ng,1,1),' ','!')||substr(ng,2) from ges_rep_adr order by ngto see the cases where a leading space character in the output is not rendered visually and leads you to conclude that the rows are sorted wrong. If that's not it, let us know.
    Scott

  • XI to Batch Command Scenario

    Hi All,
    My scenario is SAP to XI to Batch Command.
    The receiver system is a listening port system where it receives data at the port. Currently XI is not the middleware. So the communication happens through EXE. It happens as follows:
    1. exe sends a wake up call to Batch Command.
    2. Command Batch sends an acknowledgement to exe that it is ready to receive data
    3. Now exe sends data to CB.
    4. CB sends Ack for data
    5. exe sends a sleep call to CB to close connection
    6. Cb sends Ack back to exe.
    Now exe has to be replaced with XI , so is this set of Communication possible through XI in the same scenario? If yes , then How.
    If no what can be the solution.
    Also will the Standard adapters in XI serve the purpose for Command Batch since it is not any File system , but it receives data at the port or will Custom adapter will have to be developed for this purpose.
    Please help.
    Thanks & Regards,
    Loveena.

    That sounds like a proprietary TCP/IP handshake.
    There is no way besides own development of Java code.
    You could develop an adapter or a Java proxy for this purpose.
    The better option is, replcing the batch command with an HTTP or Webservice enabled program and use standard PI functionality.

  • Batch commands

    Hi,
    I am getting followin error
    org.apache.commons.digester.Digester error
    SEVERE: Parse Error at line 5 column 19: Document is invalid: no grammar found.
    org.xml.sax.SAXParseException: Document is invalid: no grammar found.
         at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
         at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
         at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
         at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
         at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.commons.digester.Digester.parse(Digester.java:1567)
         at org.apache.catalina.startup.ContextConfig.tldScanStream(ContextConfig.java:977)
         at org.apache.catalina.startup.ContextConfig.tldScanTld(ContextConfig.java:1006)
         at org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:870)
         at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
         at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:3582)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
         at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:307)
         at org.apache.catalina.core.StandardHost.install(StandardHost.java:788)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:559)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:401)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:754)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:363)
         at org.apache.catalina.core.StandardService.start(StandardService.java:497)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
         at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
         at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
    [Microsoft][SQLServer 2000 Driver for JDBC]Statements that produce result sets are not allowed in batch commands.
    [Microsoft][SQLServer 2000 Driver for JDBC]Statements that produce result sets are not allowed in batch commands.
    For input string: "sdfc"
    I am using the Tomcat version 4.0 and my xml file has correctly <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    And the application correctly identifed the servlet and throwing this error from the servlet. Can anybody help in this regard.

    I don't think so. I believe your server.xml or your web.xml file is malformed. This means that the DTD that the container validates the file against is not in agreement with the XML you created. See if you can start commenting out elements in your web.xml until the server starts properly to zero in on the problem. Or, if you are comfortable reading DTD's, go straight there to find out the problem.
    - Saish

  • Batch command to auto login

    We are using Sony MBPS and it has to be rebooted every month.  We have automated much of it using batch files but we would like to further automate it.  Is there a batch command to trigger an automatic login of the servers?

    Automatic logon can be configured through registry:
    http://support.microsoft.com/kb/315231/en-us
    The article mentions Windows XP, but it is valid for all later versions of Windows. This is how we do it. We deploy the registry keys through group policy to the machines that need automatic login.

  • Batch Command Freezes up CS5

    Suddenly, when I use the batch command, CS5 freezes up and has to be closed using alt-ctrl-delete. I've been using the command for a long time with no problems. All the other commands under the "Automate" line work.                                                                                                                                                                                                                                                                                                                                                                                I reinstalled CS5, and it appeared to fix the problem. However, when I scanned a BUNCH of photos, and went to use the command, it froze again. Any ideas?

    Ok since I got some free time, I updated to 12.0.4 again, with reallocating the temp path.
    The freezing bug is still there, and it's still creating those .mvm file(1-14 inside the C:Temp. and 15 at the root of E). Since http://forums.adobe.com/thread/747353 is still discussing this issue, I'll leave it for a while.
    With the update, my selection issue is also remaining there, I'd like to talk about it, since it's not only happnening to selection or magic tool, but to any tools  involving moving cursor.
    http://www.photoshopgurus.com/forum/photoshop-troubleshooting/29186-photoshop-cs4-cs5-acti ng-like-they-possessed.html
    http://digitalweddingchat.com/showthread.php/14289-weird-mouse-problem-in-PS..-posessed-mo use!
    I'll save myself the trouble of describing since the above posts have done it really well. And their fixes do not apply to me.
    What I could add to this:
    1) Regarding the selection tool, this issue mostly happens after I move my cursor, and once it's "activated", I could just click like hell without moving my mouse at all, while creating a crazy record of below( simply caused by clicking mouse, which
    "moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>moving marquee>cancel selection>".
    But if I simply open PS, and start clicking on the picture with selection tool, keeping my mouse from moving in the first place, then usually I can't duplicate this issue.
    2) Also, the issue will also occur if I move my mouse and click, but we could get some hint if we duplicate it this way.The unintended selection caused by this issue, which we take rectangular selection for example, will have a corner at the place where I ever put my cursor at. So from my point of view, it's like photoshop is ignoring my action, which is releasing the left button. For PS, I first move my mouse to point A, pushing left button down, (igored)releasing left button(ignored), moving mouse to point B,and a new unintended selection! Though this pattern only occurs sometimes of the issue, but it might hold some word.
    3) As I keep testing, the easiest way to duplicate the issue is to move my mouse for a long distance and click, opposed to rapid small displacement and click.Well not that useful.
    4) The way I deal with it now, is to endure it. I keep reselecting and usually the issue will disappear for a while, and come back at unknown future. I tried changing my mouse/graphic card/memory, as well as their drivers, ended up no fixing.
    Any idea on this, Noel?
    -Monkey

  • Batch command to find java version

    Hi
    I need to get the version of java runtime env on a machine using command prompt (more specifically in a batch file). java -version at command prompt gives me the version and other stuff. But has anyone written a batch file that extracts values like 1.3.1 or 1.4.0 by executing a batch command??
    Any suggestions woul dbe helpful
    Thanks
    VP

    Here's my thoughtsjava -version 2>tmp.txt         //pipe version to file
    find "java version" tmp.txt|find "java version">tmp2.txt  //just get info
    del tmp.txt
    for /f %i in (tmp2.txt) do @set version=%i  // set a variable
    del tmp2.txt
    set version=%version:~10,5%                 // you get offsets
    @echo %version%You will need to debug this.
    P.S. IS this Java Programming?

  • Batch command unavailable

    Suddenly when I select multiple images in Bridge, then go to Tools>Photoshop>Batch, I get the message "The command "Batch" is currently unavailable."  Batch is also greyed out in Automate.  This occurs when no other processes are happening.  What could  it be?  Batch command has always worked fine in the past.

    So File > Automate > Batch in Photshop is greyed out?
    And would you mind providing the relevant information about your set-up (Photoshop-version, OS etc.)?
    Boilerplate-text:
    Are Photoshop and OS fully updated and have you performed the usual trouble-shooting routines (trashing prefs by pressing command-alt-shift/ctrl-alt-shift while starting Photoshop until the appropriate dialog appears after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved and making a note of the Preferences you’ve changed, 3rd party plug-ins deactivation, system maintenance, cleaning caches, font validation, etc.)

  • Batch command for using Java in IE

    Hello,
    I'm looking for a batch command that sets IE to use Java (Sun).
    It should do the same job as if manually checking the check box of 'Use <java version> for applet' in advanced internet options of IE.
    Is there a way to do it?

    Sorry, currently there's no batch command to set IE to use Java from Sun.
    There're quite a few registry keys need to be set when that option is selected.
    Registry settings for:
    - turning off console for MSVM;
    - hooking up Sun's Java console to IE;
    - adding a "TreatAs" to the Web Browser Applet Control so that applets with applet tag will use Sun's Java;
    etc.

  • What happened to Batch command in Photos

    Batch command is gone in photos. In  iphoto I was able to to change Title, Description, or Keywords for all selected photos under the edit window.

    I found many of the other features that Apple has deleted with the release of Photos including Batch to be useful.
    Since Apple has taken their stand to dumb down their photographic app, I am now going to look elsewhere for a non-Apple product that better satisfies my needs then the toy they are offering.
    Maybe if I go with a vendor who is only do photographic software there might be less chance for them to go the same route as Apple.

  • Excute Batch command in FORM

    How can I call external batch command in FORM?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by kanekan ([email protected]):
    How can I call external batch command in FORM?<HR></BLOCKQUOTE>
    G'Day,
    Okay, you don't say if you need to do this in the Unix environment or Windows. I guess you mention 'batch' so it must be Windows. Try using the API (DDE.App_Begin(...)) function.
    HTH
    Regards,
    Ivor
    null

  • Batch Command in CS5 is greyed out

    The Batch Command in CS5 is greyed out.  I am running CS5 64 bit with  Windows 7 64-bit.  Any ideas. It was working and now it does not.

    You're talking about the Batch... entry in the File - Automate menu inside Photoshop itself?  That's weird, I have never seen that one become disabled.
    Do you have any actions at all loaded into your Actions panel?
    Have you quit and restarted Photoshop, and does the problem persist?
    Failing these things, I think I might suggest clearing all the preferences to defaults.  You can do this by pressing and holding Control-Shift-Alt (or Shift-Command-Option on a Mac) immediately upon cold starting Photoshop.  If you're quick enough to get the keys down - and you have to be very quick - it will prompt you to delete your current preferences, which will lead to the generation of out-of-box defaults.  Clearing preferences quite often restores operation when weird things go wrong.  Keep in mind you'll have to re-do all your settings after this operation.
    -Noel

Maybe you are looking for

  • Correcting PO

    Hi A vendor has 2 PO's in SAP. On PO A, incorrect amounts(over payments) were GR'ed(Service Entries are being used) and IR'ed. And these amounts were paid to the vendor. Vendor invoiced less on PO B to counter the overpayment. These invoices(with the

  • Unable to view iTunes Store purchase history

    Hi All, I'm unable to view my iTunes Store      purchase history. When I try to do so from within iTunes itself I am taken to a seemingly blank store page, which seems to have no content according to VOiceOver, Apple's built-in screen reader. I've pr

  • Facetime issues mavericks

    Hi, I am responsible for converting many people from PC to Mac, telling them that upgrading the OS in Mac is eamless. And it has been for a long time. Until the Mavericks. With Mavericks I am experiencing subtle issues. But, Facetime is a big one. I

  • Difficulty having to keep logging in

    Hi, I gave up on the problem I had last year with having to 'keep' logging in on webmail to allow me to download e-mails to my Thunderbird desktop client. I was consistently told that BT do not support Thunderbird (although it is used by many thousan

  • Delete key not working

    When I try to delete a letter in my text message it just types another letter "C Z", and when I hit enter it types a star? I've tried taking the battery out twice. Not sure what to do.