Help on Generator event

Hi everyone. Has anyone played with Generator scripts? I have no idea where to look for help: except for several tutorials on Tom Krcha's website I can't find any documentation.
What I'm trying to do is launch JSX code every time the document updates. The problem is that this JS counts as an event and I'm getting an infinite loop. For now I put a timer check but I guess that is an ugly solution, because I don't know what time would take operations on different machines. Does anyone know if there's a different event I can use?
Here's my main.jsx:
(function () {
   "use strict";
   var generator;
   var i = 0;
   var lastOnChangeRunDate = getTime();
   function getTime() { return (new Date()).getTime(); }
   function init(gen) {
      generator = gen;
      generator.addMenuItem("fp", "test pludsfdfdsin", true, false)
      generator.onPhotoshopEvent("imageChanged", trololo);
      function trololo ( e) {
        if(getTime()-lastOnChangeRunDate<400) return;
        lastOnChangeRunDate = getTime();
        i++;
        var str = "doc = activeDocument; \
              tL= doc.layers[0]; \
                 tL.textItem.contents = "+i
        generator.evaluateJSXString(str);
   exports.init = init;

For documentation, the Github site is the best:
https://github.com/adobe-photoshop
Generator is open source, so Adobe uses github to post documentation and issues (as well as all the sources)
I wouldn't recommend trying to modify the document when responding to events for the reasons you mention. Generator isn't really designed for that. At the very least, you should be parsing the change (e), and only reacting to a specific change that isn't the change you are making.
You might look at the generator-assets source on github for some ideas on that.

Similar Messages

  • Can I use AWT elements in a JSP, and so could I generate events with them?

    This is because I�m doing a simple JSP that showing a button, my JSP is:
    <html>
    <%@ page import="java.awt.*" %>
    <%! Button b = new Button("Hola!!!"); %>
    <% add(b); %>
    </html>
    But when I tried to see the button in the browser, my JSP generates the following:
    Compilation of '/RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java' failed:
    /RAID5/weblogic/myserver/classfiles/jsp_servlet/_gep/_alterno/_23_mayo/__mr4.java:79: cannot resolve symbol
    probably occurred due to an error in /gep/alterno/23_mayo/mr4.jsp line 7:
    <% add(b); %>
    Could somebody help me please?.....
    Can I use AWT elements in a JSP, and so could I generate events with them?
    Thanks!!!

    There are 2 ways to run a web page dynamically:
    1) Reload the page via use of javascript or some other scripting language.
    2) Use an applet to regularly check a URL for the data
    Remember, as Paul pointed out, JSP's only generate HTML output. AWT components need to run inside a JVM not a just the browser.
    I could recommend an applet but you may have problems with IE6 not supporting java. Otherwise there shouldn't be too much of a prob.
    If you prefer to use an AWT/Swing setup (for example an application) rather than a JSP setup, Webstart is good for delivering online applications which operate standalone or remotely.
    When you consider that the Java-Plugin and the Webstart puligin are about the same size it's just a matter of weighing up who your target clients are and whats easiest.
    Cheers,
    Anthony

  • Maintain Equipment Category u2192 Generate Event for Workflow

    Maintain Equipment Category u2192 Generate Event for Workflow
    I activated this,
    Now what should i do further to receive a workflow mail when an Equipment is created for this Equipment Category
    Thanks

    Hello
    Maybe this can be helpful
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/52/e4fac8e31111d58d3a0000e8284931/content.htm
    You can Synchronizing Fixed Assets and Equipment and in this scenarier there are workflow you can send out.
    BR/Håkan

  • Generate Events based on Cache size

    Hi,
    I have a use case where I need to generate events when the size of the cache has reached a specific value. The cache will be highly transactions (lot of inserts and deletes totaling to 6 million transactions per day). Also, I cannot limit the size of the cache as I don't want any data to be lost (trying to insert when cache size has reached its limit).
    One of the ways I could do this is to use a MapListener to generate an event on every insert to the Cache, and then check for size each time to decide if the further processing needs to be done. With the nature of the traffic in the cache, the items in the cache are to be processed when the size threshold is reached and then deleted. But, I'm not sure how much of an overhead these events and listeners will have (with 6 million items going through the cache each day)
    Is there any other more efficient way to do this? I have looked at Continuous Query cache which uses a filter based on a cache. But, I'm not able to figure out a way to get the size of the cache using a filter.
    Any pointers are helpful
    Thanks in advance
    Regards
    Vikas
    Edited by: vikascv on Nov 17, 2009 8:48 AM

    Hi Vikas,
    Typically a size type calculation is the cumulative result of all storage enabled nodes, i.e. a Count aggregation. In your use case you want to be made aware of changes to an aggregation but as an aggregation is point in time of request opposed to continually being updated it does not fit your use case. One option is to create a MapEventTransformer that you register with the cache which increments a counters cache (on a separate service) using an EntryProcessor, i.e.
    MapEventTransformer...
    public class CounterMapEventTransformer implements MapEventTransformer, PortableObject
        String m_cacheName;
        public CounterMapEventTransformer()
        public CounterMapEventTransformer(final String cacheName)
            m_cacheName = cacheName;
        public MapEvent transform(MapEvent event)
            Long prevCount    = null;
            Long currentCount = null;
            switch( event.getId() )
                case( MapEvent.ENTRY_INSERTED ):
                    // perform counter++
                    currentCount = (Long) CacheFactory.getCache("counters").invoke(m_cacheName, new CounterOp(true));
                    break;
                case( MapEvent.ENTRY_DELETED ):
                    // perform counter--
                    currentCount = (Long) CacheFactory.getCache("counters").invoke(m_cacheName, new CounterOp(false));
                    break;
            MapEvent newEvent = new MapEvent(event.getMap(), event.getId(), event.getKey(), currentCount-1, currentCount);
            return newEvent;
        public void writeExternal(PofWriter out) throws IOException
            out.writeString(0, m_cacheName);
        public void readExternal(PofReader in) throws IOException
            m_cacheName = in.readString(0);
        }Incrementing EP...
    public class CounterOp extends AbstractProcessor implements PortableObject
        boolean m_increment;
        public CounterOp()
        public CounterOp(boolean increment)
            m_increment = increment;
        @Override
        public Object process(Entry entry)
            Long newVal = null;
            if( !entry.isPresent() )
                entry.setValue(newVal = Long.valueOf(1));
            else
                newVal = ((Long)entry.getValue()).longValue() + (isIncrement() ? 1 : -1);
                entry.setValue( newVal );
            return newVal;
        protected boolean isIncrement()
            return m_increment;
        public void writeExternal(PofWriter out) throws IOException
            out.writeBoolean(0, m_increment);
        public void readExternal(PofReader in) throws IOException
            m_increment = in.readBoolean(0);
        }cache-config
         <!--
              | listener-cacheconfig.xml | | Copyright 2001-2009 by Oracle. All
              rights reserved. | | Oracle is a registered trademarks of Oracle
              Corporation and/or its | affiliates. | | This software is the
              confidential and proprietary information of Oracle | Corporation. You
              shall not disclose such confidential and proprietary | information and
              shall use it only in accordance with the terms of the | license
              agreement you entered into with Oracle. | | This notice may not be
              removed or altered.
         -->
    <!DOCTYPE cache-config SYSTEM "cache-config.dtd">
    <cache-config>
         <caching-scheme-mapping>
              <cache-mapping>
                   <cache-name>dist-*</cache-name>
                   <scheme-name>distributed-scheme</scheme-name>
              </cache-mapping>
              <cache-mapping>
                   <cache-name>counters</cache-name>
                   <scheme-name>counter-scheme</scheme-name>
              </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <!--
        Distributed caching schemes
        -->
              <distributed-scheme>
                   <scheme-name>distributed-scheme</scheme-name>
                   <service-name>DistributedCache</service-name>
                   <serializer>
                        <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                        <init-params>
                             <init-param>
                                  <param-type>string</param-type>
                                  <param-value>pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <backing-map-scheme>
                        <local-scheme />
                        <!--
                             <read-write-backing-map-scheme> <internal-cache-scheme>
                             <local-scheme /> </internal-cache-scheme> <cachestore-scheme>
                             <class-scheme>
                             <class-name>com.oracle.coherence.cachecounter.store.CacheCounterStore</class-name>
                             </class-scheme> </cachestore-scheme>
                             </read-write-backing-map-scheme>
                        -->
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
              <distributed-scheme>
                   <scheme-name>counter-scheme</scheme-name>
                   <service-name>CounterDistributedCache</service-name>
                   <serializer>
                        <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                        <init-params>
                             <init-param>
                                  <param-type>string</param-type>
                                  <param-value>pof-config.xml</param-value>
                             </init-param>
                        </init-params>
                   </serializer>
                   <backing-map-scheme>
                        <local-scheme />
                   </backing-map-scheme>
                   <autostart>true</autostart>
              </distributed-scheme>
         </caching-schemes>
    </cache-config>pof-config...
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE pof-config SYSTEM "pof-config.dtd">
    <pof-config>     
       <user-type-list>          
          <!-- include all of the standard Coherence type -->
          <include>coherence-pof-config.xml</include>          
          <!-- our custom types (user types) 1000+ -->          
          <user-type>                 
             <type-id>1000</type-id>            
             <class-name>com.oracle.coherence.cachecounter.event.CounterMapEventTransformer</class-name>          
          </user-type>
          <user-type>                 
             <type-id>1001</type-id>            
             <class-name>com.oracle.coherence.cachecounter.processors.CounterOp</class-name>          
          </user-type>
       </user-type-list>
       <allow-interfaces>true</allow-interfaces>
       <allow-subclasses>true</allow-subclasses>
    </pof-config>Test class
    public class MapEventTransformerTest
        public static final String m_cacheName = "dist-test1";
        public static void setUp()
            System.setProperty("tangosol.coherence.cacheconfig", "counter-cacheconfig.xml");
            System.setProperty("tangosol.coherence.distributed.localstorage", "false");
        public static void loadVals()
            final NamedCache cache = CacheFactory.getCache(m_cacheName);
            final int MAX_SIZE = 100;
            for( int i=0; i<MAX_SIZE; i++ )
                cache.put(i, "msg "+i);
        public static void removeVals()
            final NamedCache cache = CacheFactory.getCache(m_cacheName);
            final int MAX_SIZE = 100;
            for( int i=0; i<MAX_SIZE; i++ )
                if( i%2==0 )
                    cache.remove(i);
        public static void testTransformer()
            final NamedCache cache = CacheFactory.getCache(m_cacheName);
            cache.addMapListener(new CounterAwareListener(),
                    new MapEventTransformerFilter(AlwaysFilter.INSTANCE, new CounterMapEventTransformer(m_cacheName)),
                    false);
        public static void main(String[] args) throws IOException
            setUp();
            testTransformer();
            loadVals();
            removeVals();
            System.out.println("press a key to end...");
            System.in.read();
        public static class CounterAwareListener extends MultiplexingMapListener
            @Override
            protected void onMapEvent(MapEvent evt)
                System.out.format( "# of items in cache: %d\n", evt.getNewValue() );
        }Note: Events could be received out of order but for your use case where you are interested in a threshold you may not care! -- food for thought :)
    --harvey                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Collector Rule stays with the same Description after "fast" generated Events - (Custom MP)

    Hi , I have a problem to customize one management pack
    I use this MP for a reference
    http://windowsmasher.wordpress.com/2011/02/07/monitoring-esxi-syslogs-with-opsmgr-2007-r2/
    The problem is when I generate event (they are syslog events) the description Data is all the same for some time :)
    For example if I generate 10 events fast , the description is all the same , but the data inside is different. MP should take XML element with Powershell script and it's working fine for a "slow" published events.
    I don't know why only the description data is the same . I tried to modify the script to NULL the $bag variable and $xmlMessage but without any luck.
    Any help will be appreciated
    I'm trying to build SYSLOG parser to visualize my data and eventually to do some reports.

    Still having a problem? Can you explain a little more what the issue is? Are you saying the event collection provider does not work correctly when there is a burst of events matching your criteria?
    Jonathan Almquist | SCOMskills, LLC (http://scomskills.com)

  • Need help in generating the ranks

    Hi,
    I need some help in generating the ranks from 1 to 6 for each order_id
    based on the item_cnt
    Order_Id 100 with the Item_cnt 217,112,89,76,55,39 to be ranked from 1 to 6
    Order_Id 200 with the Item_cnt 29,25,22,19,13,13 to be ranked from 1 to 6
    Order_id 300 with the Item_cnt 15,7,6,6,6,4 to be ranked from 1 to 6
    SOURCE DATA TABLE : ORD_TEST
    ORDER_ID ORDER_IN_DATE ORDER_OUT_DATE ITEM_CNT
    100 9/11/2012 9/12/2012 217
    100 9/13/2012 9/15/2012 112
    100 9/14/2012 9/17/2012 89
    100 9/13/2012 9/16/2012 76
    100 9/12/2012 9/15/2012 55
    100 11/9/2012 11/18/2012 39
    100 9/14/2012 9/18/2012 37
    100 9/20/2012 9/22/2012 32
    200 11/9/2012 11/18/2012 29
    200 9/13/2012 9/15/2012 25
    200 9/12/2012 9/15/2012 22
    100 9/12/2012 9/14/2012 22
    100 9/13/2012 9/17/2012 20
    200 9/14/2012 9/17/2012 19
    100 9/14/2012 9/16/2012 19
    100 9/13/2012 9/18/2012 18
    100 9/12/2012 9/19/2012 15
    300 9/11/2012 9/12/2012 15
    200 9/12/2012 9/16/2012 13
    200 9/22/2012 9/29/2012 13
    200 9/13/2012 9/17/2012 12
    200 10/5/2012 10/8/2012 9
    300 9/12/2012 9/18/2012 7
    300 9/12/2012 9/17/2012 6
    300 10/6/2012 10/10/2012 6
    300 4/25/2013 4/27/2013 6
    300 10/6/2012 10/9/2012 4
    300 9/16/2012 9/23/2012 2
    100 10/5/2012 10/8/2012 1
    200 9/11/2012 9/12/2012 1
    QUERY OUTPUT NEEDED IS
    ORDER_ID ORDER_IN_DATE ORDER_OUT_DATE ITEM_CNT RNK
    100 9/11/2012 9/12/2012 217 1
    100 9/13/2012 9/15/2012 112 2
    100 9/14/2012 9/17/2012 89 3
    100 9/13/2012 9/16/2012 76 4
    100 9/12/2012 9/15/2012 55 5
    100 11/9/2012 11/18/2012 39 6
    200 11/9/2012 11/18/2012 29 1
    200 9/13/2012 9/15/2012 25 2
    200 9/12/2012 9/15/2012 22 3
    200 9/14/2012 9/17/2012 19 4
    300 9/11/2012 9/12/2012 15 1
    200 9/12/2012 9/16/2012 13 5
    200 9/22/2012 9/29/2012 13 6
    300 9/12/2012 9/18/2012 7 2
    300 9/12/2012 9/17/2012 6 3
    300 10/6/2012 10/10/2012 6 4
    300 4/25/2013 4/27/2013 6 5
    300 10/6/2012 10/9/2012 4 6
    Below is the script
    CREATE TABLE ORD_TEST (ORDER_ID NUMBER, ORDER_IN_DATE
    DATE,ORDER_OUT_DATE DATE, ITEM_CNT NUMBER)
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/11/2012','MM/DD/YYYY'),TO_DATE('9/12/2012','MM/DD/YYYY'),217);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/13/2012','MM/DD/YYYY'),TO_DATE('9/15/2012','MM/DD/YYYY'),112);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/14/2012','MM/DD/YYYY'),TO_DATE('9/17/2012','MM/DD/YYYY'),89);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/13/2012','MM/DD/YYYY'),TO_DATE('9/16/2012','MM/DD/YYYY'),76);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/15/2012','MM/DD/YYYY'),55);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('11/9/2012','MM/DD/YYYY'),TO_DATE('11/18/2012','MM/DD/YYYY'),39);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/14/2012','MM/DD/YYYY'),TO_DATE('9/18/2012','MM/DD/YYYY'),37);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/20/2012','MM/DD/YYYY'),TO_DATE('9/22/2012','MM/DD/YYYY'),32);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('11/9/2012','MM/DD/YYYY'),TO_DATE('11/18/2012','MM/DD/YYYY'),29);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/13/2012','MM/DD/YYYY'),TO_DATE('9/15/2012','MM/DD/YYYY'),25);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/15/2012','MM/DD/YYYY'),22);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/14/2012','MM/DD/YYYY'),22);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/13/2012','MM/DD/YYYY'),TO_DATE('9/17/2012','MM/DD/YYYY'),20);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/14/2012','MM/DD/YYYY'),TO_DATE('9/17/2012','MM/DD/YYYY'),19);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/14/2012','MM/DD/YYYY'),TO_DATE('9/16/2012','MM/DD/YYYY'),19);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/13/2012','MM/DD/YYYY'),TO_DATE('9/18/2012','MM/DD/YYYY'),18);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/19/2012','MM/DD/YYYY'),15);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('9/11/2012','MM/DD/YYYY'),TO_DATE('9/12/2012','MM/DD/YYYY'),15);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/16/2012','MM/DD/YYYY'),13);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/22/2012','MM/DD/YYYY'),TO_DATE('9/29/2012','MM/DD/YYYY'),13);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/13/2012','MM/DD/YYYY'),TO_DATE('9/17/2012','MM/DD/YYYY'),12);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('10/5/2012','MM/DD/YYYY'),TO_DATE('10/8/2012','MM/DD/YYYY'),9);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/18/2012','MM/DD/YYYY'),7);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('9/12/2012','MM/DD/YYYY'),TO_DATE('9/17/2012','MM/DD/YYYY'),6);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('10/6/2012','MM/DD/YYYY'),TO_DATE('10/10/2012','MM/DD/YYYY'),6);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('4/25/2013','MM/DD/YYYY'),TO_DATE('4/27/2013','MM/DD/YYYY'),6);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('10/6/2012','MM/DD/YYYY'),TO_DATE('10/9/2012','MM/DD/YYYY'),4);
    INSERT INTO ord_test VALUES
    (300,TO_DATE('9/16/2012','MM/DD/YYYY'),TO_DATE('9/23/2012','MM/DD/YYYY'),2);
    INSERT INTO ord_test VALUES
    (100,TO_DATE('10/5/2012','MM/DD/YYYY'),TO_DATE('10/8/2012','MM/DD/YYYY'),1);
    INSERT INTO ord_test VALUES
    (200,TO_DATE('9/11/2012','MM/DD/YYYY'),TO_DATE('9/12/2012','MM/DD/YYYY'),1);
    select * from ord_test order by item_cnt desc;
    Thank you

    Hi,
    That's called a Top-N Query , and here's one way to do it:
    WITH    got_rnk            AS
         SELECT    o.*
         ,       ROW_NUMBER () OVER ( PARTITION BY  order_id
                                 ORDER BY          item_cnt     DESC
                        )  AS rnk
         FROM      ord_test  o
    SELECT       *
    FROM       got_rnk
    WHERE       rnk     <= 6
    ORDER BY  order_id
    ,            rnk
    ;Analytic functions (such as ROW_NUMBER) are computed after the WHERE clause is applied. If you want tio use the results of an analytic function in a WHERE clause, then you can compute the analytic function in a sub-query (such as got_rnk above), and then use that value in the WHERE clause of a super-query.

  • Help on generating token for opendoc url in XI3.1

    Hi Guys,
    I am trying to get some help in generating token for opendoc url to avoid login while trying to access a report in Infoview.
    From a previous post I got this code:
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
    <%
    boolean loginSuccessful = false;
    IEnterpriseSession boEnterpriseSession = null;
    String username = "Administrator";
    String password = "pwd";
    String cmsname = "CMS";
    String authenticationType = "secEnterprise";
    try {
    //Log in.
    boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
    if (boEnterpriseSession == null) {
    out.print("Unable to login.");
    } else {
    loginSuccessful = true;
    } catch (SDKException sdkEx) {
    out.print("ERROR ENCOUNTERED
    " + sdkEx + "");
    if (loginSuccessful) {
    ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
    String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
    String infoViewURL = null;
    String tokenParam = null;
    String redirectURL = null;
    infoViewURL = "http://server:8080/InfoViewApp/logon.jsp";
    tokenParam = "ivsLogonToken=" + logonToken;
    redirectURL = infoViewURL + "&" + tokenParam;
    response.sendRedirect(redirectURL);
    %>
    The problem is I don't know where to put this code in the opendoc.jsp file.
    I tried to create a custom OpenDoc.jsp with a above code, leaving the original opendoc.jsp as it is. And used this custom jsp file in the opendoc url. This is taking me to Infoview login page and I see taht a token is created at the end of the url but it is not passed.
    Can somebody help me to understand where exactly to put this code in the opendoc.jsp and any correction to this code or additional steps to get it working.
    Any help is greatly appreciated

    Stratos,
      Thanks for your inputs,
      I changed the code as you suggested , now my whole code looks like :
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.exception.SDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.security.*" %>
    <%
    boolean loginSuccessful = false;
    IEnterpriseSession boEnterpriseSession = null;
    String username = "user";
    String password = "Password";
    String cmsname  = "Server";
    String authenticationType = "secEnterprise";
    try {
       //Log in.
       boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsname, authenticationType);
       if (boEnterpriseSession == null) {
          out.print("<FONT COLOR=RED><B>Unable to login.</B></FONT>");
       } else {
          loginSuccessful = true;
    } catch (SDKException sdkEx) {
       out.print("<FONT COLOR=RED><B>ERROR ENCOUNTERED</B><BR>" + sdkEx + "</FONT>");
    if (loginSuccessful) {
       ILogonTokenMgr boLogonTokenMgr = boEnterpriseSession.getLogonTokenMgr();
         String logonToken = boLogonTokenMgr.createLogonToken("", 60, 1);
         //String logonToken = boLogonTokenMgr.getDefaultToken();
       String infoViewURL = null;
       String tokenParam = null;
       String redirectURL = null;
       infoViewURL = "http://Server:8080/InfoViewApp/logon.jsp";
       tokenParam = "ivsLogonToken=" + logonToken;
       redirectURL = infoViewURL + "&" + tokenParam;
       pageContext.forward( "openDocument.jsp?iDocID=" + 4668 + "&token=" + tokenParam);
    %>
    But I am still getting the Infoview Login Page . The url on the login page is
    http://server:8080/OpenDocument/opendoc/logonTrustedAuth.do?appKind=InfoView&iDocID=4668&isApplication=true&token=ivsLogonToken%server%3A6400%4021181JIipxt70VM0kd90v21179JFd4dHn7kW2FKSBi
    We can see that a token is being generated and appended to this url but it is not passing the user name and password.
    Please let me know what you think about this.

  • How to manually generate events in SMC 3.5 ?

    Dear,
    We are using the SDK of SMC 3.5 to build an application. To test the application, how can we generate events manually ? I'd like to have a script on Solaris that, when run, generates an event in the SMC database. Does anyone have such a script ?
    Best regards,
    Marc.

    Convert the CR2 files to DNG files, a folder at a time, using the latest DNG Converter that is from Adobe:  http://www.adobe.com/downloads/updates/
    OR buy an upgrade to LR 4.x.

  • Need help in generating L4 Traffic monitor logs

    Hi,
    As a part of my project I need to study different types of logs produced by Cisco IronPort. I could generate some access and authentication logs however not sure about generating the L4 Traffic Monitor logs. Can anyone point me to right documentation that will help me generate those logs?
    Thanks,
    Harshad Kashikar

    Harshad,
    L4 Traffic Monitoring needs to be configured within the IronPort - first question is do you have a SPAN/TAP port set up on your switch to capture L4 traffic?
    Second, I only use this feature to capture information on malware/spyware - I have seen P2P, IRC, and 'phone-home' traffic amongst other things.  Do you have an infected host you can monitor?
    BF

  • Generating events such as "push buttons" in ABAP

    Hi,
    Is it possible to make code in ABAP that given a screen number can generate events for that screen.
    For example create a Z program that given the input parameters screen name and transaction, do something like:
    screen 101.pushChangeButton.?
    regards
    Baran

    yes see this code.
    REPORT  YH648_DIALOG_PROGRAM.
    *call screen 1649.
    call screen 1642.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'T_CONTROL'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   SPFLI.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'T_CONTROL'
    TYPES: BEGIN OF T_T_CONTROL,
             MANDT LIKE SPFLI-MANDT,
             CARRID LIKE SPFLI-CARRID,
             CONNID LIKE SPFLI-CONNID,
             COUNTRYFR LIKE SPFLI-COUNTRYFR,
             CITYFROM LIKE SPFLI-CITYFROM,
             AIRPFROM LIKE SPFLI-AIRPFROM,
             COUNTRYTO LIKE SPFLI-COUNTRYTO,
             CITYTO LIKE SPFLI-CITYTO,
             AIRPTO LIKE SPFLI-AIRPTO,
             FLTIME LIKE SPFLI-FLTIME,
             DEPTIME LIKE SPFLI-DEPTIME,
             ARRTIME LIKE SPFLI-ARRTIME,
             DISTANCE LIKE SPFLI-DISTANCE,
             DISTID LIKE SPFLI-DISTID,
             FLTYPE LIKE SPFLI-FLTYPE,
             PERIOD LIKE SPFLI-PERIOD,
           END OF T_T_CONTROL.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'T_CONTROL'
    DATA:     G_T_CONTROL_ITAB   TYPE T_T_CONTROL OCCURS 0,
              G_T_CONTROL_WA     TYPE T_T_CONTROL. "work area
    DATA:     G_T_CONTROL_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'T_CONTROL' ITSELF
    CONTROLS: T_CONTROL TYPE TABLEVIEW USING SCREEN 1642.
    *&SPWIZARD: LINES OF TABLECONTROL 'T_CONTROL'
    DATA:     G_T_CONTROL_LINES  LIKE SY-LOOPC.
    DATA:     OK_CODE LIKE SY-UCOMM.
    module pf_status output.
      set pf-status 'STATUS_1642'.
    endmodule.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'T_CONTROL'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE T_CONTROL_INIT OUTPUT.
      IF G_T_CONTROL_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'SPFLI'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_T_CONTROL_itab'
        SELECT * FROM SPFLI
           INTO CORRESPONDING FIELDS
           OF TABLE G_T_CONTROL_ITAB.
        G_T_CONTROL_COPIED = 'X'.
        REFRESH CONTROL 'T_CONTROL' FROM SCREEN '1642'.
      ENDIF.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'T_CONTROL'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE T_CONTROL_MOVE OUTPUT.
      MOVE-CORRESPONDING G_T_CONTROL_WA TO SPFLI.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'T_CONTROL'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: GET LINES OF TABLECONTROL
    MODULE T_CONTROL_GET_LINES OUTPUT.
      G_T_CONTROL_LINES = SY-LOOPC.
    ENDMODULE.
    *&SPWIZARD: INPUT MODULE FOR TC 'T_CONTROL'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: PROCESS USER COMMAND
    MODULE T_CONTROL_USER_COMMAND INPUT.
      OK_CODE = SY-UCOMM.
      PERFORM USER_OK_TC USING    'T_CONTROL'
                                  'G_T_CONTROL_ITAB'
                                  'FLAG'
                         CHANGING OK_CODE.
      SY-UCOMM = OK_CODE.
    ENDMODULE.
    module back_exit.
    leave program.
    endmodule.
      INCLUDE TABLECONTROL_FORMS                                         *
    *&      Form  USER_OK_TC                                               *
    FORM USER_OK_TC USING    P_TC_NAME TYPE DYNFNAM
                              P_TABLE_NAME
                              P_MARK_NAME
                     CHANGING P_OK      LIKE SY-UCOMM.
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA: L_OK              TYPE SY-UCOMM,
             L_OFFSET          TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
    *&SPWIZARD: Table control specific operations                          *
    *&SPWIZARD: evaluate TC name and operations                            *
       SEARCH P_OK FOR P_TC_NAME.
       IF SY-SUBRC <> 0.
         EXIT.
       ENDIF.
       L_OFFSET = STRLEN( P_TC_NAME ) + 1.
       L_OK = P_OK+L_OFFSET.
    *&SPWIZARD: execute general and TC specific operations                 *
       CASE L_OK.
         WHEN 'INSR'.                      "insert row
           PERFORM FCODE_INSERT_ROW USING    P_TC_NAME
                                             P_TABLE_NAME.
           CLEAR P_OK.
         WHEN 'DELE'.                      "delete row
           PERFORM FCODE_DELETE_ROW USING    P_TC_NAME
                                             P_TABLE_NAME
                                             P_MARK_NAME.
           CLEAR P_OK.
         WHEN 'P--' OR                     "top of list
              'P-'  OR                     "previous page
              'P+'  OR                     "next page
              'P++'.                       "bottom of list
           PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
                                                 L_OK.
           CLEAR P_OK.
        WHEN 'L--'.                       "total left
          PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
        WHEN 'L-'.                        "column left
          PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
        WHEN 'R+'.                        "column right
          PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
        WHEN 'R++'.                       "total right
          PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
         WHEN 'MARK'.                      "mark all filled lines
           PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                             P_TABLE_NAME
                                             P_MARK_NAME   .
           CLEAR P_OK.
         WHEN 'DMRK'.                      "demark all filled lines
           PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                               P_TABLE_NAME
                                               P_MARK_NAME .
           CLEAR P_OK.
        WHEN 'SASCEND'   OR
             'SDESCEND'.                  "sort column
          PERFORM FCODE_SORT_TC USING P_TC_NAME
                                      l_ok.
       ENDCASE.
    ENDFORM.                              " USER_OK_TC
    *&      Form  FCODE_INSERT_ROW                                         *
    FORM fcode_insert_row
                   USING    P_TC_NAME           TYPE DYNFNAM
                            P_TABLE_NAME             .
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA L_LINES_NAME       LIKE FELD-NAME.
       DATA L_SELLINE          LIKE SY-STEPL.
       DATA L_LASTLINE         TYPE I.
       DATA L_LINE             TYPE I.
       DATA L_TABLE_NAME       LIKE FELD-NAME.
       FIELD-SYMBOLS <TC>                 TYPE CXTAB_CONTROL.
       FIELD-SYMBOLS <TABLE>              TYPE STANDARD TABLE.
       FIELD-SYMBOLS <LINES>              TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
       ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: get looplines of TableControl                              *
       CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
       ASSIGN (L_LINES_NAME) TO <LINES>.
    *&SPWIZARD: get current line                                           *
       GET CURSOR LINE L_SELLINE.
       IF SY-SUBRC <> 0.                   " append line to table
         L_SELLINE = <TC>-LINES + 1.
    *&SPWIZARD: set top line                                               *
         IF L_SELLINE > <LINES>.
           <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
         ELSE.
           <TC>-TOP_LINE = 1.
         ENDIF.
       ELSE.                               " insert line into table
         L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
         L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
       ENDIF.
    *&SPWIZARD: set new cursor line                                        *
       L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
    *&SPWIZARD: insert initial line                                        *
       INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
       <TC>-LINES = <TC>-LINES + 1.
    *&SPWIZARD: set cursor                                                 *
       SET CURSOR LINE L_LINE.
    ENDFORM.                              " FCODE_INSERT_ROW
    *&      Form  FCODE_DELETE_ROW                                         *
    FORM fcode_delete_row
                   USING    P_TC_NAME           TYPE DYNFNAM
                            P_TABLE_NAME
                            P_MARK_NAME   .
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA L_TABLE_NAME       LIKE FELD-NAME.
       FIELD-SYMBOLS <TC>         TYPE cxtab_control.
       FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
       FIELD-SYMBOLS <WA>.
       FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
       ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: delete marked lines                                        *
       DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
       LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
         ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
         IF <MARK_FIELD> = 'X'.
           DELETE <TABLE> INDEX SYST-TABIX.
           IF SY-SUBRC = 0.
             <TC>-LINES = <TC>-LINES - 1.
           ENDIF.
         ENDIF.
       ENDLOOP.
    ENDFORM.                              " FCODE_DELETE_ROW
    *&      Form  COMPUTE_SCROLLING_IN_TC
          text
         -->P_TC_NAME  name of tablecontrol
         -->P_OK       ok code
    FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                           P_OK.
    &SPWIZARD: BEGIN OF LOCAL DATA----
       DATA L_TC_NEW_TOP_LINE     TYPE I.
       DATA L_TC_NAME             LIKE FELD-NAME.
       DATA L_TC_LINES_NAME       LIKE FELD-NAME.
       DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
       FIELD-SYMBOLS <TC>         TYPE cxtab_control.
       FIELD-SYMBOLS <LINES>      TYPE I.
    &SPWIZARD: END OF LOCAL DATA----
       ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get looplines of TableControl                              *
       CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
       ASSIGN (L_TC_LINES_NAME) TO <LINES>.
    *&SPWIZARD: is no line filled?                                         *
       IF <TC>-LINES = 0.
    *&SPWIZARD: yes, ...                                                   *
         L_TC_NEW_TOP_LINE = 1.
       ELSE.
    *&SPWIZARD: no, ...                                                    *
         CALL FUNCTION 'SCROLLING_IN_TABLE'
              EXPORTING
                   ENTRY_ACT             = <TC>-TOP_LINE
                   ENTRY_FROM            = 1
                   ENTRY_TO              = <TC>-LINES
                   LAST_PAGE_FULL        = 'X'
                   LOOPS                 = <LINES>
                   OK_CODE               = P_OK
                   OVERLAPPING           = 'X'
              IMPORTING
                   ENTRY_NEW             = L_TC_NEW_TOP_LINE
              EXCEPTIONS
                 NO_ENTRY_OR_PAGE_ACT  = 01
                 NO_ENTRY_TO           = 02
                 NO_OK_CODE_OR_PAGE_GO = 03
                   OTHERS                = 0.
       ENDIF.
    *&SPWIZARD: get actual tc and column                                   *
       GET CURSOR FIELD L_TC_FIELD_NAME
                  AREA  L_TC_NAME.
       IF SYST-SUBRC = 0.
         IF L_TC_NAME = P_TC_NAME.
    *&SPWIZARD: et actual column                                           *
           SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
         ENDIF.
       ENDIF.
    *&SPWIZARD: set the new top line                                       *
       <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
    ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
    *&      Form  FCODE_TC_MARK_LINES
          marks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                   P_TABLE_NAME
                                   P_MARK_NAME.
    &SPWIZARD: EGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: mark all filled lines                                      *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
         ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
         <MARK_FIELD> = 'X'.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    *&      Form  FCODE_TC_DEMARK_LINES
          demarks all TableControl lines
         -->P_TC_NAME  name of tablecontrol
    FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                     P_TABLE_NAME
                                     P_MARK_NAME .
    &SPWIZARD: BEGIN OF LOCAL DATA----
      DATA L_TABLE_NAME       LIKE FELD-NAME.
      FIELD-SYMBOLS <TC>         TYPE cxtab_control.
      FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
      FIELD-SYMBOLS <WA>.
      FIELD-SYMBOLS <MARK_FIELD>.
    &SPWIZARD: END OF LOCAL DATA----
      ASSIGN (P_TC_NAME) TO <TC>.
    *&SPWIZARD: get the table, which belongs to the tc                     *
       CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
       ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
    *&SPWIZARD: demark all filled lines                                    *
      LOOP AT <TABLE> ASSIGNING <WA>.
    *&SPWIZARD: access to the component 'FLAG' of the table header         *
         ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
         <MARK_FIELD> = SPACE.
      ENDLOOP.
    ENDFORM.                                          "fcode_tc_mark_lines
    see at pf-status.
    Message was edited by:
            sunil kumar

  • Differences between Robot class generated events and real input events

    Hello everyone!
    I'm having a problem with the translation of the description of the awt.Robot class.
    - "This class is used to generate native system input events" -
    Does this mean there is no difference between real input events and generated events from the Robot class? Difference in reference to that the generated events can't be recognized as generated events by the os or programs.
    Thanks in advance.
    Chris B.

    The Robot class will use an interface provided by the operating system to inject events. Those are very close to 'real' input events, but not quite there. There are, for instance, several games out there which have a protection mechanism against Robot's events to prevent scripting/botting. However, any application that is not paying special attention to the event's source will assume that the input events generated by Robot are actually coming from the user, so you can 'control' any application with the exception of the beforementioned games.

  • Event monitor cannot find PowerShell generated events

    I have a basic event monitor that only looks for an event ID and source. The event I am monitoring is generated via Powershell from a remote system rather than being locally created. I'm not sure if that matters, but it sure seems like it.
    If I change the event expression in the monitor to look for other events it will generate alerts, it just cant see my PS events. I've tried changing the ID number, the source, using different params, etc... I'm convinced that this is due to the event creation
    process and PS must be creating the event in a different manner than SCOM is looking for. Maybe its a bug where SCOM just ignores events created by proxy.
    I found this: http://www.systemcentercentral.com/monitoring-events-written-from-a-remote-server-with-scom/
    But that is for Rules. I still tried adding <AllowProxying>false</AllowProxying> to the XML of the MP...SCOM didn't like
    it.
    Has anyone ran into this before?
    We are using SCOM 2012R2 fully updated. 
    - Slow is smooth and smooth is fast.

    I guess I should have been more specific. I am using PowerShell to create an event, it isnt an actual PowerShell event.
    write-eventlog -computername Server -logname Application -source Orchestrator -eventID 1 -message "This is an example of the events created with PS that SCOM cannot detect."
    Maybe I should explain what I'm doing. I have an Orchestrator runbook that does stuff with things. If one of the runbook activities fails, it will send an event to the machine it was trying to run the activity on. SCOM is monitoring for that PowerShell generated
    event stating that the runbook failed. 
    - Slow is smooth and smooth is fast.
    I think you haven't native source "Orchestrator" in PoSh log.
    Vladimir Zelenov | http://systemcenter4all.wordpress.com
    I run a New-EventLog command first to create the Orchestrator source. Otherwise the Write-EventLog command would fail if the source wasn't there. I can see the event there in the logs.
    - Slow is smooth and smooth is fast.

  • Disabled button generates events

    Hello,
    I have a radio button that I want to disable while a background process is running.
    After the process finishes, I enable the button again.
    However, if the user clicks on the disabled button during the background process, an ActionEvent still gets generated.
    Then when the button is re-enabled, it responds to the event that was generated while it was disabled. I want to prevent my button from responding to events generated while it was disabled.
    I do not want to use the getGlassPane.setVisible(true) technique because I still want my cancel button to be able to generate events during the background process.
    I am using JDK 1.3.1 and my button is in a panel contained in a JFrame application.
    Suggestions?
    Thank you,
    Ted Hill

    Hello,
    I have a radio button that I want to disable while a background process is running.
    After the process finishes, I enable the button again.
    However, if the user clicks on the disabled button during the background process, an ActionEvent still gets generated.
    Then when the button is re-enabled, it responds to the event that was generated while it was disabled. I want to prevent my button from responding to events generated while it was disabled.
    I do not want to use the getGlassPane.setVisible(true) technique because I still want my cancel button to be able to generate events during the background process.
    I am using JDK 1.3.1 and my button is in a panel contained in a JFrame application.
    Suggestions?
    Thank you,
    Ted Hill

  • Help with Keyboard Event

    Hi, I am designing a drum machine in flash pro Cs6 actionscript 3.0  and I am trying to add a keyboard event that will trigger a button event that I have all ready created, I can create the event to play the sound but this is not what I want, can I call the click event so the button will move on the key event triggering the sound, here is an example of one of my buttons code... btn, thank you if anyone can help.
    import flash.events.KeyboardEvent;
    playsound2.fla
    playsound with extra functionality:
    textbox added.
    Displays ID3 info of the sound
    btn.addEventListener(MouseEvent.CLICK, playSomeSound);
    function playSomeSound(e:MouseEvent)
              var req:URLRequest = new URLRequest("Savage.mp3");
              var s:Sound = new Sound(req);
              s.addEventListener(Event.COMPLETE, onSoundLoaded);
              s.addEventListener(Event.ID3, onID3Info);
    function onSoundLoaded(event:Event):void
              var localSound:Sound = event.target as Sound;
              localSound.play();
    function onID3Info(e:Event):void
              var id3Props:ID3Info = e.target.id3;
              var sOut:String = txt.text = "";
              for (var propName:String in id3Props)
                        sOut = propName + "=" + id3Props[propName] + "\n";
                        trace(sOut);
                        txt.appendText(sOut);
              txt.text = id3Props.comment;
    var ba:ByteArray = new ByteArray();
    var gr:Sprite = new Sprite();
    gr.x = 5;
    gr.y = 50;
    addChild(gr);
    var time:Timer = new Timer(50);
    time.addEventListener(TimerEvent.TIMER, timerHandler);
    time.start();
    function timerHandler(event:TimerEvent):void
              SoundMixer.computeSpectrum(ba, false);
              var i:int;
              gr.graphics.clear();
              gr.graphics.lineStyle(2, 0xFF0000);
              gr.graphics.beginFill(0x00ff00);
              gr.graphics.moveTo(10, 10);
              //  draw a circle.;
              var w:uint = 15;
              for (i=0; i<512; i+=w)
                        var t:Number = ba.readFloat();
                        var n:Number = (t * 200);
                        gr.graphics.drawCircle(i, 0, -n);

    Thanks, this was the code I added in the end and it works nicely, It covers my sound and id3 aswell as Im displaying lcd text in a dynamic text box.
    stage.addEventListener(KeyboardEvent.KEY_DOWN, btndownKey);
    function btndownKey(event:KeyboardEvent)
              if (event.keyCode == 83)
                        var url:String = "Savage.mp3";
                        var request:URLRequest = new URLRequest(url);
                        var s:Sound = new Sound();
                        s.addEventListener(Event.COMPLETE, completeHandler);
                        s.addEventListener(Event.ID3, onID3Info);
                        s.load(request);

  • Why shared variable generates events when I write constant value?

    Hello all,
    I'm using LV 8.5 with DSC packet.
    I modified "DSC Events Demo".vi and made a test. I noticed that only variable which work okay is double typed. Why this code generate events all the time when I write constant values to shared variables? Double is okay, but string and boolean types not work okay. Is there any other people how have noticed same symption?
    Attachments:
    modified_dsc_event_demo1.zip ‏391 KB

    You may get an initial event on startup which is normal.  Also make sure that you have not enabled timestamp change events.

Maybe you are looking for

  • Custom calculation script for checkboxs

    Hello, Can anyone help me out with custom calculation script for this?  I have two mutually exclusive checkboxes that, when checked, I want to populate data into other text fields. If Checkbox1 is checked: Company1=Warehouse Alpha Address1=1234 Any S

  • CD burn had error code 4280, HELP!!!

    I installed the latest version of iTunes, but as many other postings I've read, I have not been able to successfully burn a CD with iTunes since the installation. Every time I get the message, "The attempt to burn a disc failed. An unknown error occu

  • Camileo X-sports freezing

    Hello, I have recently bought a Camileo X-sports. It appears to freeze randomly but regularly when filming. It always happened with the case on. The recording stops and none of the buttons respond anymore. Each time I had to remove the battery to reb

  • Is there a way to track emails?

    Can anyone please enlighten me as to whether there's a way to tell when the email you've sent to someone has been read? I'm using the Mac Mail program, and I've heard that other email apps will let you do this, but I don't seem to find a way to do th

  • Interactive hr report

    Hi all, I created an interactive HR report using PNP LDB ... but I have a problem .... it is taking me to the next screen wherever i click ...... and I want to restricted to personnel no..... so that whenever i click on personnel no. it should take m