Monday, November 14, 2011

Are we going to have jQueryMobile RC3 before 1.0?


I have subscribed to jquerymobile blog through Google reader. According to it jQueryMobile RC3 has been released, however this post is not yet available in jQueryMobile.com. Is that mean Google Reader, gives you sneak peek of posts before its been published?
This releases pushes Apex 4.2 since jQueryMobile is not production yet.



Sunday, November 13, 2011

Managing Apex Listener on Apache Tomcat

On my previous post I have blogged about installing Apex Listener on Apache Tomcat. In this post I will cover, creating Admin user for Apex Listener and managing it.

Reference: https://forums.oracle.com/forums/thread.jspa?threadID=2174509&start=15&tstart=0

Open up "tomcat-users.xml" file present in the <Tomcat Home>/conf location.
Add the following lines of code under tomcat-users element.


<tomcat-users>
 <role rolename="Manager"/>
 <role rolename="Admin"/>
 <role rolename="manager-status"/>
 <role rolename="manager-gui"/>
 <role rolename="manager-script"/>
 <role rolename="manager-jmx"/>
 <user username="apexStatus" password="apex Status Password goes here" roles="Manager"/>
 <user username="apexAdmin"  password="apex Admin Password goes here" roles="Admin,manager-status,manager-gui,manager-script,manager-jmx"/>
</tomcat-users>


Restart Tomcat and now you can access Apex Listener using

http://localhost:8080/apex/listenerAdmin

You can as well access administer Tomcat using the same password and following URL

http://localhost:8080/manager/
Perhaps you can use the same to deploy war files



Note: You must access Tomcat directly to gain access. If you are trying to access Tomcat through Reverse Proxy server like ISA or if you have internet facing Apache infront of Tomcat, you will not be able to gain access to Admin module. I learned it in a hard way.

I will blog about connecting to multiple Databases from single Apex Listener seperately.

Thursday, November 10, 2011

Running Oracle Apex Listener on Apache Tomcat

WARNING: This configuration is NOT supported by Oracle. You are risking it on your own.

Even though Oracle doesn't support Tomcat as one of the supported platform for Apex Listener, nothing stops you from trying it. Here are the steps to make it work.
Before you try, I assume you already have an Oracle database running with Apex installed on it.
If not you can download Oracle 11g R2 Express Edition from
http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
and Application Express from http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

1. Download and install Apache Tomcat http://tomcat.apache.org/ I have used Tomcat 6.0 before and for this blog I am going to try it on Tomcat 7.0. I have installed it on "C:\Program Files\Apache Software Foundation\Tomcat 7.0" directory port 8080 on my PC. If you have installed successfully you should be able to access it from your browser using http://localhost:8080/


2. Download Apex Listener from Oracle OTN website.  Latest production version available while writing this blog was Apex Listener V 1.1.3.
http://www.oracle.com/technetwork/developer-tools/apex-listener/downloads/index.html

3. Extract the Apex Listener and copy "apex.war" file to the <Tomcat Home>/webapps directory. In my case "C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps"

4. Open up your browser and start configuring Apex listener by accessing the URL listed below. Type in the password for APEX_PUBLIC_USER, verify database connection options and hit "Apply" button.
http://localhost:8080/apex/listenerConfigure

5. If everything goes well, you should be able to see a page similar to this. Don't freak out, Page is broken just because you haven't finished copying Apex images folder.




6. Tomcat webserver root folder is <Tomcat Home>\webapps\ROOT in my case "C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT". I ended up copying Apex images folder to "i" folder under ROOT since "images" maps to "i" in apex. If you are trying it out in Unix/Linux you can avoid this step by creating a soft link to pointing to the images folder. After copying the images you should be able to access the same page with all the images successfully. If you got it correctly, CONGRATULATIONS, you have just configured Apex Listener on Apache Tomcat successfully.


I will cover Managing Apex Listener on my next blog post.

Tuesday, November 8, 2011

Open up Network access in Oracle 11g in 3 lines of code

If you want to quickly open up internet access to an Database User in Oracle 11g, here is the 3 lines of code you need to execute (Of course as SYSTEM or SYS)


BEGIN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('allow_access.xml','Allows Users to access internet using UTL_HTTP', 'SCOTT', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('allow_access.xml' ,' SCOTT', TRUE, 'resolve');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('allow_access.xml','*');
  COMMIT;
END;
/


This will allow DB User SCOTT to access any websites using UTL_HTTP.

Note: This is not advisable on a production and you may have to restrict access based on website and port.

More details at: http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_networkacl_adm.htm

Thursday, November 3, 2011

Passing User credentials for Web Proxy server in UTL_HTTP

All most all corporates uses Web proxy server to allow their employees to access internet. This way they have great control on who gets to see what site etc. When you try to access a web page using IE it doesn't ask for the network user id and password however Firefox and Safari may ask for the same to send it over to the Proxy server.
UTL_HTTP helps us to consume web resources through PL SQL, it can as well accept Web Proxy Server to connect to the internet. However you will get an access denied error message if your Proxy Server requires user authentication.
You can overcome this by allowing HTTP requests from Database server in your Web Proxy server or by simply passing your user credentials while specifying the Proxy server in UTL_HTTP request like this.


SELECT UTL_HTTP.REQUEST('http://www.google.com','http://<Your Network ID>:<Your Password>@webproxy.yourcompany.com:<Port>') from dual

PS: By default web access using UTL_HTTP access is denied in Oracle 11g onwards. You need to create an ACL to allow the traffic flow through Oracle database.

If you don't know the Web proxy server, contact your network administrator or you can find the same from Internet Explorer Tools->Internet Options->Connections->LAN Settings page. If you use automatic configuration script, type that address directly on your browser and look inside that file to locate your Proxy server.

Finally you have to pass the user credentials to the proxy server and no to the website you are browsing (I often do this mistake).

References: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e25788/u_http.htm#ARPLS71019

Friday, October 14, 2011

My thoughts about Cloud

Recently you might have heard about True Cloud vs False Cloud in Oracle Open World. I am not here to decide whose cloud is true cloud, Oracle vs Salesforce.com, rather trying to define cloud. When I studied computer science in my high school, we used to define "Hardware" as any part of Computer which you can see, feel and touch and "Software" as anything that you can't see, feel and touch like computer progam. Similarly I will define Cloud as something you don't run on your premise and have no idea what the machine is but you consume it through internet. What you guys think?

Wednesday, January 12, 2011

If I am Google what do I know about you

There are alreday posts talks about how much information given out through soical networking sites like facebook.
Has anyone thought about how much Google knows about you?
Atleast I can think of the following.

Name: From your Gmail account.

Date of Birth: From your Gmail account registration

Address : From your google checkout

Phone #: From your google checkout profile

Friends: From your google address book.

Credit card #: Well this as well stored in your Google Checkout profile.

Do you own iPad / iPhone: Well if you had one I am sure you might have accessed your Gmail through the same.

Do you own Mac / Laptop: Same as above.

Whom do you work for: Sounds interesting. If you happened do google search/ access email or other services of google from your work, your computer IP will tell whom do you work for.

Who is your Internet Service Provider: Based on your home computer IP.

Are you working from Home today: If your computer IP address switches suddenly to your work IP address, which means you are working from home as well as you are using your office Computer.

Where did you go last weekend: If you have enabled Google Latitude on your mobile, that can tell you turn by turn directions you took. This can also tell you how do you commute to work.

Your Skill sets: Based on your Google search terms, search results you click, Books you have bought through Google checkout.

Are you looking for Jobs: Based on email alerts you get from monster.com/dice.com mail accounts and if you open it regularly.

Have you got an offer: Well, Google already reads your email for targeted ads. It's just one step further to read an attachment from hr@your-dream-company.com

Bank Accounts you have: Sure enough you will get couple of emails from your Bank. Some times Banks email also contains your Account Balance.

Shares that you own: If you happened to use Google Finance and store your Stock information over there.

What's your blood group: If you store your health information in Google Health.

Friends Tel#: If you use Google Voice to call your friends (Since it is free).

Your Family members: Who ever use your Computer, if you think everyone has their own, still you need to share the same internet connection. Oops that will also tell Google how many Computers you have.

Well I talked a lot about what they know. It's time to dream about what they don't know. Got it. Yes that's your dream. Thank God it doesn't communicate anything over the internet and that's the only thing no one knows except YOU.