cx.ath.kgslab.wiki
クラス AbstractPageManager

java.lang.Object
  拡張cx.ath.kgslab.wiki.AbstractPageManager
すべての実装インタフェース:
org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, PageManager

public abstract class AbstractPageManager
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, PageManager

ページ管理クラス.
ページの読み書き、キャッシュ、ロックを統一的に扱うクラスの、 スーパークラス。
ロック、キャッシュはデフォルト実装を、 このクラスに持つ。 ページの読み書きは、ファイル、DBなど複数の対象を想定しているので、 ここでは実装せずサブクラスで実装する。

導入されたバージョン:
JaJaWiki 2.0
バージョン:
3.0 $Revision: 1.1 $
作成者:
長澤貴博

フィールドの概要
protected  JaJaWikiConfig config
          JaJaWiki設定情報
protected  org.springframework.context.ApplicationContext context
          アプリケーションコンテキスト
 
コンストラクタの概要
AbstractPageManager()
           
 
メソッドの概要
 void addPageChangeListener(PageChangeListener listener)
          DOCUMENT ME!
 void afterPropertiesSet()
          初期化処理
 void attachFile(java.lang.String page, java.lang.String fileName, org.apache.struts.upload.FormFile uploadFile, boolean overwrite)
          ページにファイルを添付する
 void backupPages()
          Wikiページをバックアップする。
 boolean checkLockPassword(cx.ath.kgslab.wiki.pages.Page page, java.lang.String password)
          指定のページのパスワードをチェックする。
 boolean checkPassword(cx.ath.kgslab.wiki.pages.Page page, java.lang.String password)
          指定のページのパスワードをチェックする。
 boolean checkPassword(java.lang.String page, java.lang.String password)
          指定のページのパスワードをチェックする。
static java.lang.String concatPath(java.lang.String path, java.lang.String name)
          パスの結合
ページパスとページ名を結合する
 void deletePage(cx.ath.kgslab.wiki.pages.Page page)
          ページ削除
 void deletePage(java.lang.String name)
          ページ削除
 java.lang.String encode(java.lang.String text)
          ページ名をURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。
 java.lang.StringBuffer encode(java.lang.String text, java.lang.StringBuffer buf)
          ページ名をURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。
 java.lang.String encodePath(java.lang.String path)
          PathをURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。
 java.lang.String encodePath(java.lang.String path, java.lang.String page)
          PathをURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。
 java.lang.StringBuffer encodePath(java.lang.String path, java.lang.StringBuffer buf)
          PathをURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。
 boolean existsPage(java.lang.String path, java.lang.String name)
          ページの有無確認
protected  void firePageChanged()
          DOCUMENT ME!
 cx.ath.kgslab.wiki.struts.form.AttachFile[] getAttachFiles(java.lang.String page)
          ページに添付されたファイルの情報を取得する
 net.sf.ehcache.CacheManager getCacheManager()
          キャッシュマネージャの取得
 JaJaWikiConfig getConfig()
          JaJaWiki設定情報
protected  java.lang.String getFullPath(cx.ath.kgslab.wiki.pages.Page page)
          ページのフルパスの取得
ページパスとページ名を結合し、フルパスを生成する。
 cx.ath.kgslab.wiki.pages.Page getPage(java.lang.String name)
          ページ取得
 void init()
          初期化処理
static void parsePagePath(java.lang.String page, cx.ath.kgslab.wiki.pages.Page info)
          ページパスの解釈処理
ページのフルパスから、ページ名、ページパスを抽出する。
static java.lang.String parsePath(java.lang.String path, java.lang.String thisPath)
          ページパスの解釈処理
ページパス中の".."
 void putPage(cx.ath.kgslab.wiki.pages.Page page)
          ページ追加/更新
 void putPage(cx.ath.kgslab.wiki.pages.Page page, boolean modified)
          ページ追加/更新
protected abstract  cx.ath.kgslab.wiki.pages.Page readPage(java.lang.String name)
          ページ入力
 void removeFile(java.lang.String page)
          ページに添付されたファイルを全て削除する
 void removeFile(java.lang.String page, java.lang.String[] files)
          ページに添付されたファイルを削除する
protected abstract  void removePage(java.lang.String name)
          ページ削除
 void renamePage(java.lang.String srcName, java.lang.String dstName)
          ページ名変更
 void setApplicationContext(org.springframework.context.ApplicationContext context)
          アプリケーションコンテキストの設定
 void setCacheManager(net.sf.ehcache.CacheManager manager)
          キャッシュマネージャの設定
 void setConfig(JaJaWikiConfig config)
          JaJaWiki設定情報
 boolean useMasterPassword()
          マスターパスワードが設定されているか
protected abstract  void writePage(cx.ath.kgslab.wiki.pages.Page page)
          ページ出力
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
インタフェース cx.ath.kgslab.wiki.PageManager から継承したメソッド
backupPages, existsPage, getModifiedPageList, getPageList
 

フィールドの詳細

context

protected org.springframework.context.ApplicationContext context
アプリケーションコンテキスト


config

protected JaJaWikiConfig config
JaJaWiki設定情報

コンストラクタの詳細

AbstractPageManager

public AbstractPageManager()
メソッドの詳細

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext context)
アプリケーションコンテキストの設定

定義:
インタフェース org.springframework.context.ApplicationContextAware 内の setApplicationContext
パラメータ:
context - アプリケーションコンテキスト

afterPropertiesSet

public final void afterPropertiesSet()
                              throws java.lang.Exception
初期化処理

定義:
インタフェース org.springframework.beans.factory.InitializingBean 内の afterPropertiesSet
例外:
java.lang.Exception
関連項目:
InitializingBean.afterPropertiesSet()

init

public void init()
          throws java.lang.Exception
初期化処理

例外:
java.lang.Error
java.lang.Exception

readPage

protected abstract cx.ath.kgslab.wiki.pages.Page readPage(java.lang.String name)
                                                   throws cx.ath.kgslab.wiki.exception.PageReadException
ページ入力

パラメータ:
name - 対象ページ名
戻り値:
ページ情報
例外:
cx.ath.kgslab.wiki.exception.PageReadException

writePage

protected abstract void writePage(cx.ath.kgslab.wiki.pages.Page page)
                           throws cx.ath.kgslab.wiki.exception.PageWriteException
ページ出力

パラメータ:
page - ページ情報
例外:
cx.ath.kgslab.wiki.exception.PageWriteException

existsPage

public final boolean existsPage(java.lang.String path,
                                java.lang.String name)
                         throws cx.ath.kgslab.wiki.exception.PageReadException
ページの有無確認

定義:
インタフェース PageManager 内の existsPage
パラメータ:
path - ページパス
name - 対象ページ名
戻り値:
true:該当ページあり false:該当ページなし
例外:
cx.ath.kgslab.wiki.exception.PageReadException

backupPages

public final void backupPages()
                       throws cx.ath.kgslab.wiki.exception.PageReadException,
                              cx.ath.kgslab.wiki.exception.PageWriteException
Wikiページをバックアップする。

定義:
インタフェース PageManager 内の backupPages
例外:
cx.ath.kgslab.wiki.exception.PageReadException
cx.ath.kgslab.wiki.exception.PageWriteException
関連項目:
PageManager.backupPages()

removePage

protected abstract void removePage(java.lang.String name)
                            throws cx.ath.kgslab.wiki.exception.PageWriteException
ページ削除

パラメータ:
name - 対象ページ名
例外:
cx.ath.kgslab.wiki.exception.PageWriteException

getPage

public final cx.ath.kgslab.wiki.pages.Page getPage(java.lang.String name)
                                            throws cx.ath.kgslab.wiki.exception.PageReadException
ページ取得

定義:
インタフェース PageManager 内の getPage
パラメータ:
name - ページ名
戻り値:
ページ名に割り当てられたページ情報
例外:
cx.ath.kgslab.wiki.exception.PageReadException
関連項目:
Map.get(java.lang.Object)

putPage

public final void putPage(cx.ath.kgslab.wiki.pages.Page page)
                   throws cx.ath.kgslab.wiki.exception.PageWriteException
ページ追加/更新

定義:
インタフェース PageManager 内の putPage
パラメータ:
page - ページ情報
例外:
cx.ath.kgslab.wiki.exception.PageWriteException
関連項目:
Map.put(java.lang.Object, java.lang.Object)

putPage

public final void putPage(cx.ath.kgslab.wiki.pages.Page page,
                          boolean modified)
                   throws cx.ath.kgslab.wiki.exception.PageWriteException
ページ追加/更新

定義:
インタフェース PageManager 内の putPage
パラメータ:
page - ページ情報
modified - ページ内容に更新を行ったかを示すフラグ
例外:
cx.ath.kgslab.wiki.exception.PageWriteException
関連項目:
Map.put(java.lang.Object, java.lang.Object)

deletePage

public final void deletePage(java.lang.String name)
                      throws cx.ath.kgslab.wiki.exception.PageWriteException
ページ削除

定義:
インタフェース PageManager 内の deletePage
パラメータ:
name - ページ名
例外:
cx.ath.kgslab.wiki.exception.PageWriteException

deletePage

public final void deletePage(cx.ath.kgslab.wiki.pages.Page page)
                      throws cx.ath.kgslab.wiki.exception.PageWriteException
ページ削除

定義:
インタフェース PageManager 内の deletePage
パラメータ:
page - ページ
例外:
cx.ath.kgslab.wiki.exception.PageWriteException

renamePage

public final void renamePage(java.lang.String srcName,
                             java.lang.String dstName)
                      throws cx.ath.kgslab.wiki.exception.PageReadException,
                             cx.ath.kgslab.wiki.exception.PageWriteException,
                             cx.ath.kgslab.wiki.exception.PageNotFoundException,
                             cx.ath.kgslab.wiki.exception.PageAlreadyExistsException,
                             cx.ath.kgslab.wiki.exception.PathNotFoundException
ページ名変更

定義:
インタフェース PageManager 内の renamePage
パラメータ:
srcName - 変更前ページ名
dstName - 変更後ページ名
例外:
cx.ath.kgslab.wiki.exception.PageReadException
cx.ath.kgslab.wiki.exception.PageWriteException
cx.ath.kgslab.wiki.exception.PageNotFoundException
cx.ath.kgslab.wiki.exception.PageAlreadyExistsException
cx.ath.kgslab.wiki.exception.PathNotFoundException

attachFile

public final void attachFile(java.lang.String page,
                             java.lang.String fileName,
                             org.apache.struts.upload.FormFile uploadFile,
                             boolean overwrite)
                      throws cx.ath.kgslab.wiki.exception.AttachFileOutputException
ページにファイルを添付する

定義:
インタフェース PageManager 内の attachFile
パラメータ:
page - ページ
fileName - ファイル名
uploadFile - ファイルの内容
overwrite - オーバライドフラグ
例外:
cx.ath.kgslab.wiki.exception.AttachFileOutputException

removeFile

public void removeFile(java.lang.String page,
                       java.lang.String[] files)
                throws cx.ath.kgslab.wiki.exception.AttachFileOutputException
ページに添付されたファイルを削除する

定義:
インタフェース PageManager 内の removeFile
パラメータ:
page - ページ
files - ファイル名
例外:
cx.ath.kgslab.wiki.exception.AttachFileOutputException

getAttachFiles

public cx.ath.kgslab.wiki.struts.form.AttachFile[] getAttachFiles(java.lang.String page)
                                                           throws cx.ath.kgslab.wiki.exception.AttachFileOutputException
ページに添付されたファイルの情報を取得する

定義:
インタフェース PageManager 内の getAttachFiles
パラメータ:
page - ページ
戻り値:
添付ファイル情報の配列
例外:
cx.ath.kgslab.wiki.exception.AttachFileOutputException

removeFile

public void removeFile(java.lang.String page)
                throws cx.ath.kgslab.wiki.exception.AttachFileOutputException
ページに添付されたファイルを全て削除する

定義:
インタフェース PageManager 内の removeFile
パラメータ:
page - ページ
例外:
cx.ath.kgslab.wiki.exception.AttachFileOutputException

useMasterPassword

public final boolean useMasterPassword()
マスターパスワードが設定されているか

定義:
インタフェース PageManager 内の useMasterPassword
戻り値:
true:マスターパスワード利用

checkPassword

public final boolean checkPassword(java.lang.String page,
                                   java.lang.String password)
                            throws cx.ath.kgslab.wiki.exception.PageReadException
指定のページのパスワードをチェックする。

定義:
インタフェース PageManager 内の checkPassword
パラメータ:
page - ページ名
password - パスワード
戻り値:
true:パスワードOK
例外:
cx.ath.kgslab.wiki.exception.PageReadException

checkPassword

public final boolean checkPassword(cx.ath.kgslab.wiki.pages.Page page,
                                   java.lang.String password)
指定のページのパスワードをチェックする。

定義:
インタフェース PageManager 内の checkPassword
パラメータ:
page - ページ情報
password - パスワード
戻り値:
true:パスワードOK

checkLockPassword

public final boolean checkLockPassword(cx.ath.kgslab.wiki.pages.Page page,
                                       java.lang.String password)
指定のページのパスワードをチェックする。

定義:
インタフェース PageManager 内の checkLockPassword
パラメータ:
page - ページ情報
password - パスワード
戻り値:
true:パスワードOK

encode

public java.lang.StringBuffer encode(java.lang.String text,
                                     java.lang.StringBuffer buf)
                              throws java.io.UnsupportedEncodingException
ページ名をURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。

定義:
インタフェース PageManager 内の encode
パラメータ:
text - エンコード対象文字列
buf - 格納先StringBuffer
戻り値:
格納先StringBuffer
例外:
java.io.UnsupportedEncodingException

encodePath

public java.lang.StringBuffer encodePath(java.lang.String path,
                                         java.lang.StringBuffer buf)
                                  throws java.io.UnsupportedEncodingException
PathをURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。

定義:
インタフェース PageManager 内の encodePath
パラメータ:
path - エンコード対象文字列
buf - 格納先StringBuffer
戻り値:
格納先StringBuffer
例外:
java.io.UnsupportedEncodingException

encode

public java.lang.String encode(java.lang.String text)
                        throws java.io.UnsupportedEncodingException
ページ名をURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。

定義:
インタフェース PageManager 内の encode
パラメータ:
text - エンコード対象文字列
戻り値:
結果文字列
例外:
java.io.UnsupportedEncodingException

encodePath

public java.lang.String encodePath(java.lang.String path)
                            throws java.io.UnsupportedEncodingException
PathをURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。

定義:
インタフェース PageManager 内の encodePath
パラメータ:
path - エンコード対象文字列
戻り値:
結果文字列
例外:
java.io.UnsupportedEncodingException

encodePath

public java.lang.String encodePath(java.lang.String path,
                                   java.lang.String page)
                            throws java.io.UnsupportedEncodingException
PathをURLEncodeし、%を取り除くことで、 ASCII範囲内のファイル名を生成する。

定義:
インタフェース PageManager 内の encodePath
パラメータ:
path - ページパス
page - ページ名
戻り値:
結果文字列
例外:
java.io.UnsupportedEncodingException

concatPath

public static java.lang.String concatPath(java.lang.String path,
                                          java.lang.String name)
パスの結合
ページパスとページ名を結合する

パラメータ:
path - ページパス
name - ページ名
戻り値:
結果文字列

getFullPath

protected java.lang.String getFullPath(cx.ath.kgslab.wiki.pages.Page page)
ページのフルパスの取得
ページパスとページ名を結合し、フルパスを生成する。

パラメータ:
page - ページ情報
戻り値:
ページパス

parsePagePath

public static void parsePagePath(java.lang.String page,
                                 cx.ath.kgslab.wiki.pages.Page info)
ページパスの解釈処理
ページのフルパスから、ページ名、ページパスを抽出する。

パラメータ:
page - ページパス
info - ページ情報

parsePath

public static java.lang.String parsePath(java.lang.String path,
                                         java.lang.String thisPath)
ページパスの解釈処理
ページパス中の".."や"."を元ページのパスを元に、実際のパスに変換する。

パラメータ:
path - ページパス
thisPath - 元ページパス
戻り値:
処理結果

getConfig

public JaJaWikiConfig getConfig()
JaJaWiki設定情報

定義:
インタフェース PageManager 内の getConfig
戻り値:
JaJaWiki設定情報

setConfig

public void setConfig(JaJaWikiConfig config)
JaJaWiki設定情報

定義:
インタフェース PageManager 内の setConfig
パラメータ:
config - JaJaWiki設定情報

getCacheManager

public net.sf.ehcache.CacheManager getCacheManager()
キャッシュマネージャの取得

戻り値:
キャッシュマネージャ

setCacheManager

public void setCacheManager(net.sf.ehcache.CacheManager manager)
キャッシュマネージャの設定

パラメータ:
manager - キャッシュマネージャ

addPageChangeListener

public void addPageChangeListener(PageChangeListener listener)
インタフェース PageManager の記述:
DOCUMENT ME!

定義:
インタフェース PageManager 内の addPageChangeListener
パラメータ:
listener - DOCUMENT ME!

firePageChanged

protected void firePageChanged()
DOCUMENT ME!