Ldap configuration in Jetspeed 2.2.0

Ldap configuration in Jetspeed 2 (JS2) is very easy. Its only two required steps to configure Ldap in JS2.

1) Enable Ldap module
First you need to create “spring-filter-key.properties” under jetspeed/WEB-INF/conf and add the following lines

#Turn on LDAP Security
spring.filter.key = portal.ldap

Spring-filter-key. properties can be used to enable or disable different module of jetspeed.

2) Define Ldap Connection propetries

Jetspeed store all its Configuration settings in jetspeed.properties.

Following are default jetspeed ldap settings
jetspeedldap
First four points are self explanatory.

ldap.context.factory
Jetspeed uses ldap to communicate to ldap server. I think it would not be advisable to changes context factory until its rally required.

ldap.user.filter =

You can define you own object class for users

ldap.search.scope

Ldap search scope refer to searching objects in ldap sub tree. I would suggest not-to change this value

ldap.user.searchBase
ldap.role.searchBase
ldap.group.searchBase
You can define tree location where all you users reside. Once you define user search base of user, Jetspeed will only look for user and there relation under that node.
Search base can be  defined for groups and roles too.

ldap user entryPrefix

In ldap there are different user classes to create user and they have there own different respective schema, So you can choose you can define your own uid prefix

Implementation of thread Pool in java

In my previous post of thread pool (https://www.techartifact.com/blogs/2009/06/what-is-thread-pool-in-java.html),I have given the theoritcal knowledge.now I came with code.Hope it will help a lot.
Java’s implementation of thread pool is based on an executor. Executor is a generic concept modeled by this interface.

Package java.util.concurrent;
Public interface Executor {
Public void execute(Runnable task);
}

You simple have to create the task and pass it on execute() method of an appropriate executor.The pool is an instance of ThreadPoolExecutor class.this class implements ExecutorService Interface which tell how to put task and how to shut down.
Example of creation of thread pool

package java.util.concurrent;
public class ThreadPoolExecutor implements ExecutorService {
public ThreadPoolExecutor(int CorePoolSize,int maximumPoolSize,
                           long keepAliveTime,timeUnit unit,
                          BlockingQueue workQueue);
public ThreadPoolExecutor(int CorePoolSize,int maximumPoolSize,
                           long keepAliveTime,timeUnit unit,
                          BlockingQueue workQueue,
                           ThreadFactory threadfactory);
public ThreadPoolExecutor(int CorePoolSize,int maximumPoolSize,
                           long keepAliveTime,timeUnit unit,
                          BlockingQueue workQueue
                          RejectedExecutionHandler handler);
public ThreadPoolExecutor(int CorePoolSize,int maximumPoolSize,
                           long keepAliveTime,timeUnit unit,
                          BlockingQueue workQueue
                          ThreadFactory threadfactory
                           RejectedExecutionHandler handler);

CorePoolSize , keepAliveTime, are the part by which we can manage the thread pool.we can use a constructor to create the task and put them in thread pool

Now we will create the task and we will put into the threadpool.here it’s the example.

import java.util.concurrent.*;
 public class ThreadPoolTest {
public static void main(String[] args) {
int nTask =Integer.parseInt(args[0]);
long n = ling.parseLong(args[1]);
int tpSize =Integer.parseInt(args[2]);

ThreadPoolExecutor tpe = new ThreadPoolExecutor(tpSize,tpSize,50000L,
                             TimeUnit.MILLISECONDS,new LinkedBlockingQueue());
Task[] tasks = new Task[nTask];
for(int i =0;itasks[i]= new Task(n,"Task " + i);
tpe.execute(task[i]);
}
tpe.shutdown();
}
}

This is implementation of thread Pool.It is easy to use.Any suggestion would be welcome.

Pin it

Common terminology used in oracle ADF

Entity object – ADF entity object are business components that encapsulate the business model, including data, rules, and persistence behavior, for items that are used in your application. Entity object definitions map to single objects in the data source. In the vast majority of cases, these are tables, views, synonyms, or snapshots in a database. It can allow to do DML operation. Advanced programmers can base entity objects on objects from other data sources, such as spreadsheets, XML files, or flat text files.

ADF view object – are business components that collect data from the data source.It represent the single table..It can also be used To create LOV. View object must have process for retrieving data from the data source.Data source is database and process is Sql query. Oracle ADF Business Components can automatically use JDBC to pass this query to the database and receive the result. Like entity attributes, the values of view attributes can be read or changed using the methods getAttribute() and setAttribute() in the ViewRowImpl class or by using generated getters and setters in a custom view row class

View Link – is the relation between the view object on based of a some common view attribute of each view object. Individual instances of view objects can also be related by individual instances of view links, which create a master-detail relationship between the query result sets.

ADF Application Module – are business components that represent particular application tasks. The application module definition provides a data model for the task by aggregating
the view object and view link instances required for the task. It also provides services that help the client accomplish the task

You can use application module in two different ways:
• As a service object, in which case each instance of the MVC application has access to one
instance of the application module. These root-level application module instances control ADF
BC transaction objects, which in turn control the entity and view caches.
• As a reusable object for nesting, in which case you can create a data model and service methods
on it and then nest one of its instances in other application module definitions. Those application
module definitions can, in turn, access the nested module’s methods and data model. Nested
application modules share the root-level application module’s transaction.

SetActionListener – The setActionListener tag is a declarative way to allow an action source ( , , etc.) to set a value before navigation. It is perhaps most useful in conjunction with the “processScope” EL scope provided b ADF Faces, as it makes it possible to pass details from one page to another without writing any Java code. This tag can be used both with ADF Faces commands and JSF standard tags.
Exmaple of this can be as follows. Suppose we have a table “employee”.We want to fetch the salary of an employee of some particular row and want to send this salary in
Next page in process scope or request scope etc.So using this we can do this.
It have two attributes :
From – the source of the value; can be an EL expression or a constant value
To – the target for the value; must be an EL expression

 
        <af:setActionListener      from="#{row.salary}"
                                  to="#{processScope.salary1}"/>              

This setactionListener will pick value of salary of that row and store this value into salary1 variable.So anyone can use this salary
As processScope.salary1 . It is very simple to use. And very useful.

References – oracle ADF development guidelines (pdf)
– www.oracle.com