Archive for April, 2009

Retreive list item id for search result page

First you need to add a new Search Managed Property to the search configuration.

Please do the following steps

1. Go into the SSP, Search Settings, Managed Properties, click on “New Managed Property”
2. Give it a like “ItemID”
3. choose type of Integer
4. In the “Mappings to crawled properties” section, choose “Include values from a single crawled property based on the order specified”
5. click on Add Mapping button, search for the one you want (which is ows_ID) like this in the selection dialog, select it and click OK:

Now add this column in query editor column of search core result web part, and then customize xslt mentioned by zimmer.

So once you create XML , you will notice that your itemid will appear in your search result xml, thne do the needful as per zimmer article (http://www.zimmergren.net/archive/2007/10/28/moss-2007-customize-the-search-result-using-xslt-part-3-customize-using-sharepoint-designer-2007.aspx?id=36) then you can set ‘Title’ field as Hyper link with your list item, so your hyper link will be “../dispform.aspx?id={itemid}. This url can be vary depending on your document or form library.

No Comments

Tomcat 6 Invoker Services

In Tomcat 3, the undefined servlet is mappted to /servlet/* by default.

However, it is removed in Tomcat 6 (or earlier) as this is an evil approach. It is not suggested to deploy in production environment.

Nevertheless, It may be good for development / learning purpose,

To enable invoker services in Tomcat, (mapping undefined servlet using wild card mapping), do the following steps,
1. uncomment following configuration snippet in web.xml

<servlet>
<servlet-name>invoker</servlet-name>
<servlet-class>
org.apache.catalina.servlets.InvokerServlet
</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

2. Change context.xml
change <Context>
to <Context reloadable=”true” privileged=”true”>

However, this approach is defined as unsafe action,
it is only suggested to use on development / learning purpose
http://wiki.apache.org/tomcat/FAQ/Miscellaneous?highlight=(invoker)#Q3

,

No Comments

Apache Log Rotation

in httpd.conf, add:

CustomLog "|/apache/bin/rotatelogs /apache/logs/access_log.%Y%m%d 86400 -360" common

apache's path
apache's log path

(changing the path as needed...)
where the number 86400 is seconds to rotation (86400 is 24 hours)
and -360 is minutes offset from UTC 0 (-360 is for US Central)

and comment out any other line beginning with 'CustomLog'

this will give you logs, rotated daily, named something like:

access_log.20061101
access_log.20061102
access_log.20061103

No Comments

Using Firefox single-sign-on MOSS

There is a way thought to allow you to save your typed Windows credentials in Firefox to prevent you from repeatly typing the Windows user name and password.

  1. Enter “about:config” in the address bar of Firefox and hit [Enter]
  2. Do a search on “ntlm“, at least three entries should appear
  3. Double click the second entry and set the value of “network.automatic-ntlm-auth.trusted-uris” to “.yourdomain” (do not forget the dot).
  4. Restart your Firefox to let the change effective.
  5. And when you re-open the Firefox, you might be prompted with the following window.

,

No Comments

The Virtual Server service may stop responding when the service is starting if one or more of the virtual machines are configured to automatically start when the Virtual Server service starts

I hit this error, I found that there is a patch from MS to fix this issue

http://support.microsoft.com/kb/941125

No Comments

Convert calendar to String (“MM/dd/yyyy”)

String strdate = null;

SimpleDateFormat sdf = new SimpleDateFormat(“MM/dd/yyyy”);

if (calendardate != null) {
strdate = sdf.format(calendardate.getTime());
}

No Comments

SharePoint AfterProperties DateTime Comparison

As date time stored in properties.AfterProperties is UTC time, that means it will return the date time according to user’s time zone. This befavior is different from date time field in properties.ListItem.

To get the date time value in AfterProperties directly without changing to time zone specified date time, use following C# script

DateTime tempAfterPropDateTime = DateTime.Parse(afterProp.Value.ToString(),null,DateTimeStyles.AdjustToUniversal);

No Comments

3,4 月, 很忙很忙…

3, 4 月都好忙呢…

而家放假訓一覺好好既已經好開心喇…

上星期二攞左日annual leave, 訓左日 , so good~~~^^

買左對新addidas 波鞋, 發覺addidas D款好多都差唔多

可能差條線又係新款 , sosad, 不過對鞋幾靚呢~~:P

1 Comment

Flex Atom Reader

Flex 用parse XML 太方便了

以下係一個parse 一個from HTTP Server 既atom file 既example

<?xml version=”1.0″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” creationComplete=”feedRequest.send();” backgroundGradientAlphas=”[1.0, 1.0]” backgroundGradientColors=”[#333333, #5B5A5A]”>

<mx:HTTPService id=”feedRequest” url=”data/photo.xml” useProxy=”false” />

<mx:Panel title=”Atom Reader” height=”75%” width=”75%” paddingTop=”10″ paddingBottom=”10″ paddingLeft=”10″ paddingRight=”10″ color=”#FFFFFF”>
<mx:DataGrid id=”dgPosts” height=”50%” width=”75%” dataProvider=”{feedRequest.lastResult.feed.entry}” color=”#427F95″>
<mx:columns>
<mx:DataGridColumn headerText=”Posts” dataField=”title”/>
</mx:columns>
</mx:DataGrid>
<mx:TextArea id=”txtarea” height=”50%” width=”75%” htmlText=”{dgPosts.selectedItem.content}” color=”#4B80D8″/>
</mx:Panel>
</mx:Application>

,

No Comments

沐猴而冠

居數日,項羽引兵西屠鹹陽,殺秦降王子嬰,燒秦宮室,火三月不滅;收其貨寶婦女而東。人或說項王曰:“關中阻山河四塞,◇集解徐廣曰:“東函穀,南武關,西散關,北蕭關。”地肥饒,可都以霸。”項王見秦宮皆以燒殘破,又心懷思欲東歸,曰:“富貴不歸故鄉,如衣繡夜行,誰知之者!”說者曰:“人言楚人沐猴而冠耳,果然。”◇集解張晏曰:“沐猴,獼猴也。”○索隱言獼猴不任久著冠帶,以喻楚人性躁暴。果然,言果如人言也。項王聞之,烹說者。◇集解楚漢春秋、楊子法言雲說者是蔡生,漢書雲是韓生。

No Comments