Sun Application Server Startup Command: /opt/SUNWappserver/bin/asadmin start-domain --domaindir /opt/SUNWappserver/domains --user admin

Thursday, December 28, 2006

Sun Application Server 8.2 with jconsole on JVM

Go to sun application server login page and login.
Go Configuration/Admin Service/System.
See the port setting....

In comment line window, type in jconsole and Enter..
Set port as same as the port provide upper.

Thursday, September 28, 2006

Running Ant for cvs difference

ant -Dcvstagdiff.starttag=iteration_20 -Dcvstagdiff.endtag=iteration_21 diff-tag-to-tag

Wednesday, September 13, 2006

Library 'tacos' not found in application namespace.

Add following into [gmp(website)].application file
< id="tacos" path="classpath:/net/sf/tacos/Tacos.library">

Sunday, September 03, 2006

Directly set maxlength on Form object from database

In darpa project,

SQL = "select syscolumns.name as colname,syscolumns.length as collen, "
SQL = SQL & "systypes.name as typename from syscolumns, systypes "
SQL = SQL & " where object_name(syscolumns.id) = 'survey'"
SQL = SQL & " and syscolumns.xtype = systypes.xtype"

SET qs = Conn.Execute(SQL)
ind = 1
If not qs.EOF Then
Do While NOT qs.EOF
Execute( qs("colname") & "=" & qs("collen"))

ind = ind + 1
qs.MoveNext
Loop
End If
qs.Close

Monday, August 07, 2006

HTML STYLE: Menu or Layer will orverlapping Form Element

This will dynamic create a new iframe to cover the 'div'. So Form object won't be in the front.


<div id="DivReviewPurpose" style="position:absolute;display:none;z-index:104;
background-color:white;border:solid 1px gray;
border-style:double; z-index:100;">
<table border="0" cellpadding="2" cellspacing="0" bordercolor="#111111" >
&amp;lttr><td>
&ltcenter><b>&ltu>Purpose
Provide
objective criteria for employee performance evaluations on a standard basis
within our company;


<tr>&lttd align="center"><div id="closeButtonPurpose">&ltbr>
<a href="JavaScript:showDiv('DivReviewPurpose', false);">
Close Window


In Script

function showDiv(sDivID, bState, tableWidth, tableHeight, p) {
var oDiv = document.getElementById(sDivID);
/*@cc_on @if (@_jscript_version >= 5)
try {
var oIframe = document.getElementById('HelpFrame');
oIframe.scrolling = 'no';
} catch (e) {
var oIframe = document.createElement('iframe');
var oParent = oDiv.parentNode;
oIframe.id = 'HelpFrame'; oParent.appendChild(oIframe);
}
oIframe.frameborder = 0;
oIframe.style.position = 'absolute';
oIframe.style.top = 0;
oIframe.style.left = 0;
oIframe.style.display = 'none'; @end @*/
if (bState) {
//oDiv.style.margin = "0px";
//oDiv.style.padding = "0px";
oDiv.style.width = tableWidth + "px";
oDiv.style.height = tableHeight + "px";

oDiv.style.top = p.y + "px";
oDiv.style.left = p.x + "px";
oDiv.style.display = 'block';
/*@cc_on @if (@_jscript_version >= 5)
oIframe.style.top = oDiv.style.top;
oIframe.style.left = oDiv.style.left;
oIframe.style.zIndex = oDiv.style.zIndex - 1;
oIframe.style.width = parseInt(oDiv.offsetWidth);
oIframe.style.height = parseInt(oDiv.offsetHeight);
oIframe.style.display = 'block'; @end @*/
} else {
/*@cc_on @if (@_jscript_version >= 5)
oIframe.style.display = 'none'; @end @*/
oDiv.style.display = 'none'; }
} //


Wednesday, August 02, 2006

MS Access Select List will actually update data

PROBLEM: Select List will change the value if set Control Source on Properties, or it will add a empty selection on the select list.
ANSWER:
1. Don't set anything on Control Source on Select List's properties.
2.
Private Sub Form_Load()
Me.Combo0.Requery
Me.Combo0 = Me.Combo0.ItemData(0)
End Sub

Log for use AJAX

In web portal, use
EmpReviewUpd.asp
EmpReviewUpd_xt.asp
EmpReviewCommendAjax.js
to see the example

Friday, June 09, 2006

Hibernate: Get Length and Type attribute from property on mapping file using JAVA

After get configuration, you can get length from property.

public Configuration getConfiguration() {
Configuration configuration = new Configuration();
setMappings(configuration);

Iterator classMappings = configuration.getClassMappings();
while (classMappings.hasNext()) {
PersistentClass cm = (PersistentClass) classMappings.next();
Iterator propertyIterator = cm.getPropertyIterator();
while (propertyIterator.hasNext()) {
Property element = (Property) propertyIterator.next();
//Logger.debug(cm.getEntityName() + " = " + element.getName());
Iterator columnIterator = element.getValue().getColumnIterator();
while (columnIterator.hasNext()) {
Column col = (Column) columnIterator.next();
//Logger.debug(col.getName() + " > " + col.getLength());
}
}
}
return configuration;
}

private void setMappings(Configuration configuration) {
String[] files = new String[] { "AvailabilityCode", "StateCode",
"StatusCode", "SuitabilityCode", "ReasonCode", "Property",
"PropertyHistory", "Publication", "Agency", "PasswordHistory",
"UnsuitableReason", "User", "PropertyNumberSequence",
"FieldOfficeCode", "FieldOfficePoc", "DodDepartment",
"BracApplication", "Contact", "ContactType" };
for (int i = 0; i <>

Wednesday, May 31, 2006

Hibernate is slow with JRE 1.5

Hibernate is slow with JRE 1.5. We still don't know why, but the fact is SLOW. We wrote a native SQL instead of Hibernate SQL to generate complexes SQL command. Following is record from Steve's Email:

We found out what the problem was attributed to. It was a very strange and quite frankly a misleading performance issue within Hibernate during the loading of the resultset into memory. We couldn’t pinpoint why it was failing (so slow), but were able to narrow down by a process of elimination (poor elimination). It turns out that we know the issue is one of two things:
· Running Hibernate on Solaris
· Running Hibernate using JDK 1.5
We really don’t care what the issue is because we’ve figured out how to tweak the code and fixed the problem.

Tapesty group pick up my question.

It's happy to know that Tapestry group pick up my question about 508 compliance on ALT tag on FormTable. To work a way around, I just use Javascript to assign it when body onload.

for (i = 11; i< 14; i++) {
myImage = document.getElementsByTagName('img')[i];
if (myImage != null && myImage != 'undefined') {
if (myImage.src.indexOf('arrow-up.gif')>0) {
myImage.setAttribute('alt','Sort Ascending');
} else if (myImage.src.indexOf('arrow-down.gif')>0) {
myImage.setAttribute('alt','Sort Descending');
}
}
}

Thursday, May 25, 2006

Tapestry: LinkSubmit problem for browsing back

The way to fix it:
Copy the LinkSubmit.jwc and LinkSubmit.java file from Tapestry. Rename it and extend to LinkSubmit.java

// make sure the submit function is on the page (once)
if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
{
Add This =>>body.addInitializationScript("document." + formName + "._linkSubmit.value = null;");
body.addBodyScript("function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
}
Please refer this to http://mail-archives.apache.org/mod_mbox/jakarta-tapestry-dev
/200506.mbox/%3C594252918.1118656487914.JavaMail.jira
@ajax.apache.org%3E

Release Project Procedure

- Update release-note-xx.doc
Commit it
- Update Label
- Run label (.bat) file
- Base on CVS Diff, write the release note
-

Migration db from Production to Local

- Export data from production (configuration is from "property" file)to local though SQL Server/import
- Export data to cache ant -f migration.xml save-export
- Commit export-data.zip to CVS

To import into database use ant -Denvironment=qa migrate-db-cached

Wednesday, May 24, 2006

Cannot logon to Microsoft Shared Point on Windows 2003

To solve this problem, set sucurity directly under Website instead of under Shared point web site.
- Check Basic authentication only.
- Assign domain name in the text field.

Monday, May 22, 2006

Baseball ticket

Just got ticket for tonight National with Houston. Lucky...

It's me

This is me, the world I have.
I wish category can be apply on blog.