Modify or Extending the Shell Template in Oracle ADF – techartifact

Requirment – To modify the template that can be UI shell template or Dynamic Shell template or Any other template which in form of jar in your application

Solution- In one of the requirment i have to create binding for panelspiltter in the template.jspx which in template.jar . I have unjar it modify and implemented the changes and again made to jar.

XXX.jspx in oracle-page-templates-ext.jar. Below is the step by step procedure to do this:

Copy the oracle-page-templates-ext.jar from %MiddlewareHome%\jdeveloper\adfv\jlib\ folder
Create a new folder in drive C like C:\temp\jdev\ and paste the copied jar.
Extract the contents of the jar.Open command prompt and navigate to the C:\temp\jdev folder

You can change the folder by “cd” command
For going to parent folder you can use “cd ..” .
Enter the below command for unjar :

 
jar xf oracle-page-templates-ext.jar 

or 

jar xf JarName.jar 

 

If you that jar command cant recogzied then we need to add the java bin folder path into the “Path” system variables. Ex. “C:\Oracle\Middleware\jdk160_24\bin;”
You can do by right the my computer and go to properties ,go to advance tab .Seach path variable and edit and add this above path as well

If this command work well. then you need to delete the existing jar from temp folder you created. We do this so that we can easily repack a jar later.
Open the jdevloper and open that XXX.jspx . modify or whatever changes you want to make do it.save and close it.Repackage the file in a jar. Open a command prompt navigate to the temp folder we created earlier then run the following command:
Now you have to pack as a jar .Use this command

 
jar cfM0 oracle-page-templates-ext.jar *    
0 (Zero)

or
or 

jar cfM0 JarName.jar 

You can give the jar a different name if you like.Now you will Modify libraries and classpath. Open your application in JDeveloper.Right-click your ViewController project and click project properties.Remove the existing Templates in the classpath entries.Add the jar file that we created in the step above.

Happy Learning with Techartifact

Intoduction to JAR,EAR and WAR files in java

JAR is java arcihve file.It contain all class file,image,sound and other files which will needed in whole application. Computer users can create or extract JAR files using the jar command that comes with the JDK. They can also use zip tools. The JavaTM Archive (JAR) file format enables you to bundle multiple files into a single archive file. jar was designed mainly to facilitate the packaging of java applets or applications into a single archive.

jar cf jar-file input-file(s)

The options and arguments used in this command are:
• Use c option  to create a JAR file.
• jar-file is the name of your  JAR file. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extension,it is mandatory any way.

The command for viewing the contents of a JAR file is:

jar tf jar-file
An Example
Let’s use the Jar tool to list the contents of the vinay.jar file we created in the previous section:
jar tf vinay.jar
EAR -An Enterprise Archive file represents a J2EE application that can be deployed in a Web Sphere application server. EAR files are standard Java archive files and have the file extension .ear. EAR file contain ejb, web or application client module. ear file is complete j2ee application file that contain all(jar +war)
WAR -Web Archive (WAR) file is a Java archive file used to store jsp,servlets,classes,meta data information,images and
Sound and tag libararies etc. Its standard file extension is .war. WAR files are used to package Web modules. A WAR file is for a Web application deployed to a servlet/jsp engine.

In shot we can say
EAR = WAR(Web module) + JAR(can be EJB module or application client module)

for more information check this one -http://java.sun.com/docs/books/tutorial/deployment/jar/build.html