Sunday, November 12, 2006

Access control

How to create a new set of access control:
1. Create a new role. At orgadminconsole page, create a new role. The role name can be any string.
2. Create a new user, or choose existing user, to set this role. Then this user will have this role's access right.
3. Create a new access group if it doesnot exist.
Use default user access group policy xml file to create a new one. Do a query to find out the access group Id first, to ensure there is no conflict with current group.

At orgadminconsole, set this access group with the created role above.

4. Create a new access control policy xml file. The default access control xml can be a good template.
5. Load policies.
6. At orgadminconsole, subscribe the new policy for this organization or parent org.
7. At adminconsole, refresh registry to active the changes.

Adding payment methods in WC

Adding the payment method through POLICY table:
Add new policy for the new payment method in POLICY,
add new DoPaymentPolicyCmd,
ProcessOrder will invoke DoPaymentCmd,
DoPaymentCmd will invoke DoPaymentPolicyCmd,
for differnt policy, different impl will be invoked (by registering cmd class at POLICYCMD table).

you can implement your own policy cmd,customized code in DoPaymentPolicyCmd.
for each payment method, you can create a policycmd impl for it.

Need modify this to detail later.

Saturday, November 04, 2006

RSS feed

First thought building RSS is the complicated work.
After a little work on it, I found that it is pretty simple and cool.

1. All about XML
RSS feed is a XML file. Anyone can simply write a XML file in RSS standard, it will become a feed.

2. Choose a RSS version.
There are many different version. Still need time to merge different standards.
Anyway, RSS 2.0 is a simple one and easy to understand.

3. Create a RSS feed
Use any tool to generate a xml file like:

<rss version="2.0">

    <channel>
        <title>Allan's Blogger</title>
        <link>http://allanxu.blogspot.com
        <description>Allan's blogger feed </description>
        <language>en-ca</language>
        <image>
            <title>Logo</title>  
            <url>http://my.com/logo.gif</url>
            <link>http://allanxu.blogspot.com</link>
        </image>

        <item>
             <title>Hello world</title>  
            <link>http://allanxu.blogspot.com</link>
            <description> Hello ! </description>
        </item>

    </channel>
</rss>

If you need value pairs inside the URL link, use escape characters. like & to replace "&". Otherwise, most feed reader wont parse it properly.

4. Publish
Deploy your page on your server. Well, yes, we need a server.
Record the link.

5. Test
Download a few RSS readers, to add your RSS feed link.
Or use IE/Firefox to open it.
Note: Firefox 2.0 has the function to render the RSS.
IE/Firefox 1.x only display the xml content.
To solve this problem, we can define a xsl to translate it. Or just open any other RSS feed, and copy their xsl link, if there is any.

Thursday, November 02, 2006

Caching tips

Caching

1. Installing cachemonitor:

For cluster env, create one virtual host with more ports depends on how many app servers you have.
For each app server, at web container transport chains, define a new chain to associate the given port.
Then, each port monitor each app server.

Install dynache monitor .ear file from InstallableApp folder, accept default settings.
Map modules to application servers: Select both cluster and web server.

Re-generate plugin-cfg.xml file, and propagate it.
Restart the web server.

http(s)://<hostname>:<portN>/cachemonitor

2. cachespec.xml
For caching jsp, if there is no any Id to put in cache-in section,
use :

<class>servlet</class>
<name>com.ibm.commerce.server.RequestServlet.class</name>
<property name="save-attributes">false</property>
<property name="store-cookies">false</property>
<cache-id>
<component id="" type="pathinfo">
<required>true</required>
<value>/MY_VIEW_COMMAND</value>
</component>

Frist testing

I thought I might need a place to store my development tips, experience ...
Now, here it is.