WebLogic, ADF, Mobile, JET, SOA, WebCenter, JDeveloper, Oracle Cloud
Tuesday, December 20, 2011
Custom ADF Skin: Consume as Library
Main purpose of this post is for me to have a reference project and proof of concept using an ADF Skin as Library.
Part 1: Skin Application
So first the ADF Skin project should be created. Since JDevR2 this process has been simplified by new ADF Skin wizard.
In the next screen just give your skin a name and extend from the fusionFx-simple-v2.desktop Oracle Skin. It is specially designed with extensibility in mind for cusom skins. Fortunataly the recommended skin is selected. (It is not with every ADF/Jdeveloper feature ;). So well done Oracle!
The following bunch of things is created on the fly
Now lets create a "green" skin with smallest amount of modifications. This is achieved by opening the CSS file and
go to the "Images" View. Just change some of the colors.
And afterwards click "Apply to Skin"
=> This will generate a lot of images according to your color schema.
In order to support versioning of skin I am adding the following to the trinidad-skins.xml
<version>
<name>v1</name>
<default>true</default>
</version>
=>
Now we are ready to bundle the custom skin as ADF library. There is nothing special here. Create the Deployment profile, keep defaults and deploy.
Next step is to test the provisioning of the ADF Skin through ADF Library through File System connection. To do that we create a filesystem connection in the resource pallete
The Skin shows up as expected
Part 2: Consume ADF Skin
a) Create an pure empty Fusion ADF Application by wizard.
b) Select the ViewController project
c) Select adflib-myskin.jarm Right Click and Click add to Project
The Message Pane should output something like
These ADF Library jar items are now in ViewController.jpr
{
file:/C:/ak/JDeveloper/mywork/TestADFSkin/MySkin/deploy/adflib-myskin.jar
These are in the project as a result of your ADF jar imports:
Resource Bundle Variable Resolver from .../TestADFSkin/MySkin/MySkin.jpr
}
d) Apply custom ADF Skin as default in Project Properties>ADF View
e) Create a simple JSF Page based on the threeColumnTemplate and take a look
At Design-Time there seem to be some problems.
At Runtime it looks as expected
Is it a Bug at Design Time?
Using just a QuickLayout everything is as expected also in design time
Download Sample Workspaces: http://www.box.com/s/h8mggth460ntujhg7o3r
Tuesday, December 13, 2011
RESTful Management Services in Oracle WebLogic Server 12c
Version: 12.1.1 (developer edition, ZIP, no installer)
Installation
unzip wls1211_dev as follows
In order to be able to work with this edition we have to call configure.cmd. This basically unpacks all jars, create the registry.xml and wlserver\.product.properties
To have some reusable snippets I have created additional scripts in the new MW_HOME
env_wls12c_dev.cmd
@echo off
@rem ***************************************************************************
@rem This script is used to set the environment for
@rem Oracle WebLogic Server 12.1.1 dev ZIP edition
@rem ***************************************************************************
set MW_HOME=C:\oracle\product\12.1.1\middleware
set JAVA_HOME=C:\oracle\product\11.1.2.1\middleware\jdk160_24
set JAVA_VENDOR=Sun
install_wls12c_dev.cmd
@echo off
@rem ***************************************************************************
@rem This script is used to install Oracle WebLogic Server 12.1.1 dev ZIP edition
@rem ***************************************************************************
call env_wls1211_dev.cmd
title Installing WLS 12.1.1.0...
call %MW_HOME%\configure.cmd
pause
Now execute install_wls12c_dev.cmd
In order to create a domain by configuration wizard
a) call env_wls12c_dev.cmd
b) %MW_HOME%\wlserver\common\bin\config.cmd
RESTful Management Service API
Sounds cool...lets try
Activate by Domain > Configuration > Advanced Configuation > Enable RESTful Management Services
=> (restart required)
After restart you will notice the following in the output
INFO: Scanning for root resource and provider classes in the packages:
weblogic.management.rest.resources
weblogic.management.rest.provider
13.12.2011 00:03:13 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class weblogic.management.rest.resources.ApplicationResource
class weblogic.management.rest.resources.TestResource
class weblogic.management.rest.resources.ClusterResource
class weblogic.management.rest.resources.DataSourceResource
class weblogic.management.rest.resources.ServerResource
13.12.2011 00:03:13 com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Provider classes found:
class weblogic.management.rest.provider.CollectionResponseXmlProvider
class weblogic.management.rest.provider.ItemResponseJsonProvider
class weblogic.management.rest.provider.CollectionResponseJsonProvider
class weblogic.management.rest.provider.CollectionResponseHtmlProvider
class weblogic.management.rest.provider.ItemResponseHtmlProvider
class weblogic.management.rest.provider.ItemResponseXmlProvider
13.12.2011 00:03:14 com.sun.jersey.server.impl.application.WebApplicationImpl _i
nitiate
INFO: Initiating Jersey application, version 'Jersey: 1.9 09/02/2011 11:17 AM'
(=> This is good news! It states that some RESTful service will be available.)
After Restart open http://localhost:7001/management/tenant-monitoring/servers
(the authorized users must be in the group Administrators or Monitors)
Login in as weblogic user and see the default HTML output
If you e.g. need better proccessable formats, JSON and XML are of course also supported. Let's see how it is done and what it looks.
Add Accept Header with application/json
Add Accept Header with application/xml
Currently there is REST support for Servers (all in a domain or specific one), Clusters ( all in a domain or specific incl server members), applications (all in a domain or specific app), data sources (all in a domain or specific).
With these capabilities it' possible to implement a custom monitoring solution. A slim mobile wls monitoring app (and more)! => Hands on;)
See doc for details of all available RESTful-Services in WLS12.1.1 http://docs.oracle.com/cd/E24329_01/web.1211/e26722/toc.htm
Collected Documentation links
Overview OTN: http://www.oracle.com/technetwork/middleware/weblogic/documentation/index.html
WLS 12c Data sheet: http://www.oracle.com/us/products/middleware/application-server/oracle-weblogic-server-ds-1391360.pdf
WLS 12c online Documentation Library: http://docs.oracle.com/cd/E24329_01/index.htm
Usind RESTful Services With WLS 12c: http://docs.oracle.com/cd/E24329_01/web.1211/e26722/toc.htm
Dislikes
- Still many BEA* stuff in diffrent scripts. It would be nice to have a clean and straight product without any historical garbage.
- configure.xml : ProgramGroupName=BEA WebLogic Platform 10.3 (Integrated Build)....
Why there is still the need to have a programm group called "BEA WebLogic Platform 10.3"?
My suggestions: Oracle WebLogic Platform 12.1.1 or Oracle Fusion Middleware Platform 12.1.1, everythin else, but not 10.3!
Like
- Java EE 6 Support. (It took a long time..)
- Better Maven Support
- RESTful Management Service
- ZIP distribution. Although the file is called wls1211_dev.zip it is possible to create a domain in production mode by the configuration wizard. At least in a simple testdrive it worked for me.
-Startup time feels better than wls11g
- more to test...(-Dservertype=wlx to avoid loading EJB, JMS, JCA )
Friday, December 9, 2011
ADF News Session (german) - Integration of BI Publisher into ADF Applications
Although the slides are in german I think the ADF concepts should be well decoupled from the language itself ;)
Similiar Stuff / Links
- Consulting Services by TEAM: Oracle ADF und Oracle BI Publisher
- YouTube: ADFTalk - Integration of PL/SQL in ADF Applications
- Twitter: @adftalk (demnächst noch mehr Content) @teamblog @pad_ora @teampaderborn @multikoop
- [german] Oracle ADF Community
- [german] Oracle ADF Community bei XING
- ADF Enterprise Methodology Group
Saturday, November 26, 2011
ADF: Panel Tabbed Inter-Region Communication through shared bean datacontrol
Use Case
- JSF Page with two tabs (Departments, Employees)
The DepartmentName is rendered as a command link. If the user clicks on a DepartmentName the view changes on to the Employees Tab and filters the data
- In each tab there is an static adf region (bound to fragment based BTF)
- DepartmentName as command link
- View switches to the Employees Tab
- Tab text should change to “Employees (<DepartmentName>)
- On the employees tab - of course – only the corresponding entries should be displayed
- The employees tab contains a button to remove the “global” filter.
How to do it?
Create DataExchange Bean as followspublic class DeptEmpExchange {
private Number deptId;
private String deptName;
public DeptEmpExchange() {
super();
System.out.println("DeptEmpExchange created " + this);
}
public void setDeptId(Number deptId) {
this.deptId = deptId;
}
public Number getDeptId() {
return deptId;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getDeptName() {
return deptName;
}
/**
* Exposed as DC Operation.
* Called from the dept btf
* @param deptId
* @param deptName
*/
public void onDepartmentChange(final Number deptId,
final String deptName) {
System.out.println("onDepartmentExchange called: " + deptId + "/" + deptName);
setDeptId(deptId);
setDeptName(deptName);
View1Bean view1 = (View1Bean)JSFUtils.resolveExpression("#{View1Bean}");
view1.getEmpTab().setDisclosed(true);
view1.getDeptTab().setDisclosed(false);
view1.setEmpTabText("Employees ("+deptName+")");
AdfFacesContext.getCurrentInstance().addPartialTarget(view1.getPanelTabbed());
}
And expose as JavaBean DataControl.
Now, on depts page fragment: drop the exposed operation onto the command link and provide the parameters from the current row.
The refresh of the panel tabbed is done programmatically in the onDepartmentChange(..) method. In order to refresh the emp btf with the new dept id configure the following bindings / properties on the main page
- create an attribute binding on the deptId from the DeptEmpExchange Bean.
- bind the tf input parameter to the attribute binding
- do not forget to set refresh=ifNeeded => this causes the btf to refresh in case the input params will change.
Implementing the “remove global filter” functionality is pretty simple. Just drag the onDepartmentChange-Operation from the data control palette on to the toolbar and adjust the text.
I hope I have not forgotten any important steps.
Download JDev11112Workspace
Update on Dec 19th 2011: Added Sample Application
Thursday, November 24, 2011
ADF Faces: Navigate on Checkbox selection
Used in Version: 11.1.1.2
As you may have noticed there is no action attribute on af:selectBooleanCheckbox. So how could you trigger a navigation case if user changed selection state of the checkbox.
In a customers scenario I need to trigger a navigation in a BTF from a checkbox insige a jsff
<af:selectBooleanCheckbox label="Klick me" id="sbc1"
selected="#{MyBean.selected}"
autoSubmit="true"/>
MyBean.java looks like
public void setSelected(String value) {
final FacesContext context = FacesContext.getCurrentInstance();
if ("true".equalsIgnoreCase(value)) {
// checkbox is selected
context.getApplication()
.getNavigationHandler()
.handleNavigation(context,null,"selected");
return;
}
// checkbox is not selected
context.getApplication()
.getNavigationHandler()
.handleNavigation(context,null,"notSelected");
}
Tuesday, November 22, 2011
ADF Talk on Youtube started
Today Ulrich and me started a series of sessions on ADF Topics.
In ADF Talk Session 1 we are introducing a way to integrate PL/SQL Code into ADF fusion applications. The video shows the usage of custom jdeveloper extension: TEAM Application Module from Database Package. See it in action.
Monday, November 21, 2011
My DOAG 2011 Slides – Upgrade Guide for Oracle ADF on WebLogic Server
Hopefully someone will find it useful. At the conference there were just too few attendees…
http://www.slideshare.net/multikoop/doag-2011-upgrade-guide-for-oracle-adf-on-weblogic-server
Friday, November 11, 2011
ADF 11.1.2.1 - clicktoedit table, createinsert, rollback bug?
ADF version: 11.1.2.1
Firefox: 5.0
Prerequistes
-Using ADF BC
-Create the most simple jsf page declarativly (no custom java code)
--table features: single selection, sorting, filtering
--change table attributes: editingMode=clickToEdit
Steps to reproduce
1. start http://127.0.0.1:7101/TestInsertIntoClickToEditTable2-ViewController-context-root/faces/view1
[notice the yellow marked rows.]
2. Now Click on CreateInsert
OK, new row is inserted and can be edited now.
3. Click on Rollback-Button (or Execute-Button)
What happened to the last two rows?
Further issue: clicktoedit not working on some rows
You may click as often you want. The row won't change into edit mode. In the log window you will see
<FacesCtrlHierBinding$FacesModel> <makeCurrent> ADFv: Keine Zeile gefunden für rowKey: [oracle.jbo.Key[191 ]].
Known workaround so far
1. Click the Execute-Button after Rollback.
2. Bind Rollback action to a backing bean method and do the following (Rollback + setActiveRowKey)
/**
* Rollsback and Re-Executes the table iterator
* @param actionEvent
*/
public void onRollback(ActionEvent actionEvent) {
final DCBindingContainer bc = (DCBindingContainer)getBindings();
bc.getOperationBinding("Rollback").execute();
setActiveRowKey(bc);
}
/**
*
* @param bc
*/
private void setActiveRowKey(final DCBindingContainer bc) {
final DCIteratorBinding empIter = bc.findIteratorBinding("EmployeesView1Iterator");
final Row newRow = empIter.getCurrentRow();
final ArrayList activeRowKeyList = new ArrayList();
activeRowKeyList.add(newRow.getKey());
getEmpTable().setActiveRowKey(activeRowKeyList);
}
public BindingContainer getBindings(){
return BindingContext.getCurrent().getCurrentBindingsEntry();
}
Download
Sample Application: http://www.box.net/s/od2t8en8ojo3hho704uz
Similiar issues
http://adfbugs.blogspot.com/2010/03/rollback-does-not-refresh-current-row.html
JDev 11.1.2.1 – Clear WLS Log tab Bug?
Applies to JDeveloper: 11.1.2.1
Problem Description
After starting the integrated WLS from JDev the wls log is displayed in the log tab. Open mouse context menu and “clear” item is not activated
I have no chance to clear the log tab!! Arghh.
Is there any good reason for this behaviour? ( not beeing able to clear the log). The memory consumption is already enormous. Dear Oracle, please let me clear the log tab again…
Never seen this issue in 11gR1 versions.
Is there any workaround?
Saturday, October 8, 2011
[solved] Download offline bc4j-junit_bundle 11.1.2.1 version/download link mismatch
Applies to: JDeveloper 11.1.2.1
Download from: http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/131167.xml#oracle.BC4J.junit
Problem description
Trying to install the downloaded bc4j-junit_bundle offline version as extension I get the following error
Analysis
Open the corresponding bundle ZIP an lets see if it is really wrong version
But as you can see I have downloaded the correct version. So there is a mismatch.
Solution
After further investigating the download link I realized that it just references the old version
http://download-llnw.oracle.com/otn-pub/jdeveloper/11.1.2.0.0/extensions/bc4j-junit_bundle.zip
So let's try to adjust manually the URL und download
http://download-llnw.oracle.com/otn-pub/jdeveloper/11.1.2.1.0/extensions/bc4j-junit_bundle.zip
é voilà now the installation works fine as well
[solved] JDeveloper - Install Extensions offline / licences check issue
Applies to: JDeveloper 11.1.2.1
Issue
Results in
The impact is that you are unable to install JUnit-Extension in a Workshop Lab e.g. where
you can't assume that the attendees have an internet connection
Workaround
Because we are quite smart let's workaround....
Open Bundle with your favourite archiver tool
and remove or comment out the following line
<u:requires-agreement url="http://junit.sourceforge.net/cpl-v10.html" />
Save change and Update Archive.
Import extension again.
=> No license check requirement shows up. Yeeeees we can!
Monday, October 3, 2011
Upgrade Oracle Team Productivity Center to 11.1.2.1 / Hudson Plugin
From Version: 11.1.1.5
To Version: 11.1.2.1
Prepare
Check the content of the current otpc schema
SQL> select * from otpc_version t;
ID DB_UPGRADE_NUM DB_VERSION VERSION
-------------------- -------------------- ---------------------------------------------------------------- --------------------
1 2 11.1.1.5.37.60.13 1
Download tpcinstaller.jar from OTN
Installation
Start new installer
jar -jar tpcinstaller.jar
Click Next
Great: The installer recognized everything, so you really can expect the installation process will do the right thing
Choose: NExt
Point to the autodeploy directory of the privious installation. If you just point to the DOMAIN_HOME Location you will get an exception:
TPC-90026: The otpc.war of current installation for upgrade is missing in the server deployment directory
(Enhencement request: The installer should be smart enough to be able to check for otpc.war in the given domain!)
Choose: Next
Choose: Next
...
...
Upgrade completed. Plus Hudson Plugin installed.
Verify installation/ Upgrade
Verify otpc_version in database schema:
SQL> select * from otpc_version t;
ID DB_UPGRADE_NUM DB_VERSION VERSION
-------------------- -------------------- ---------------------------------------------------------------- --------------------
1 2 11.1.2.1.38.60.81 2
SQL>
Everything worked as expected. Nice.
Lets start weblogic and check if otpc server is running
Seems to run, but (as stated in one of my privious posts) nobody can be sure which version actually is running. Especially from an ALM tool which now integrates with hudson I REALLY CAN EXPECT to see a BUILD-Number here! Dear Oracle, if you are reading this, please log an enhencement request to integrate a build number in the otpc server homepage! Further it would be nice if that homepage lists all installed otpc plugins (plus which version of course). Thanks.
BTW:
After starting the new otpc server a new folder has been created in DOMAIN_HOME
activemq-data
=> Oracle uses ActiveMQ now. I think in order to be able multi app server compatible. And ActiveMQ is obviously tinier than the WLS one.
OTPC Hudson Plugin
Now I am really interessted in how the hudson plugin looks like. So lets start my local hudson sanbox.
java -jar hudson-2.1.1.war -httpPort=8081 (8080 is used by the XE DB)
Observing the Hudson > Plugin Manager > Installed
=> No hints to a newly installed plugin
Looking into Hudson > Plugin Manager > Available
=> Bingo.
(Additional info. The plugin has been put to
$HUDSON_HOME/HudsonTpcPlugin.hpi
by the OTPC installer and not into the $HUDSON_HOME/plugins/ as I would expect.)
Ok, move on
Restart hudson.
The otpc plugin shows up in the installed section of the plugin manager.
So now we can use the plugin in our hudson jobs. Choose your job and configure..
Save changes and run your job.
Check the jobs console output
"The test result(s) Testergebnis will be sent to the Oracle Team Productivity Team Server at http://localhost:7001.
Successfully loggedin."
Thats all so far. Nothing else shows up in your hudson ui ;-(
What's next
Check OTPC in new JDev 11.1.2.1
Let's open an old task repository
Hhhm. let's create a new task repository
Same problem here.
Conclusion
OTPC is still not enterprise ready. OTPC should improve in the following
- Task repository connection does not work in new version! Wow. Where is the mistake? the server logs
WARNUNG: RepositoryServerServiceImpl.getAll() 10/03/2011 17:43:29 MESZ - reposit
ory server 'New Repository Server11121' does not have any parameters by parentN
ame 'REPOSITORY_SERVER.New Repository Server11121.OTCP Task Repository11121'.
03.10.2011 17:43:29 oracle.alminternal.server.core.RepositoryServerServiceImpl g
etAll
- Integration BUILD-Number into otpc server homepage
- List installed connectors on otpc server homepage
- Integrate LDAP vor OTPC Users/Groups. Provide a mapping from those users/groups to OTPC Roles
- Integrate some nice charts in the hudson jobs webpages ;)
Like (in general about OTPC)
- Saving the IDE context for a specific task.!! This really rocks!