Jai’s Weblog – Tech, Security & Fun…

Tech, Security & Fun…

  • Jaibeer Malik

    Jaibeer Malik
  • View Jaibeer Malik's profile on LinkedIn
  • Subscribe

  • Feedburner

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 3 other followers

  • Archives

  • Categories

  • Category Cloud

  • Stats

  • Blog Stats

    • 117,765
  • Live Traffic

Archive for the ‘Tips&Tricks’ Category

Tips&Tricks: How to handle Oracle LONG datatype while working with legacy systems?

Posted by Jai on February 4, 2010

This post share some techniques you can try to handle Oracle LONG data type while working with legacy systems. While recently working on integrating one of the legacy system with latest technologies (JPA/Hibernate) we came across some of the challenges in doing the same. Here we will see how to find way around for one of such problem, Oracle LONG data type, or how to get rid of it.

Getting rid of Oracle LONG data type: Depending upon the nature of data you store in the column, you can plan to change the column type

LONG->VARCHAR (If you have limited data, 4000)

LONG->CLOB (for bigger data size)

You can use the below Stored Procedure to convert the column type:
Read the rest of this entry »

Posted in Tips&Tricks | Tagged: , , | Leave a Comment »

Tips&Tricks: CairngormEventDispatcher dispatchEvent versus dispatch method

Posted by Jai on August 21, 2009

With Cairngorm versions prior up to and including 2.1, the sample code we usually find uses,


var loginEvent : CheckLoginCredentialsEvent = new CheckLoginCredentialsEvent ( username, password );
CairngormEventDispatcher.getInstance().dispatchEvent( loginEvent );

With Cairngorm 2.2, a helper method to CairngormEvent


new CheckLoginCredentialsEvent ( username, password ).dispatch();

Use whichever you like. I personally prefer the second one.

Posted in Cairngorm, Flex, Tips&Tricks | Tagged: , | Leave a Comment »

Tips&Tricks: Flexlib SupertabNavigator tab close event handling

Posted by Jai on August 20, 2009

To get handle of tab close event in super tab navigator of flexlib use:


<flexlib:SuperTabNavigator id="tabNavigator"
			popUpButtonPolicy="auto"
			closePolicy="{SuperTab.CLOSE_ALWAYS}"
			tabClose="handleEventCloseTab(event);">
</flexlib:SuperTabNavigator>

private function handleEventCloseTab(event:SuperTabEvent):void
			{
				//Remove data from model in case of a Details tab close
				if (tabNavigator.getChildAt(event.tabIndex) is DetailsTab)
				{
					var obj:DetailsTab=tabNavigator.getChildAt(event.tabIndex) as DetailsTab;
					appModel.list.remove(obj.selectedId);
				}
			}

The event gives you the handle to do tab specific operations on tab close event.

Posted in Flex, Tips&Tricks | Tagged: , , , | Leave a Comment »

Tips&Tricks: Include SpringActionscript application context file in swf file

Posted by Jai on August 18, 2009

There are multiple ways to include the application context file in swf file.


[Embed(source="application-context.xml", mimeType="application/octet-stream")]
        public class EmbeddedContext extends ByteArray {
        public function EmbeddedContext() {
                super();
            }

            public function get content():XML {
                return new XML(readUTFBytes(length));
                }
        }

 _applicationContext=new FlexXMLApplicationContext();
                _applicationContext.addConfig(new EmbeddedContext().content);
                _applicationContext.addEventListener(Event.COMPLETE, onApplicationContextComplete);
                _applicationContext.load();

Another way is to directly use the _applicationContext.addEmbeddedConfig(configClass).

Posted in Cairngorm, Flex, Tips&Tricks | Tagged: , , , | Leave a Comment »

How to change the XMLDB Ports(HTTP/FTP) in oracle?

Posted by Jai on January 21, 2009

Oracle XMLDB uses the ports 2100 FTP/8080 HTTP by default.

– change HTTP port from 8080 to 8082
call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(), ‘/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()’, 8082));

– change FTP port from 2100 to 2102
call dbms_xdb.cfg_update(updateXML( dbms_xdb.cfg_get(), ‘/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()’ , 2102));

– refresh settings
exec dbms_xdb.cfg_refresh;

Posted in Tips&Tricks | Tagged: , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.