| 內容 |
|
|
|
|
 |
|
|
|
|
 |
|
|
這個週末花了兩天終於把現有的OLAT由6.0.4升級至6.0.6, 步驟如下:
cd ~/download
mv olat3 olat-6.0.4
wget http://www.olat.org/downloads/stable/OLAT-6.0.6.zip
unzip OLAT-6.0.6.zip
mv OLAT-6.0.6-PUBLIC-* olat3
cd olat3
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/www\/data\/olatdata/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=mail.andowson.com/" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat5/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "48c\server.modjk.enabled=true" \
-e "57c\defaultcharset=UTF-8" \
-e "95,117d" \
-e "1,$$s/#db/db/g" \
-e "s/instantMessaging.enable=false/instantMessaging.enable=true/" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/" \
-e "s/instantMessaging.generateTestUsers=false/instantMessaging.generateTestUsers=true/" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=olat/" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=olat/" \
-e "s/cluster.catalinaport=8005/cluster.catalinaport=8105/" \
-e "s/cluster.ajpport = 8009/cluster.ajpport = 8109/" build.properties.default > build.properties
ant install
ant jsmath
sudo /etc/init.d/tomcat stop
mv ~/www/olat /tmp/olat-6.0.4
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat
sed -i -e "13c\ <\!-- default session timeout -->" ~/www/olat/WEB-INF/web.xml
rm -rf ~/www/olat/WEB-INF/src
rm -rf ~/www/olat/WEB-INF/patchesSrc
rm -rf ~/www/olat/WEB-INF/test
cp /tmp/olat-6.0.4/WEB-INF/classes/hibernate.properties ~/www/olat/WEB-INF/classes/.
chgrp -R tomcat ~/www/olat
chgrp -R tomcat ~/www/data/olatdata
chmod 775 ~/www/olat/static
chmod 775 ~/www/olat/WEB-INF
sudo -u postgres pg_dump olat > /tmp/olat.bak
sudo /etc/init.d/tomcat start
|
 |
|
|
cd ~/download
mv olat3 olat-6.0.0
wget http://www.olat.org/downloads/stable/OLAT-6.0.4.zip
unzip OLAT-6.0.4.zip
mv OLAT-6.0.4-FINAL-* olat3
cd olat3
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/www\/data\/olatdata/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=mail.andowson.com/" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat5/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "48c\server.modjk.enabled=true" \
-e "95,117d" \
-e "1,$$s/#db/db/g" \
-e "s/instantMessaging.enable=false/instantMessaging.enable=true/" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/" \
-e "s/instantMessaging.generateTestUsers=false/instantMessaging.generateTestUsers=true/" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=olat/" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=olat/" build.properties.default > build.properties
ant install
ant jsmath
sudo /etc/init.d/tomcat stop
mv ~/www/olat /tmp/olat-6.0.0
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat
sed -i -e "13c\ <\!-- default session timeout -->" ~/www/olat/WEB-INF/web.xml
rm -rf ~/www/olat/WEB-INF/src
rm -rf ~/www/olat/WEB-INF/patchesSrc
rm -rf ~/www/olat/WEB-INF/test
cp /tmp/olat-6.0.0/WEB-INF/classes/hibernate.properties ~/www/olat/WEB-INF/classes/.
chgrp -R tomcat ~/www/olat
chgrp -R tomcat ~/www/data/olatdata
chmod 775 ~/www/olat/static
chmod 775 ~/www/olat/WEB-INF
sudo -u postgres pg_dump olat > /tmp/olat.bak
sudo psql -U olat olat -f /home/andowson/download/olat3/database/postgresql/alter_6_0_0_to_6_0_3.sql
sudo psql -U olat olat -f ~/download/olat3/database/postgresql/alter_6_0_0_to_6_0_3.sql
sudo /etc/init.d/tomcat start
|
 |
|
|
要加上密碼也是可以的,只要將原本的zip.exe換一個可以加密碼的壓縮軟體執行檔即可,例如7-Zip這個免費又可以加上密碼的壓縮軟體的7z.exe。
1.到 http://www.7-zip.org/下載安裝用的exe檔
2.執行下載的exe檔安裝
3.安裝完成後,將C:\Program Files\7-Zip下的7z.exe複製到C:\Windows\System32目錄下。
相關的參數可以在命令列下執行7z獲得:
7-Zip 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
[<@listfiles...>]
<Commands>
a: Add files to archive
b: Benchmark
d: Delete files from archive
e: Extract files from archive (without using directory names)
l: List contents of archive
t: Test integrity of archive
u: Update files to archive
x: eXtract files with full paths
<Switches>
-ai[r[-|0]]{@listfile|!wildcard}: Include archives
-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
-bd: Disable percentage indicator
-i[r[-|0]]{@listfile|!wildcard}: Include filenames
-m{Parameters}: set compression Method
-o{Directory}: set Output directory
-p{Password}: set Password
-r[-|0]: Recurse subdirectories
-scs{UTF-8 | WIN | DOS}: set charset for list files
-sfx[{name}]: Create SFX archive
-si[{name}]: read data from stdin
-slt: show technical information for l (List) command
-so: write data to stdout
-ssc[-]: set sensitive case mode
-ssw: compress shared files
-t{Type}: Set type of archive
-v{Size}[b|k|m|g]: Create volumes
-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
-w[{path}]: assign Work directory. Empty path means a temporary directory
-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
-y: assume Yes on all queries
以下是一個執行命令的範例,會將目前整個目錄壓縮起來存到c:\backup.zip檔案,並加上密碼secret。
7z a -psecret c:\backup.zip *
所以原來程式簡易的修改方式如下:
將第29行的程式碼取代為:
set ZIPPASSWORD=secret
7z a -p%ZIPPASSWORD% %BACKUPFILE% %TARGET%\*
|
 |
|
|
1.安裝:
 安裝容易,可手動或透過網頁介面安裝
 支援多種Servlet Container或應用伺服器,如Tomcat、Resin、JBoss等
 支援多種資料庫,包含MySQL、PostgreSQL、Oracle和HSQLDB
 可輕易由phpBB移轉
2.一般:
 可列出主題、作者、篇數、人氣度、發表時間
 支援無限數量的分類、版面和文章主題
 可對文章及使用者進行評分
 可收藏主題到個人書籤且可設定是否公開
 支援友善的網址
 可列出線上使用者名單及線上人數
 可顯示整個討論區的最新主題(依最後發表時間)
 可顯示整個討論區的熱門主題(依點閱次數)
 支援全文檢索,可對文章內容進行關鍵字搜尋
 速度快且易於擴充,最適合忙碌的站台,暫存經常存取的資料到快取區,以避免大量的資料庫查詢動作
3.發表文章:
 可附加檔案到文章,並可設定附加檔案的類型及每篇文章最多幾個附加檔案
 支援HTML語法和表情符號(BBCode)
 自動解析文章中的超連結
 提供整合的私人訊息系統
 電子郵件通知有新的私人訊息及設定文章回覆時通知
 支援無限數量的表情符號,可輕易的由管理介面設定
 支援RSS 聯播(syndication)
 可設定文章主題為公告或置頂
 張貼文章前提供預覧功能
 可設定投票主題及選項
4.版面管理:
 文章審核機制,管理者可設定只有通過版主審核過的文章才能顯示
 可鎖定/解除鎖定文章主題且可在版面間搬移
5.權限及安全性:
 可設定唯讀的版面,只能閱讀,不能新增文章
 可設定僅能回覆的版面,只能回覆給已經存在的文章
 可設定版面管理員群組,並可設定該群組可審核的版面
 可過濾HTML語法,增進安全性
 可設定某個使用者群組可以瀏覽的分區及版面
 可設定匿名訪客僅能閱讀文章,需加入會員並登入後才能發表文章及下載附件
 可設定是否開放會員註冊
資料來源:
http://www.jforum.net/features.jsp
|
 |
|
|
有種方法,不知道管不管用,做張網頁截圖,例如
可以利用下列網址產生
http://ppt.cc/yo2/index.php
然後你再將該截圖抓回來放到你的網站上去
再把img src的來源指到你的網站上
|
 |
|
|
|
不知道您的需求是不是如下:
網站A,動態產生廣告圖片網頁test1.jsp,內容為文字HTML標籤
網站B,只能放HTML的靜態網頁空間,想要將網站A的test1.jsp的結果顯示在一個網頁,例如showTest1.html上
可行的作法是在網站B上使用<frame>或<iframe>或者<javascript>的src屬性去設定來源URL為網站A的test1.jsp
現在您是指,如果不使用上面這幾個標籤時,可以改用img的src屬性來達成嗎?
|
 |
|
|
|
請先確認test3.jsp一次要顯示幾張圖?這些圖放在哪邊?然後跟test1.jsp有什麼關係?
也許你需要的只是在test3.jsp中使用<jsp:include page="test1.jsp" />
|
 |
|
|
test2.jsp內的第五行
File f = new File("C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\ROOT\\test1.jsp");
要改成
File f = new File("C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\ROOT\\images\\xxx.gif");
test3.jsp的第四行應修正為:
<td><img src="http://localhost:8080/test2.jsp"></td>
|
 |
|
|
可以參考這一篇
A simple way to display database blob stored image in a jsp
要注意的重點就是,
1.JSP頁面內不能有文字輸出,要全部用<% ... %>包圍起來,不能有HTML的標籤被輸出。
2.ContentType要設定為image/gif, image/jpeg, ...。
3.重新由response取得OutputStream,因原本的out物件是屬於文字輸出型的。
// get the image from any source
byte[] imgData = getYourImage();
// display the image
response.setContentType("image/gif");
OutputStream o = response.getOutputStream();
o.write(imgData);
o.flush();
o.close();
|
 |
|
|
檢查日誌檔內有關Queue Manager的警告訊息,指令如下:
egrep 'qmgr.*(panic|fatal|error|warning):' /var/log/maillog
參考資料:
http://www.postfix.org/QSHAPE_README.html
將所有信件刪除,指令如下:
postsuper -d ALL
參考資料:
http://actychen.blogspot.com/2008/03/postfix-mail-queue.html
|
 |
|
|
lpi是一個net.jforum.entities.LastPostInfo類別的物件,包含底下幾個符合JavaBean定義的屬性(properties):
postTimeMillis
topicId
postId
userId
topicReplies
username
postDate
hasInfo
JForum使用FreeMarker作為template engine,所以,我們可以透過lpi.userId來呼叫LastPostInfo的getUserId()來取得某個版面最後發表的文章資訊。
您可以參考此篇 JForum Eclipse WTP開發環境設定來建立您的JForum開發環境,對於原始碼的追蹤就會變得很容易。
參考資料:
http://freemarker.org/docs/pgui_quickstart_createdatamodel.html
|
 |
|
|
|
主要是由以下兩個CSS檔案所控制
/templates/default/styles/style.css
/templates/default/styles/zh_TW.css
|
 |
|
|
|
1.onkeypress會再按下Enter時執行一次test(),此外,按下Enter對瀏覽器而言等同於要求submit表單,於是表單被送出
2.onsubmit會在表單送出時執行一次test()
|
 |
|
|