Friday, 25 October 2013

Default Theme folder location for IBM websphere portal

Default Theme folder location  for IBM websphere portal



Portal Version
Theme Folder structure
IBM WebSphere portal 6.0
ibm\WebSphere\profiles\wp_profile\installedApps\venky\wps.ear\wps.war\themes\html\IBM
IBM WebSphere portal 6.1

Portal(IBM) Theme

\IBM\WebSphere\wp_profile\installedApps\venky\wps.ear\wps.war\themes\html\Portal
PortalWeb2
IBM\WebSphere\wp_profile\installedApps\venky\wps.ear\wps.war\themes\html\PortalWeb2


IBM WebSphere portal 7.0

PageBuilder theme

<portal-root>/theme/wp.mashup.cc.theme/installedApps/wp.mashup.cc.theme.ear/PageBuilder2.war
Static resources
http://<host>:10039/wps/mycontenthandler/dav/fs-type1/themes/PageBuilder2


IBM WebSphere portal 8.0

Dynamic Content
IBM\WebSphere\PortalServer\theme\wp.theme.themes\default80\installedApps\DefaultTheme80.ear\DefaultTheme80.war
Static content
http://<host>:10039/wps/mycontenthandler/dav/fs-type1/themes/Portal8.0



Note :- venky is  node Name

Difference Between WebApplication And Portal Application

Difference Between WebApplication And Portal Application



SR
Portal Application
Web Application
1
Usually a portal is used to describe a website that acts as an entry point or gateway to an array of services.
A website is a collection of related web pages containing images, videos or other digital assets. It is hosted on at least one web server, accessible via a network such as the Internet or a private local area network through an Internet address known as a Uniform Resource Locator.
2
A portal displays all the content in one place
while information is usually dispersed across a website.
3
Thus a portal is a complete environment for managing and integrating a large number of diverse applications and user repositories across an enterprise wide system. A single administrative interface makes it possible to manage users, applications, content, look, feel and navigation of an entire website. Centralized administration of a huge web based infrastructure is probably the most compelling reason for adopting the portal.
Not Required
4
Personalization
Not Required
5
Customization
Not Required
6
Search
Not Required
7
Collaboration
Not Required

Tuesday, 22 October 2013

Difference between BeanFactory and ApplicationContext in Spring

Difference between BeanFactory and ApplicationContext in Spring




BeanFactory
Application Context
1
Does not support the Annotation based dependency Injection.
Support Annotation based dependency Injection.-@Autowired, @PreDestroy
2
Does not support way to access Message Bundle(internationalization (I18N)
Support internationalization (I18N) messages.
3
Doesn’t support.
Support  many enterprise services such JNDI access, EJB integration, remoting.
4
Does not Support
Application contexts can publish events to beans that are registered as listeners
5
By default its support Lazy loading
its By default support Aggresive loading
6
org.springframework.beans
org.springframework.context
7
BeanFactory factory = new XmlBeanFactory(new FileSystemResource("spring.xml"));

ApplicationContext factory = new ClassPathXmlApplicationContext("spring.xml");


Wednesday, 16 October 2013

What servlet code corresponds to the various scope

What servlet code corresponds to the various "scope" values for the <jsp:useBean> tag




Scope
JSP
Servlet Code
application
<jsp:useBean class="foo.Counter" scope="application" />
foo.Counter counter = (foo.Counter)getServletContext().getAttribute("counter");
if (counter == null) {
 counter = new foo.Counter();
 getServletContext().setAttribute("counter", counter);  
}

Session
<jsp:useBean id="counter" class="foo.Counter" scope="session" />
HttpSession session = request.getSession(true);
foo.Counter counter = (foo.Counter)session.getValue("counter");
if (counter == null) {
 counter = new foo.Counter();
 session.putValue("counter", counter);
}

request
<jsp:useBean id="counter" class="foo.Counter" scope="request" />
foo.Counter counter = (foo.Counter)request.getAttribute("counter");
if (counter == null) {
 counter = new foo.Counter();
 request.setAttribute("counter", counter);
}

page
<jsp:useBean id="counter" class="foo.Counter" scope="page" />
foo.Counter counter = new foo.Counter();

How to make Map As Synchronized



import java.util.HashMap;
import java.util.Collections;
import java.util.Map;

public class SyncronizedMapExample {

  public static void main(String[] args) {
    //create HashMap object
    HashMap hashMap = new HashMap();
 
    /*
      Java HashMap is NOT synchronized. To get synchronized Map from
      HashMap use
      static void synchronizedMap(Map map) method of Collections class.
    */
 
    Map map = Collections.synchronizedMap(hashMap);
 
    /*
       Use this map object to prevent any unsynchronized access to original
       HashMap object.
    */
 
  }
}

Tuesday, 15 October 2013

What are the Portal Default Database and What its purpose




Portal by default uses derby database which have 6 database


Database Name  
Purpose
J
JCR
These schemas store data of shared documents and resources. This data will be modified during runtime.
C
Community
These schemas store data of shared documents and resources. This data will be modified during runtime.
R
Release
These schemas store data of Pages, Portlets, Portlet instances, Themes, Templates, Personalization rules and Policies. This data is not modified during the portal runtime.
F
FeedBack
These schemas store data of Pages, Portlets, Portlet instances, Themes, Templates, Personalization rules and Policies. This data is not modified during the portal runtime.
L
LIKEMIND
These schemas store data of Pages, Portlets, Portlet instances, Themes, Templates, Personalization rules and Policies. This data is not modified during the portal runtime.
C
Customization
This schema stores information specific to users (for example  PortletData).

How Many Roles in Portal





Roles
Work
1
User
Can View Page and Portlet
2
Editor
Perform Customization that many User Can See
3
Manager
Can Delete Pages
4
Delegator
Can Assign Specific Right to Specific User
5
Security Administrator
Can Assign Access Right to Any User
6
Administrator
Can Perform Any Task with in Portal

Tell me Which mode Execute which method in Basic Portlet





MODES
Method
VIEW
doView()
EDIT
doEdit()
editSharedSetting
doEditCustomdefault()
configure
doConfigure()
Help
doHelp()

How Many Portlet Window State

'


There are basically 3 States

1 MINIMIZED
2 MAXIMIZED
3 NORMAL

What are the Port let Modes Provided by Default





There are mainly only 3 Modes are by default
1 VIEW → Normal View
2 EDIT → This Mode is used for user Customization
3 HELP → Providing Help section in Portlet
Rad provide 2 more option while creating Basic portlet but in reality that are Custom Modes and that are
4 EditSharedSetting → Default User Customization
5 Configure → Administrative Console   

Generics in Java

Generic  In Java
1.      Generics
a.       Generics in Java is one of important feature added in Java 5 along with Enum, autoboxing and varargs , to provide compile time type-safety.
b.      Generic in Java is added to provide compile time type-safety of code and removing risk of ClassCastException at runtime which was quite frequent error in Java code,
c.       Generics allows Java programmer to write more robust and type-safe code.
d.      generics expand your ability to reuse code and let you do so safely and easily.

2.      Non Generics Class using Object
a.       This makes NonGen able to store any type of object, as can the generic version
b.      Its not good because following  two reason .
                                                                                       i.      explicit casts must be employed to retrieve the stored data
                                                                                     ii.      many kinds of type mismatch errors cannot be found until run time.
3.      The General Form of a Generic Class
a.       syntax for declaring a generic class:
                                                                                       i.      class class-name<type-param-list> { // ...
b.      syntax for declaring a reference to a generic class
                                                                                       i.      class-name<type-arg-list> var-name =new class-name<type-arg-list>(cons-arg-list);
4.      bounded types
a.       When specifying a type parameter, you can create an upper bound that declares the superclass from which all type arguments must be derived.
b.      This is accomplished through the use of an extends clause
c.       In addition to using a class type as a bound, you can also use an interface type. In fact,
d.      you can specify multiple interfaces as bounds.
e.       a bound can include both a class type and one or more interfaces. In this case, the class type must be specified first.
f.        class Gen<T extends MyClass & MyInterface> { // ...
g.       Here, T is bounded by a class called MyClass and an interface called MyInterface. Thus,any type argument passed to T must be a subclass of MyClass and implement MyInterface.
h.       Syntax
                                                                                       i.      <T extends superclass>
                                                                                     ii.      This specifies that T can only be replaced by superclass, or subclasses of superclass.

5.      Using Wildcard Arguments
a.       The wildcard argument is specified by the ?, and it represents an unknown type.
b.      One last point: It is important to understand that the wildcard does not affect what type of Stats objects can be created. This is governed by the extends clause in the Stats declaration. The wildcard simply matches any valid Stats object.

6.      Bounded Wildcards (Ex. Generic7)
a.       In general, to establish an upper bound for a wildcard, use the following type of wildcard
b.      expression:<? extends superclass>
c.       where superclass is the name of the class that serves as the upper bound
d.      You can also specify a lower bound for a wildcard by adding a super clause to a wildcard
e.       declaration. Here is its general form:<? super subclass>
f.        In this case, only classes that are superclasses of subclass are acceptable arguments. This is an exclusive clause, because it will not match the class specified by subclass.

7.      Creating a Generic Method(Ex Generic8)
a.       it is possible to create a generic method that is enclosed within a non-generic class.
b.      generic methods can be either static or non-static. There is no restriction in this regard.
c.       Generalized syntax
d.      <type-param-list> ret-type meth-name(param-list) { // ...

8.      Generic Constructors (Ex Generic9)
a.       It is also possible for constructors to be generic, even if their class is not.

9.      Generic Interfaces
a.       you can also have generic interfaces
b.      In general, a generic interface is declared in the same way as is a generic class.
c.       In general, if a class implements a generic interface, then that class must also be generic, at least to the extent that it takes a type parameter that is passed to the interface. For example,the following attempt to declare MyClass is in error:
d.      class MyClass implements MinMax<T> { // Wrong!{ // OK
e.       Because MyClass does not declare a type parameter, there is no way to pass one to MinMax.
f.        In this case, the identifier T is simply unknown, and the compiler reports an error. Of course,if a class implements a specific type of generic interface, such as shown here:
g.       class MyClass implements MinMax<Integer> { // OKthen the implementing class does not need to be generic.
h.       Benefit of Generic Interface
                                                                                       i.      it allows you to put constraints (that is, bounds) on the types of data for which the interface can be implemented.
                                                                                     ii.      it can be implemented for different types of data.

i.         Syntax:
                                                                                       i.      interface interface-name<type-param-list> { //
                                                                                     ii.      Here, type-param-list is a comma-separated list of type parameters. When a generic interface is implemented, you must specify the type arguments, as shown here:
                                                                                    iii.      class class-name<type-param-list> implements interface-name<type-arg-list> {

10.  Raw Types and Legacy Codes
a.       Because support for generics is a recent addition to Java, it was necessary to provide some transition path from old, pre-generics code. At the time of this writing, there are still millionsand millions of lines of pre-generics legacy code that must remain both functional and compatible with generics. Pre-generics code must be able to work with generics, and generic code must be able to work with pre-generic code.
b.      To handle the transition to generics, Java allows a generic class to be used without any type arguments. This creates a raw type for the class. This raw type is compatible with legacy code, which has no knowledge of generics. The main drawback to using the raw type is that the type safety of generics is lost.
c.       Generic11
d.      A raw type is not type safe. Thus, a variable of a raw type can be assigned a reference to any type of Gen object. The reverse is also allowed;
e.       Generic Class Hierarchies
11.  Rules of Genrics
a.       Parametrized type like Set<T> is subtype of raw type Set and you can assign Set<T> to Set, following code is legal in Java:

Set setOfRawType = new HashSet<String>();
setOfRawType = new HashSet<Integer>();

b.      Gen<int> strOb = new Gen<int>(53); // Error, can't use primitive type

Very Impotent Links for Java and Portal development development

Jar Download for Spring  Maven Or Gradel Dependency for Spring