Saturday, November 17, 2007

LDAP Structure

LDAP directory servers store their data hierarchically.

Why break things up into a hierarchy? It is easier in relationships understanding , You may wish to grant permissions to a group of individuals based on the directory structure and Combined with replication, you can tailor the layout of your directory structure to minimize WAN bandwidth utilization.

DN (Distinguish Name) it is The top level of the LDAP directory tree is the base, referred to as the "base DN." A base DN usually takes one of the three forms listed here.

Let's assume I work at a US electronic commerce company called FooBar which is on the Internet at foobar.com

1- o="FooBar, Inc.", c=US (base DN in X.500 format)
O refers to the organization, C refers to company headquarters.

this was the preferred method of specifying your base DN but these days, most companies are (or plan to be) on the Internet. And what with Internet globalization, using a country code in the base DN probably made things more confusing in the end. In time, the X.500 format evolved into the other formats listed below.

2- o=foobar.com (base DN derived from the company's Internet presence)
This format is fairly straightforward, using the company's Internet domain name as the base.

3- dc=foobar, dc=com (base DN derived from the company's DNS domain components)
this format is split into DC(domain components): foobar.com becomes dc=foobar, dc=com.
In theory, this could be slightly more versatile, though it's a little harder for end users to remember. And it is the most recommended format.

Underneath your directory's base, you'll want to create containers that logically separate your data. most LDAP directories set these logical separations up as OU entries. OU stands for "Organizational Unit," which in X.500 was used to indicate the functional organization within a company.

LDAP directory tree (not including individual entries) might look like this:
dc=foobar, dc=com
ou=customers
ou=asia
ou=europe
ou=usa
ou=employees
ou=rooms
ou=groups
ou=assets-mgmt
ou=nisgroups
ou=recipes

Individual LDAP records

All entries stored in an LDAP directory have a unique "Distinguished Name" or DN.

* The DN for each LDAP entry is composed of two parts: the Relative Distinguished Name (RDN) and the location within the LDAP directory where the record resides.

The RDN is the portion of your DN that is not related to the directory tree structure. Most items that you'll store in an LDAP directory will have a name, and the name is frequently stored in the cn (Common Name) attribute.

Since nearly everything has a name, most objects you'll store in LDAP will use their cn value as the basis for their RDN.

Friday, November 16, 2007

Information Directory and LDAP Chitchat

The LDAP can enable almost any application, running on almost any computer platform, to obtain information from your LDAP directory. And that directory can be used to store a broad range of data: email address and mail routing information, HR data, public security keys, contact lists, and much more.

What is the directory (information Directory)?

A directory is a way of organizing information so that you can find it easily. It lists Objects .for example, people, books in a library, merchandise in a department store—and gives details about each one.

A directory is a specialized database that stores collections of information about objects. These collections of information are called entries, and they make up the individual building blocks of the directory. A directory might contain entries about, for example, employees, their job titles and salaries.

While a directory is a type of database, it is designed very differently from a relational database. For example,

1- Typical use of a directory involves a relatively small number of data updates, and a potentially very large number of data retrievals. By contrast, typical use of a relational database involves continuous recording of transactions, but retrievals are done relatively infrequently, when, for example, an employee needs to generate a monthly report. In short, a directory is designed to be primarily read-focused, in contrast to a relational database that is primarily write-focused.

2- Directories also differ from relational databases in that they use relatively simple transactions to store and retrieve relatively small units of data—for example, an e-mail address, a telephone number, or a digital portrait. By contrast, a relational database is designed to handle large and diverse transactions using large data items and many operations so LDAP directories are not well suited for storing data where changes are frequent.

3- In a directory, each entry is associated with a unique distinguished name that identifies it across multiple servers and administrative regions. Because they are inherently global, directories can provide users and applications with “location independence,” making identical information transparently available throughout the system.

4- Directory allows you to securely delegate read and modification authority based on your specific needs using ACIs (collectively, an ACL, or Access Control List). For example, your facilities group might be given access to change an employee's location, cube, or office number, but not be allowed to modify entries for any other fields.

Notes:

- Don’t even think of using it as a database back end for your high-volume e-commerce site .

- LDAP is used to access this Directory information by easily and standard way and The directory is known as an LDAP directory.

What is the LDAP?

LDAP (Lightweight Directory Access Protocol) is based on the X.500 standard, but significantly simpler and more readily adapted to meet custom needs. LDAP is especially suited for deployment with Internet-centric because it support TCP/IP, "thin-client" applications.

So LDAP isn't a database at all, but a protocol used to access information stored in an information directory ( LDAP directory).

The LDAP protocol is both cross-platform and standards-based, so applications needn't worry about the type of server hosting the directory.

Note:
Oracle Internet Directory implements (OID) Version 3 of LDAP, which was approved as a proposed Internet Standard by the Internet Engineering Task Force (IETF).where that the OID is directory service implemented as an application on Oracle Database to enable retrieval of information about dispersed users and network resources.

When should you use LDAP to store your data?

If the answer to each of the following questions is Yes, then storing your data in LDAP is a good idea.

1- Would you like your data to be available cross-platform?
2- Do you need to access this data from a number of computers or applications?
3- Do the individual records you're storing change a few times a day or less, on average?
4- Does it make sense to store this type of data in a flat database instead of a relational database? That is, could you effectively store all the data for a given item in a single record?

Reference:
Summarized from an Introduction to LDAP -
Michael Donnelly
http://www.ldapman.org/articles/intro_to_ldap.html

Wednesday, April 11, 2007

Oracle BPEL Process Manager Client API

We did not find direct WebCenter way to access the BPEL process, but we found API “Oracle BPEL Process Manager Client API”.

This API support invoking the BPEL Process programmatically via a Java Code. The API is slightly different depending on whether you are invoking a two-way operation (which has both input and output messages) Synchronous proces or a one-way operation (which just has an input message and returns no result) Asynchronous process .

So this API provides to us two services Post Service and Request Service where its using depends on the type of BPEL process.

Asynchronous BPEL Process:
It provides only initiate operation which has input without output so we use post function to access this Operation.

Synchronous BPEL Process:
It provides only also Process operation which has input and out put so we use request function to access this operation.

**********************************************************************
How we use this API?


1- Setting the configuration for connecting to Oracle BPEL Process Manger.
Hashtable jndi = new Hashtable ();
jndi.put (Context.PROVIDER_URL, "opmn:ormi://10.10.2.141:6003/orabpel");
jndi.put (Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
jndi.put (Context.SECURITY_PRINCIPAL,”oc4jadmin”); // username of Bpel Manager
jndi.put (Context.SECURITY_CREDENTIALS,”welcome1”); //password of BPEL Manager
jndi.put ("dedicated.connection",”true”);

Locator = new Locator (“default”,”welcome1”); // default is the domain Name and welcome1 is the
Password of the domain.

deliveryService = (IDeliveryService) locator.lookupService (IDeliveryService.SERVICE_NAME);

Locator class: used to connect to the domain on the BPEL Process Manager and fetch a list of BPEL processes deployed on that server. In this case, we use the Locator class to return a handle to an IDeliveryService instance.
IDeliveryService Interface: used to invoke/initiate BPEL processes deployed on a BPEL Process Manager.

2- Passing XML messages via Java.
String SchemaInputXML = "" +
" ererer " +
" dgfdggdg " +
"
";
nm = new NormalizedMessage ();
nm.addPart ("payload", SchemaInputXML);


NormalizedMessage class: construct an XML message, construct an input message for request or construct an Output Message for response.

3- Invoking the operation.

Invoking Synchronous Process:
It call process operation which return output message and need input message
So we use the IDeliveryService.request () methods to access this process.

NormalizedMessage res = deliveryService.request ("userBPEL", "process", nm);
// userBPEL is Process Name and process is operation method name and nm is the input message.

Invoking Asynchronous Process:
It call initiate operation which need input message and does not return output so
We use IDEliveryService.post () method to access this process.

deliveryService.post (“userBPEL”,”initiate”, nm);

**********************************************************************
How to retrieve the Result?

Synchronous process:
It is easy to retrieve the result using normalizedMessage object as we saw in the synchronous invoking.

Asynchronous process:
It is not easy to get the result but we can inform the user of the process by making the Process send JMS Message or email (I did not try it ...I just read it) Or using conversation ID to identify the process instance before posting and after that use this ID to identify a specific instance and retrieve status information from it .

String convId = GUIDGenerator.generateGUID();
nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
deliveryService.post(processID,operationName, nm);
IInstanceHandle fg = (IInstanceHandle)locator.lookupInstanceByConversationId(convId);

**********************************************************************
What we need to use this API?

oc4jclient.jar, Orabpel-common.jar and Orabpel.jar

Tuesday, April 3, 2007

WebCenter View


What is the Webcenter Suite?

It is new platform for building effective Application by supporting:
- User Interaction (portlet , Search , Content , Mobile ,VOIP, Desktop )
- System Management .
- Development Tools .
- Identity Management .


WebCenter Framework

· Portlets:
it supports using some built-in portlets which are available through a preconfigured OC4J that is automatically available to us through JDeveloper (OmniPortlet, Web Clipping, Rich Text portlet) , creating our own standards-based portlets to be consumed by any JSR 168 or WSRP-compatible portal ( where WSRP is Portal Developer Kit (PDK) plus some portlet capabilities )

· Customizable Components :
It provides new JSF components that allow developers to make any of their applications runtime customizable, with these capabilities in place; administrators can customize virtually any JSF page by minimizing/maximizing, hiding/showing, or moving any component on the page.

· Content Integration:
It support integration for content Management System such as Oracle Content DB, OracleAS Portal—or even on your file system— with our application by providing the JCR adapters or oracle adapter .

· Security:
The ADF extensions can define security for the application by defining security for an entire application, a page within the application, or for individual actions provided by customizable components.

WebCenter Services

WebCenter Services offer a variety of content management, search, and
Communication services, including:

· Oracle Content Database which is a full-fledged content management system
enables users to manage content through the Web or from desktop applications.

· Oracle Secure Enterprise Search that can search a multitude of sources, structured
and unstructured, in a variety of file formats, indexed or real-time.

· Communication Services, which help you better connect people and facilitate
Communication, these services include (Instant Messaging, Presence Server, and
Discussion forum).

· Wiki is server software that allows users to freely edit and create Web page content
using a Web browser. This ease of interaction and operation makes Wiki an
effective tool for collaborative communication.










Wednesday, February 28, 2007

know yourself "Funny Test"

look up your BirthDay and see what you are ..


*** BirthDay ***

January :
01 - 09 ~ Dog
10 - 24 ~ Mouse
25 - 31 ~ Lion
February:
01 - 05 ~ Cat
06 - 14 ~ Dove
15 - 21 ~ Turtle
22 - 28 ~ Panther
March:
01 - 12 ~ Monkey
13 - 15 ~ Lion
16 - 23 ~ Mouse
24 - 31 ~ Cat
April:
01 - 03 ~ Dog
04 - 14 ~ Panther
15 - 26 ~ Mouse
27 - 30 ~ Turtle
May:
01 - 13 ~ Monkey
14 - 21 ~ Dove
22 - 31 ~ Lion
June :
01 - 03 ~ Mouse
04 - 14 ~ Turtle
15 - 20 ~ Dog
21 - 24 ~ Monkey
25 - 30 ~ Cat
July:
01 - 09 ~ Mouse
10 - 15 ~ Dog
16 - 26 ~ Dove
27 - 31 ~ Cat
August:
01 - 15 ~ Monkey
16 - 25 ~ Mouse
26 - 31 ~ Turtle
September :
01 - 14 ~ Dove
15 - 27 ~ Cat
28 - 30 ~ Dog
October :
01 - 15 ~ Monkey
16 - 27 ~ Turtle
28 - 31 ~ Panther
November:
01 - 16 ~ Lion
17 - 30 ~ Cat
December:
01 - 16 ~ Dog
17 - 25 ~ Monkey
26 - 31 ~ Dove

*** charactersistic ***

a Dog : A very loyal and sweet person.Your loyalty can never be doubted. You are quite honest and sincere when it comes to your attitude towards working. You are a very simple person, indeed. Absolutely hassle free, humble and down-to-earth!! That explains the reason why your friends cling on to you! You have a good taste for clothes. If your wardrobe is not updated with what is trendy, you sure are depressed. Popular and easy-going. You have a little group of dignified friends, all of them being quality-personified.

a Mouse : Always up to some sort of a mischief! The mischievous gleam in your eyes is what makes you so cute and attractive to everyone. You are an extremely fun-to-be-with kind of person. No wonder people seek for your company and look forward to include you for all get-together's. However, you are sensitive which is a drawback. People need to select their words while talking to you. If someone tries to fiddle around and play with words while dealing with you, it is enough to invite your wrath. God bless the person then!

a Lion: Quite contradictory to your name, you are a peace loving person. You best try to avoid a situation wherein you are required to fight. An outdoor person, you dislike sitting at one place for a long duration. You are a born leader, and have it in you how to tactfully derive work from people. You love being loved, and when you receive your share of limelight from someone, you are all theirs!!!! Well, well... hence some people could even take an advantage, flatter you to the maximum and get their work done. So be careful.....

a Cat : An extremely lovable, adorable person, sometimes shy, with a passion for quick wit. At times, you prefer quietness. You love exploring various things and going into depth of each thing. Under normal circumstances you're cool but when given a reason to, you are like a volcano waiting to erupt. You're a fashion bird. People look forward to you as an icon associated with fashion. Basically, you mingle along freely but don't like talking much to strangers. People feel very easy in your company. You observe care in choosing your friends.

a Turtle : You are near to perfect and nice at heart.The examples of your kindness are always circulated in groups of people.You, too, love peace. You wouldn't like to retaliate even to a person who is in the wrong. You are loved due to this. You do not wish to talk behind one's back. People love the way you always treat them. You can give, give and give love, and the best part is that you do not expect it back in return. You are generous enough. Seeing things in a practical light is what remains the best trait of you guys.

a Dove : You symbolize a very happy-go-lucky approach in life. Whatever the surroundings may be, grim or cheerful, you remain unaffected.In fact, you spread cheer wherever you go. You are the leader of your group of friends and good at consoling people in their times of need. You dislike hypocrisy and tend to shirk away from hypocrites. They can never be in your good books, no matter what. You are very methodical and organized in your work. No amount of mess, hence, can ever encompass you. Beware, it is easy for you to fall in love....

a Panther : You are mysterious. You are someone who can handle pressure with ease, and can handle any atmosphere without going berserk. You can be mean at times, and love to gossip with your selected group. Very prim and proper. You like all situations and things to be in the way you desire, which, sometimes is not possible. As a result, you may lose out in some relationships. But otherwise, you love to help people out from difficult and tight spots when they really need you.

a Monkey : Very impatient and hyper!!! You want things to be done as quick as possible. At heart, you are quite simple and love if you are the center of attraction. That way, you people are unique. You would like to keep yourself safe from all the angles. Shall your name be dragged or featured in any sort of a controversy, you then go all panicky. Therefore, you take your >>precautions from the very beginning. When you foresee anything wrong, your sixth sense is what saves you from falling in traps. Quite a money minded bunch you people are!!

Note :
please try to write your comment ,if this probabilistic is equivalent your real characteristic or not (the writing of your characteristic is not important ) that of course if you want .

Monday, February 19, 2007

JasperReports

JasperReport API:

It is a popular open source Java engine which is used for reporting output from many data sources in web and desktop applications .

JasperReports' reports are defined in XML files with an “jrxml” extension which contains of jasperReport , title , pageHeader , detail , pageFooter, band tag element , all of the elements are optional, except for the root jasperReport element.

A jrxml file needs to be compiled , this can be achieved by calling the compileReport() method on the net.sf.jasperreports.engine.JasperCompileManager class .

it needs to be filled with data, this is achieved by calling the fillReport() method on the net.sf.jasperreports.engine.JasperFillManager class which has three parameters an instance of net.sf.jasperreports.engine.JasperReport, a java.util.HashMap containing any parameters passed to the report, and an instance of a java.sql.Connection class .

finally it can be exported to a pdf/Html/xml file , this is achieved by Using :

net.sf.jasperreports.engine.JasperExportManager class and calling exportReportToPdfStream method which create and view the report in output stream 'view in browser' “used with web application” or calling exportReportToPdf method which create the file on the machine without viewing it .
OR
net.sf.jasperreports.view.JasperViewer class and calling viewReport method which create and open the Pdf file .

IReport :


It is used for building Jrxml file better than building it manually .This tool allows users to visually edit complex reports with charts, images, and subreports. iReport is integrated with leading open source chart libraries for java.

Sample code


After creating the jrxml file by Ireport or manually .

// 1- put parameter “examId”
Map parameters = new HashMap();
long examId ;
parameters.put("examId", String.valueOf(examId));

// 2- load and compile report
String jasperJRXMLFileName = “D:/jasperReport.jrxml” ;
JasperDesign jasperDesign = JRXmlLoader.load(jasperJRXMLFileName);
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);

// 3- DB connection
Connection conn = ResourceManager.getConnection();

// 4- fill report
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,conn);

// 5- create/viewing PDF file .
JasperExportManager.exportReportToPdfStream(jasperPrint,servletResponse.getOutputStream());
servletResponse.getOutputStream().flush();
servletResponse.flushBuffer();
OR
JasperExportManager.exportReportToPdfFile(jasperPrint, "reports/simple_report.pdf");
OR
JasperViewer.viewReport(jasperPrint);

JasperReport Requirements :
http://www.jasperforge.org/sf/wiki/do/viewPage/projects.jasperreports/wiki/Requirements

you can visit
http://jasperforge.org/ , http://jasperreports.sourceforge.net/api/overview-summary.html for more details or download





Thursday, February 15, 2007

Security Chit Chat -2-

Before going and talk about the security fields by more details ,We should first view the Types of attacks .

The Attack is any action that compromises the security of information owned by an organization ,One may have two classifications of attacks, according to the form of attack and the effect of this attack.

The Forms of Attack :

A- Interruption:-
An asset of the system is destroyed or becomes unavailable. This is an attack on availability. Examples include destruction of a piece of hardware, cutting communication line.

B- Interception:-
An unauthorized party gains access to an asset. This is an attack on confidentiality.

C- Modification:-
An unauthorized party not only gains access but also change the data. This is an attack on Integrity.

D- Fabrication:-
An unauthorized party inserts false object into the system. This is attack on authenticity.

The Effects of Attack :

Another useful categorization according to the effect of these attacks: passive attacks and active attack.

A-Passive Attacks:-
These attacks are in the nature of eavesdropping on, or monitoring of, transmissions. The goal of the opponent is to obtain information that is being transmitted.

B-Active Attacks:-
Attacks which refer to deliberate modifications made to the message stream . also it can be for the purpose of injecting false message or deleting message.

Wednesday, February 7, 2007

Security Chit Chat - 1 -

Security

It is well known that the world now has been involved in a war. Knowledge is the power. Information value enforces owner to protect it from enemies, the enemy who does not sleep, follows modern and effective techniques, and develops his self too to gain the information :-( .

Usually we define the cryptography science as the way of data protection , it handles from being misused, modified, or even seen but It has not been enough . The increasing value of knowledge and the race between cryptography and cryptanalysis has forced to create a way to remove the suspicion of the data existence “Steganography Science”.

Cryptography is the art or science encompassing the principles and methods of transforming an intelligible message into one that is unintelligible and then retransforming that message back to its original form. It can provide protection against eavesdropping, and also protects against message modification and against injection of false message by making it infeasible for an opponent to create cipher text that will be deciphered into accept meaningful plaintext.

Steganography is the art and science of writing hidden messages in such a way that no one apart from the intended recipient knows of the existence of the message; this is in contrast to cryptography, where the existence of the message itself is not disguised, but the content is obscured.

So, for those two important science, how to combine them together in a powerful system to protect your data using fast and easy technology for data communication?


So the Security is very interesting , useful and worthy field ;-).

Tuesday, February 6, 2007

Jsf and Struts

JSF and Struts

I wanted to put simple summary of different between Jsf and Struts depend only on my little experience .

* Struts :

it is a very popular framework for building web applications , application framework ,representation of the classic Model-View-Controller (MVC) design pattern principles .

Has Actions – Management capabilities, such as Action and DispatchAction which represents all the application requests and dispatches requests to appropriate application components as needed for Controller tier.

Has Form-management capabilities, such as the ActionForm JavaBean that represents the server side state of the input fields on a form, and a validation framework externaliz the configuration of the set of correctness checks to be applied to input field values, plus implement those checks on both the client side and the server side for Model tier.

Has a set of JSP custom tags that can simplify the process of creating the application's HTML markup for the view tier .

Has Tiles framework for layout management, which supports creation of layout templates that can be reused across multiple pages, and thus allows easy modifications to the overall look and feel of an application.

Has Standard configuration "struts-config"file for defining behavior:

- Mapping Action URLs to Action Classes .
- Configuring Action behavior (form bean creation,
validation, return-to-input destination, etc.).
- Mapping Forwards (logical resources) to physical
Pages .
- Defining form beans.

* JSF :

it is a user interface component framework, focuses on the view tier of a Model-View-Controller architecture.

It help to develop the application backend without worrying about HTTP details .

Has Fundamental APIs for user interface components.

Has Event- and listener-model for handling server side events.

Has Value-binding and method-binding-expressions let you bind component properties to objects in your data model and or event handling methods to your business logic, without requiring the components to have any detailed knowledge of the Java classes involved.

Has Converter which is Plug-in for conversion object to string and Validator which is Plug-in for correctness checks on input components

Has Standard configuration "faces-config" file for defining behavior:
- Mapping to Java Bean .
- Configured navigation rules to select the next page(current displayed page , action was invoked, outcome was returned ).



The navigation of Jsf is more clear , easier than struts . JSF provides just the basics for component level validation, while Struts offers a more sophisticated validation mechanism. The important points, though, is that you can code custom validation in JSF if the defaults aren't good enough for your application And all Jsf validation (standard ,Custom or backing beans ) has it’s own phases which stop the Jsf lifecycle competence during failure and also stop your application following . so code and handle all the validation in your business logic if this is not suitable to your application logic .

Which Technology Should I Use?

it may be a good idea to do the Struts-JSF integration library if the application is big and complex. If it's small, it's pretty straight forward to migrate all of it to JSF in one shot J , For a complex user interface the Jsf migration will be better (at least if you're still making user interface changes now and then). For an application with a simple user interface (e.g., mostly simple dynamic output rather than a lot of complex input), or an application that's rarely changed is not important to migrate it to Jsf .