2011年7月6日 星期三

CSS 應用分享 -- 排版


最近公司的網頁要改版,對於之前都在使用 Flex 開發程式的我來說,CSS是不怎麼熟悉的,
把美編給的圖片排成其想要的畫面真是讓我花了很多時間
有一個部份可以分享的是 div 的應用

div style="position:relative"
      div  style="position:absolute"
      /div
/div


第一個 div position設為 relative 
內部的 div 再設為 absolute,這樣的話,畫面放大、縮小,圖就不會亂跑了
這是最近學到的。


2011年6月22日 星期三

iis更換網站本機目錄的問題

這幾天有發生換了目錄之後,之前所設的虛擬路徑的程式都不能執行,只好全部 kill後再重建,
是我的操作步驟錯誤了嗎 ?

還有一個問題 ,如果網站的asp.net 版本設為 2.0.50724 ,虛擬目錄設為1..1.4322 這樣可以嗎?

希望好心人事可以回答

2011年4月1日 星期五

Oracle 全文檢索

參考文章
http://space.itpub.net/13379967/viewspace-474767
oracle全文檢索(oracle text)
http://winie.javaeye.com/blog/663835
http://hi.baidu.com/lzycsd/blog/item/f083473835da4f2897ddd878.html
1.

create table WT_LIGHTING_S_INDEX
(
  SOURCE_ID   NUMBER,
  ID          NUMBER,
  DESC1       VARCHAR2(4000),
  CREATE_DATE DATE
)


2.ctx_ddl.create_preference ('lighting_lexer', 'chinese_lexer');

3.CREATE INDEX wt_lighting_index ON WT_LIGHTING_S_INDEX(DESC1)

indextype is ctxsys.context parameters('lexer lighting_lexer');

alter user lighting quota unlimited on users;

 GRANT EXECUTE ON CTXSYS.CTX_DDL 

2011年1月18日 星期二

OpenSSO (OpenAM) web service security 資源

http://www.stormacq.com/?p=385

這個文章的部份內容,因為還沒實作,怕這個網站消失不見,所以就先截取下來了。


An Open Source implementation is also available from ForeRock’s OpenAM.
To summarize, a Secure Token Service is a third-party broker where Web Services clients can authenticate and receive a security token to be sent to a Web Service Provider.  The Web Service Provider will, in turn, validate the token and to evaluate authentication and authorization decisions.
The best STS description / tutorial I found on the web is on a deprecated page of Microsoft’s MSDN.  If you don’t know about STS, I highly recommend to read this serie of articles.
After installing / setting up OpenSSO / OpenAM, you will be ready to configure the STS part.
There are three approaches to interact with STS Server

Approach #1 – STS’s WSDL definition

This is the platform agnostic approach.  Just rely on STS’s WSDL definition to generate whatever client code you will need.
Unfortunately, on Java SE 6, this approach fails because of incompatibilities in OpenSSO’s STS WSDL definition and JAX-WS.
ForgeRock’s community is tracking this issue under Bug ID 287 and Bug ID 306
Stay tuned on ForgeRock’s JIRA for more details on this approach.

Approach #2 : Using JAX-RPC and JSR 196 provider

JSR 196 is a SPI specification allowing to hook a filter inside a container.  This filter will be invoked for all incoming and outgoing JAX RPC call, allowing it to be used for logging or security purposes for example.
OpenSSO and OpenAM do provide a JSR 196 provider for web service authentication (JSR 196) and authorization (JSR 115).  This provider is able to work with an STS provider.  The provider is available as part of openssowssprovider.jar JAR file.
While a little cumbersome to configure, this approach is working out of the box.  As long as you strictly follow the documentation.  Thesetroubleshooting steps will probably be useful as well.
However, this approach has a major drawback : it is JAX RPC based, i.e. quite old, now that the (Java) world has embraced JAX WS.  In other words, Oracle only supports this when the web service provider and the web service consumer are deployed into a GlassFish v2 instance.
So, if you want to use JAX WS, you will require a little more work.

Approach #3 – JAX WS

JAX-WS also provides hooks to intercept outgoing and incoming SOAP requests.  These hooks are named “Handler“.
The good news about Handlers is that they are web-app specific, unlike JAX-RPC JSR 196 provider which are installed at container level; hence for all your web applications.
You can think of an Handler as a Servlet Filter, dedicated to web service calls.  They can be part of a web app, to protect web services providers, or stand alone client, to protect web service consumers.  IBM has a very good documentation about using Handlers with JAX WS web services.
To test OpenSSO / OpenAM STS service with JAX WS handlers, I suggest you to read this tutorial.
All in all, this is an excellent step by step article, covering deployment in TomcatGlassFish and Websphere.
Unfortunately, you will soon realize that these step by step instructions are not working.
Problem #1 : Oracle removed the download link to openssowssagents.jar file.  Yes you read it right.  As of today, there is no binary distribution for the JAX WS Handlers and WSS Agents.  The JAR file is only available from ForgeRock.
Problem #2 : JAX-WS ClientHandler and ServerHandler are not included in openssowssagents.jar file.  So even, if you are downloading ForgeRock’s JAR file, you won’t get these two JAX WS handlers.
So the only solution is to download the source code and built it yourselves.  Building OpenSSO / OpenAM is not an easy task.  This product has many dependencies and historical (legacy) branches.  Anyway, your build will not be supported by Oracle nor ForgeRock.  For your convenience, here is a openssowssagents.jar file with the JAX WS classes included.
Should you have a valid support contract with Oracle and/or ForgeRock, do not hesitate to open a support case and see what / if /how they will handle this situation.

2011年1月17日 星期一