LoginSignup
18
16

More than 5 years have passed since last update.

Alfrescoをインストール後やったこと

Posted at

alfrescoをインストールした後にあれをこうしたいなーと思って調べたことを備忘録がてら記載します。
私自身はほとんどweb系の知識がない素人なので、きっともっとちゃんとしたやり方があるのだと思いますが。。。
もしこれがどなたかの参考になれば幸いです。


環境など

  1. OS CentOS Linux release 7.0.1406 (Core)
  2. Alfrescoバージョン 5.0.C
  3. インストール方法 インストーラを使用

ログイン後に遷移するURLの変更

ログイン後は通常各ユーザのダッシュボードに遷移するが、文書管理メインだと特定のサイトのドキュメントライブラリかリポジトリに飛んでくれたほうが都合がいい。
if文による処理が書かれていたが、面倒なので全部コメントアウトして遷移させたいURLを直書きした所問題なく動作した。
(XXXXXはサイト名)

site-index.jspの該当部分を編集。
<alfresco_dir>/tomcat/webapps/share/site-index.jsp

site-index.jsp
// redirect to site or user dashboard as appropriate
String siteName = request.getParameter("site");
// ここからコメントアウト
// if (siteName == null || siteName.length() == 0)
// {
// forward to user specific dashboard page
// response.sendRedirect(request.getContextPath()+ "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
// }
// else
// {
// forward to site specific dashboard page
// response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/dashboard");
// }
// ここまでコメントアウト
// 以下を追記
response.sendRedirect(request.getContextPath() + "/page/site/" + "XXXXX/documentlibrary");
%>

ホームURLの変更

ログイン後の遷移URLは変更したが、ホームを押すとダッシュボードに飛んでしまう。
これではあまり意味が無いので、ホームのURLも変更した。
(XXXXXはサイト名)

share-header.lib.jsの該当部分を編集。
<alfresco_dir>/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js

share-header.lib.js
{
id: "HEADER_HOME",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_HOME",
label: "header.menu.home.label",
// targetUrl: "user/" + encodeURIComponent(user.name) + "/dashboard"
targetUrl: "site/xxxxx/documentlibrary"
}

ヘッダーメニューの非表示化

admin以外のユーザにはサイトを作らせたくなかったのと、リポジトリやユーザ一覧も使用しないことからあっても邪魔なので非表示にした。

share-header.get.jsの該当部分に追記
<alfresco_dir>/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/header/share-header.get.js

share-header.get.js
// 以下を追記
if (!user.isAdmin)
{
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE");
widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY");
}

Officeファイルがプレビューできない場合

大体の場合LibreOfficeが動いてなかった。
<alfresco_dir>/alfresco.shの中には

alfresco.sh
LIBREOFFICE_SCRIPT=$INSTALLDIR/libreoffice/scripts/ctl.sh

と書かれているが、なぜか件のディレクトリにはlibreoffice_ctl.shが置いてあるので動くわけがない。
libreoffice_ctl.shをctl.shにリネームするかalfresco.shの該当部分をlibreoffice_ctl.shに編集する。
これで動く場合はそれでOKなのだが、私の環境では動作しなかった。
alfrescoのフォーラムを見ると同じように悩んでいる人がいて、libreoffice_ctl.shのSOFFICE=以下にあるバックスラッシュを編集すると良いとのこと。
実際試したらあっさり動いたのでとても助かった。

libreoffice_ctl.sh
# Libre Office
SOFFICE_PATH="/opt/alfresco-5.0.c/libreoffice/program"
SOFFICE_PORT="8100"
SOFFICEBIN=/opt/alfresco-5.0.c/libreoffice/program/.soffice.bin
SOFFICEWRAPPER=/opt/alfresco-5.0.c/libreoffice/program/soffice.bin
#SOFFICE="$SOFFICEWRAPPER --nofirststartwizard --nologo --headless --accept=socket,host=localhost,port=$SOFFICE_PORT\;urp\;StarOffice.ServiceManager"
SOFFICE="$SOFFICEWRAPPER --nofirststartwizard --nologo --headless --accept=socket,host=localhost,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager"
SOFFICE_STATUS=""

参考:Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh | Alfresco Forums

18
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
16