Tuesday, December 20, 2011

Custom ADF Skin: Consume as Library

Tested with JDeveloper: 11.1.2.1.0
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.
0000@2728_2728-41266a37beff9ee9
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!
0001@2728_2728-41266a37bfbbbbbc
The following bunch of things is created on the fly
0002@2728_2728-41266a37c0ee2cc1
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.
0003@2728_2728-41266a37c2b9d648
And afterwards click "Apply to Skin"
=> This will generate a lot of images according to your color schema.
0004@2728_2728-41266a37c3487043
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>
=>
0005@2728_2728-41266a37c41b4e82
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
0006@2728_2728-41266a37c59fab0c
The Skin shows up as expected
0007@2728_2728-41266a37c5c8a0ce
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
0008@2728_2728-41266a37c70bc1cd
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
0009@2728_2728-41266a37c7b425ed
e) Create a simple JSF Page based on the threeColumnTemplate and  take a look
0010@2728_2728-41266a37c94320ff
At Design-Time there seem to be some problems.
At Runtime it looks as expected
0011@2728_2728-41266a37cb518a6e
Is it a Bug at Design Time?
Using just a QuickLayout everything is as expected also in design time
0012@2728_2728-41266a37cd2f684c
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

0000@2713_0-41266a23103b2a19

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)



0001@2713_2713-41266a27ed555555



Login in as weblogic user and see the default HTML output



0002@2713_2713-41266a27efb11d34



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



0004@2713_2713-41266a27f2c474d0



Add Accept Header with application/xml



0005@2713_2713-41266a27f36b5493



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

The folowing session was presented today on the german ADF News Session that is driven by the german ADF community.

Although the slides are in german I think the ADF concepts should be well decoupled from the language itself ;)



Similiar Stuff / Links