5. SharePoint Online のファイラを作成する (スクリプト開発モデル)¶
ここでは、 Office 365 連携機能 の SharePointStorage APIを利用して実際にプログラムを作成する過程を説明します。
本項では、例として スクリプト開発モデル を利用しています。
本項に記載のサンプルを組み合わせると 以下のような SharePoint Online のファイラが完成します。
SharePoint Online のファイラの完成イメージ
項目
注意
Office 365 連携 のAPIの詳細については以下を参照してください。
Office 365 連携 のタグライブラリの詳細については以下を参照してください。
5.1. SharePoint Online 上にディレクトリを新規作成する¶
SharePoint Online 上にディレクトリを新規作成する実装のサンプルです。
リクエストパラメータとして受け取った プロバイダID、ターゲットのディレクトリパス、ディレクトリの名称 を元に新規ディレクトリを作成します。
実装例
SharePointStorage#makeDirectories() を利用します。
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/create_dir.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | var $currentDirPath;
var $successMsg;
var $errorMsg;
var $dirPath;
function init(request) {
var userCd = Contexts.getAccountContext().userCd;
var providerId = request.providerId;
$currentDirPath = request.targetDirPath != null ? request.targetDirPath : '/';
var createDirName = request.createDirName != null ? request.createDirName : null;
$dirPath = $currentDirPath + createDirName;
if (createDirName == null) {
$errorMsg = 'ディレクトリ名が指定されていません。';
} else {
try{
var storage = new SharePointStorage(userCd, providerId, $dirPath);
var result = storage.makeDirectories();
if(result){
$successMsg = 'ディレクトリを作成しました。<br><br>' + $dirPath;
}else{
$errorMsg = 'ディレクトリを作成できませんでした。<br><br>' + $dirPath;
}
}catch(e){
$errorMsg = 'ディレクトリ作成時にエラーが発生しました。' + '<br><br>' + e.errorMessage;
}
}
}
|
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/create_dir.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | <script type="text/javascript">
$(document).ready(function() {
var successMsg = '<imart type="string" value=$successMsg />';
var errorMsg = '<imart type="string" value=$errorMsg />';
if (successMsg != '') {
imuiShowSuccessMessage(successMsg);
} else if (errorMsg != '') {
imuiShowErrorMessage(errorMsg);
}
});
</script>
<imart type="head">
<title>Office365 - SharePointStorage API サンプル - ディレクトリ作成</title>
</imart>
<div class="imui-title">
<h1>
<imart type="string" value=$dirPath />
</h1>
</div>
<div class="imui-toolbar-wrap">
<div class="imui-toolbar-inner">
<ul class="imui-list-toolbar">
<li>
<a href="javascript:$('#backToIndex').submit();" class="imui-toolbar-icon" title="一覧に戻る">
<span class="im-ui-icon-common-16-back"></span> 一覧に戻る
</a>
</li>
</ul>
</div>
</div>
<form id="backToIndex" method="post" action="sample/office365/filer">
<imart type="hidden" targetDirPath=$currentDirPath />
</form>
|
注意
Microsoft社が提供する Microsoft 365 のWebAPIの動作仕様に起因し以下の制限があります。
SharePointStorage#makeDirectories() を利用しディレクトリを作成する場合、ルートディレクトリ直下に存在するディレクトリ名と同名のディレクトリを任意のディレクトリ配下に作成することはできません。
5.2. SharePoint Online 上にファイルをアップロードする¶
SharePoint Online 上にファイルをアップロードする実装のサンプルです。
マルチパートフォームデータとして受け取った プロバイダID、ターゲットのディレクトリパス、ファイルを元にファイルをアップロードします。
実装例
SharePointStorage#createAsBinary() を利用します。
画面遷移を伴わないため、プレゼンテーションページは不要です。
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/upload.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | function init(request) {
var userCd = Contexts.getAccountContext().userCd;
var upfile = request.getParameter('local_file');
var providerId = request.providerId;
var currentDirPath = request.targetDirPath;
var response = Web.getHTTPResponse();
response.setContentType('json');
request.setAttribute('imui-theme-builder-module', 'notheme');
var targetFilePath = currentDirPath + upfile.getFileName();
upfile.openValueAsBinary(function(reader) {
var storage = new SharePointStorage(userCd, providerId, targetFilePath);
storage.createAsBinary(function(writer) {
reader.transferTo(writer);
response.sendMessageBodyString(ImJson.toJSONString([{
'name':upfile.getFileName(),
'size':upfile.getLength()
}]));
});
});
}
|
5.3. SharePoint Online 上のファイルをダウンロードする¶
SharePoint Online 上のファイルをダウンロードする実装のサンプルです。
リクエストパラメータとして受け取った プロバイダID、ターゲットのファイルパス、ファイルの名称を元にファイルをダウンロードします。
実装例
Module.download.send() を利用します。
画面遷移を伴わないため、プレゼンテーションページは不要です。
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/download.js
1 2 3 4 5 6 7 | function init(request) {
var userCd = Contexts.getAccountContext().userCd;
var providerId = request.providerId;
var targetFilePath = request.targetFilePath;
var storage = new SharePointStorage(userCd, providerId, targetFilePath);
Module.download.send(storage, storage.getName());
}
|
5.4. SharePoint Online 上のファイルの詳細情報を表示する¶
SharePoint Online 上のファイルの詳細情報を表示する実装のサンプルです。
リクエストパラメータとして受け取った プロバイダID、ターゲットのファイルパスをファイルの詳細情報を表示します。
実装例
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/show_detail.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | var $errorMsg;
var $targetDirPathForShowDetail;
var $detail ={};
function init(request) {
var userCd = Contexts.getAccountContext().userCd;
var providerId = request.providerId;
$targetDirPathForShowDetail = request.targetDirPathForShowDetail;
if ($targetDirPathForShowDetail == null) {
$errorMsg = 'ファイル、または、ディレクトリが指定されていません。';
} else {
var storage = new SharePointStorage(userCd, providerId, $targetDirPathForShowDetail);
$detail.canonicalPath = storage.getCanonicalPath();
$detail.webUrl = storage.getWebUrl();
$detail.decodedWebUrl = decodeURIComponent(storage.getWebUrl());
$detail.created = new Date(storage.created());
$detail.createdUserId = storage.createdUserId();
$detail.createdUserName = storage.createdUserName();
$detail.lastModified = new Date(storage.lastModified());
$detail.lastModifiedUserId = storage.lastModifiedUserId();
$detail.lastModifiedUserName = storage.lastModifiedUserName();
$detail.length = storage.length();
}
}
|
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/show_detail.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | <script type="text/javascript">
$(document).ready(function() {
var errorMsg = '<imart type="string" value=$errorMsg />';
if (errorMsg != '') {
imuiShowErrorMessage(errorMsg);
}
});
</script>
<imart type="head">
<title>Office365 - SharePointStorage API サンプル - 詳細表示</title>
</imart>
<div class="imui-title">
<h1>
<imart type="string" value=$targetDirPathForShowDetail />
</h1>
</div>
<div class="imui-form-container-narrow">
<div class="imui-chapter-title">
<h2>詳細情報</h2>
</div>
<table class="imui-table">
<tr>
<th>正規化したパス</th>
<td>
<imart type="string" value=$detail.canonicalPath />
</td>
</tr>
<tr>
<th>コンテンツをブラウザ上で確認可能なWeb URL</th>
<td>
<imart type="tag" tagname="a" href=$detail.webUrl>
<imart type="string" value=$detail.decodedWebUrl /></imart>
</td>
</tr>
<tr>
<th>作成時刻</th>
<td>
<imart type="dateTime" value=$detail.created pattern="yyyy/MM/dd hh:mm:ss" />
</td>
</tr>
<tr>
<th>作成ユーザID</th>
<td>
<imart type="string" value=$detail.createdUserId />
</td>
</tr>
<tr>
<th>作成ユーザ名</th>
<td>
<imart type="string" value=$detail.createdUserName />
</td>
</tr>
<tr>
<th>最終更新時刻</th>
<td>
<imart type="dateTime" value=$detail.lastModified pattern="yyyy/MM/dd hh:mm:ss" />
</td>
</tr>
<tr>
<th>最終更新ユーザID</th>
<td>
<imart type="string" value=$detail.lastModifiedUserId />
</td>
</tr>
<tr>
<th>最終更新ユーザ名</th>
<td>
<imart type="string" value=$detail.lastModifiedUserName />
</td>
</tr>
<tr>
<th>ファイルサイズ</th>
<td>
<imart type="string" value=$detail.length /> バイト
</td>
</tr>
</table>
</div>
|
5.5. SharePoint Online 上のファイルを削除する¶
SharePoint Online 上のファイルを削除する実装のサンプルです。
リクエストパラメータとして受け取った プロバイダID、ターゲットのファイルパスを元にファイルを削除します。
実装例
SharePointStorage#remove() を利用します。
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/remove.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | var $successMsg;
var $errorMsg;
var $targetPath;
var $currentDirPath;
function init(request) {
var userCd = Contexts.getAccountContext().userCd;
var providerId = request.providerId;
$currentDirPath = request.targetDirPath != null ? request.targetDirPath : '/';
$targetPath = request.targetPathForRemove != null ? request.targetPathForRemove : null;
if ($targetPath == null) {
$errorMsg = 'ファイル、または、ディレクトリが指定されていません。';
} else {
try {
var storage = new SharePointStorage(userCd, providerId, $targetPath);
var result = storage.remove(true);
if (result) {
$successMsg = '「' + $targetPath + '」を削除しました。';
} else {
$errorMsg = '「' + $targetPath + '」を削除できませんでした。';
}
} catch (e) {
$errorMsg = '削除時にエラーが発生しました。' + '<br><br>' + e.errorMessage;
}
}
}
|
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/remove.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | <script type="text/javascript">
$(document).ready(function() {
var successMsg = '<imart type="string" value=$successMsg />';
var errorMsg = '<imart type="string" value=$errorMsg />';
if (successMsg != '') {
imuiShowSuccessMessage(successMsg);
} else if (errorMsg != '') {
imuiShowErrorMessage(errorMsg);
}
});
</script>
<imart type="head">
<title>Office365 - SharePointStorage API サンプル - 削除</title>
</imart>
<div class="imui-title">
<h1>
<imart type="string" value=$targetPath />
</h1>
</div>
<div class="imui-toolbar-wrap">
<div class="imui-toolbar-inner">
<ul class="imui-list-toolbar">
<li>
<a href="javascript:$('#backToIndex').submit();" class="imui-toolbar-icon" title="一覧に戻る">
<span class="im-ui-icon-common-16-back"></span> 一覧に戻る
</a>
</li>
</ul>
</div>
</div>
<form method="post" action="sample/office365/filer" id="backToIndex">
<imart type="hidden" targetDirPath=$currentDirPath />
</form>
|
5.6. SharePoint Online 上のドキュメントをiframeで表示する¶
SharePoint Online 上のドキュメントをiframeで表示する実装のサンプルです。
リクエストパラメータとして受け取った プロバイダID、ターゲットのファイルパスを元にドキュメントをiframeで表示します。
実装例
imOffice365 タグを利用します。
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/show_iframe.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | var $errorMsg;
var $targetPathForShowIframe;
var $isWordFile;
var $isExcelFile;
var $isPowerPointFile;
var $providerId
function init(request) {
var userCd = Contexts.getAccountContext().userCd;
$providerId = request.providerId;
$targetPathForShowIframe = request.targetPathForShowIframe;
if ($targetPathForShowIframe == null) {
$errorMsg = 'ファイルが指定されていません。';
} else {
var storage = new SharePointStorage(userCd, $providerId, $targetPathForShowIframe);
$isWordFile = isWord(storage.getName());
$isExcelFile = isExcel(storage.getName());
$isPowerPointFile = isPowerPoint(storage.getName());
}
}
function isWord(fileName) {
return getExtension(fileName) == '.docx' ? true : false;
}
function isExcel(fileName) {
return getExtension(fileName) == '.xlsx' ? true : false;
}
function isPowerPoint(fileName) {
return getExtension(fileName) == '.pptx' ? true : false;
}
function getExtension(fileName) {
var indexOfLastDot = fileName.lastIndexOf('.');
if (indexOfLastDot == -1) {
return null;
}
return fileName.substring(indexOfLastDot);
}
|
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/show_iframe.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <script type="text/javascript">
$(document).ready(function() {
var errorMsg = '<imart type="string" value=$errorMsg />';
if(errorMsg != ''){
imuiShowErrorMessage(errorMsg);
}
});
</script>
<imart type="head">
<title>Office365 - iframe 表示</title>
</imart>
<div class="imui-title">
<h1>
<imart type="string" value=$targetPathForShowIframe />
</h1>
</div>
<div id="imui-container-inner">
<imart type="condition" validity=$isWordFile>
<imart type="imOffice365Word" providerId=$providerId path=$targetPathForShowIframe
width="640" height="480" />
</imart>
<imart type="condition" validity=$isExcelFile>
<imart type="imOffice365Excel" providerId=$providerId path=$targetPathForShowIframe
width="640" height="480" />
</imart>
<imart type="condition" validity=$isPowerPointFile>
<imart type="imOffice365PowerPoint" providerId=$providerId path=$targetPathForShowIframe
width="640" height="480" />
</imart>
</div>
|
注意
ドキュメントを表示するにはユーザが Microsoft 365 - SharePoint Online にログインしている必要があります。
5.7. SharePoint Online のファイラを作成する¶
前述の実装例を組み合わて SharePoint Online のファイラを作成します。
providerId は「 Office 365 連携 セットアップガイド 」で環境構築の際に設定した <im_office365_files_api.xml> のプロバイダIDを指定してください。
実装例
SharePointStorage#directoriesStorages()、SharePointStorage#filesStorages() を利用します。
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | var $providerId = 'dhimart_1st.onmicrosoft.com';
var $userCd = Contexts.getAccountContext().userCd;
var $directoriesStorages;
var $filesDetails=[];
var $currentDirPath;
var $errorMsg;
var $parentDir;
var $existsParentDir;
function init(request){
$currentDirPath = request.targetDirPath != null ? addSlashToTheEnd(request.targetDirPath) : '/';
try{
var storage = new SharePointStorage($userCd, $providerId, $currentDirPath);
$directoriesStorages = storage.directoriesStorages(false);
var filesStorages = storage.filesStorages(false);
for (var i = 0 ; i<filesStorages.length ; i++){
var fileDetail = {
fileName : filesStorages[i].getName() ,
filePath : filesStorages[i].getPath() ,
isWordExcelPowerPointFile:isWordExcelPowerPointFile(filesStorages[i].getName())
};
$filesDetails[i] = fileDetail;
}
$parentDir = storage.getParent();
if($parentDir == null){
$existsParentDir = false;
}else{
$existsParentDir = true;
}
}catch(e if e.errorCode == 'oauth.precondition'){
$errorMsg = '「外部連携アプリケーション」画面でアプリケーションを許可してください。';
}catch(e){
$errorMsg = 'ディレクトリ、または、ファイル一覧の取得時にエラーが発生しました。'
+ '<br><br>' + e.errorMessage;
}
}
function isWordExcelPowerPointFile(fileName){
var indexOfLastDot = fileName.lastIndexOf('.');
if (indexOfLastDot == -1) {
return false;
}
var extension = fileName.substring(indexOfLastDot);
if (extension == '.docx' || extension == '.xlsx' || extension == '.pptx') {
return true;
} else {
return false;
}
}
function addSlashToTheEnd(s) {
var indexOfLastSlash = s.lastIndexOf('/');
if((indexOfLastSlash == -1) || s.substr((s.length - 1)) =='/'){
return s;
} else {
return s + '/';
}
}
|
%CONTEXT_PATH%/WEB-INF/jssp/src/sample/office365/filer/index.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | <script type="text/javascript">
function moveDir(targetDirPath) {
$('#targetDirPathForMove').val('/' + targetDirPath);
$('#moveDirForm').submit();
}
function downloadFile(targetFilePath) {
$('#targetFilePath').val(targetFilePath);
$('#downloadFileForm').submit();
}
function removeFileOrDir(targetPath) {
$('#targetPathForRemove').val(targetPath);
$('#removeFileOrDirForm').submit();
}
function showDetail(targetDirPath) {
$('#targetDirPathForShowDetail').val(targetDirPath);
$('#showDetailForm').submit();
}
function showIframe(targetFilePath) {
$('#targetPathForShowIframe').val(targetFilePath);
$('#showIframeForm').submit();
}
$(document).ready(function() {
var errorMsg = '<imart type="string" value=$errorMsg />';
if(errorMsg != ''){
imuiShowErrorMessage(errorMsg);
}
});
$(function($) {
$('#toParent').click(function() {
$('#targetDirPathForMove').val(
'/' + '<imart type="string" value=$parentDir />');
$('#moveDirForm').submit();
});
});
</script>
<imart type="head">
<title>Office365 - SharePointStorage API サンプル</title>
</imart>
<div class="imui-title">
<h1>
<imart type="string" value=$currentDirPath />
</h1>
</div>
<div class="imui-form-container-narrow">
<div class="imui-chapter-title">
<h2>ファイル一覧</h2>
</div>
<form method="post" action="sample/office365/filer">
<imart type="imuiTextbox" name="targetDirPath" value=$currentDirPath size="70" />
<input type="submit" value="移動" class="imui-small-button" />
</form>
<br>
<table class="imui-table">
<tr>
<th>名前</th>
<th>詳細</th>
<th>削除</th>
<th>iframe表示</th>
</tr>
<imart type="condition" validity=$existsParentDir>
<tr>
<td>
<a href="javascript:void(0)" id="toParent">親ディレクトリへ移動</a>
</td>
<td></td>
<td></td>
<td></td>
</tr>
</imart>
<!-- ディレクトリ一覧 -->
<imart type="repeat" list=$directoriesStorages item="dirStorage" index="idx">
<tr>
<td>
<span class="im-ui-icon-common-16-folder"></span>
<a href="javascript:void(0)"
onclick='moveDir("<imart type="string" value=dirStorage.getPath/>");'>
<imart type="string" value=dirStorage.getName />
</a>
</td>
<td align="center">
<a href="javascript:void(0)"
onclick='showDetail("<imart type="string" value=dirStorage.getPath/>");'>
<span class="im-ui-icon-common-16-information"></span>
</a>
</td>
<td align="center">
<a href="javascript:void(0)"
onclick='removeFileOrDir("<imart type="string" value=dirStorage.getPath/>");'>
<span class="im-ui-icon-common-16-trashbox"></span>
</a>
</td>
<td></td>
</tr>
</imart>
<!-- ファイル一覧 -->
<imart type="repeat" list=$filesDetails item="fileStorage" index="idx">
<tr>
<td>
<span class="im-ui-icon-common-16-document"></span>
<a href="javascript:void(0)"
onclick='downloadFile("<imart type="string" value=fileStorage.filePath/>");'>
<imart type="string" value=fileStorage.fileName />
</a>
</td>
<td align="center">
<a href="javascript:void(0)"
onclick='showDetail("<imart type="string" value=fileStorage.filePath/>");'>
<span class="im-ui-icon-common-16-information"></span>
</a>
</td>
<td align="center">
<a href="javascript:void(0)"
onclick='removeFileOrDir("<imart type="string" value=fileStorage.filePath/>");'>
<span class="im-ui-icon-common-16-trashbox"></span>
</a>
</td>
<td align="center">
<imart type="condition" validity=fileStorage.isWordExcelPowerPointFile>
<a href="javascript:void(0)"
onclick='showIframe("<imart type="string" value=fileStorage.filePath/>");'>
<span class="im-ui-icon-common-16-preview"></span>
</a>
</imart>
</td>
</tr>
</imart>
</table>
<br>
<div class="imui-chapter-title">
<h2>ファイルアップロード</h2>
</div>
<form id="uploadForm" action="sample/office365/filer/upload" enctype="multipart/form-data">
<imart type="imuiFileUpload" outerFormId="uploadForm" />
<imart type="input" style="hidden" value=$currentDirPath id="targetDirPath" name="targetDirPath" />
<imart type="hidden" providerId=$providerId />
</form>
<div class="imui-chapter-title">
<h2>ディレクトリ新規作成</h2>
</div>
<form method="POST" name="createDir" id="createDir"
action="sample/office365/filer/create_dir">
<imart type="imuiTextbox" name="createDirName" />
<imart type="hidden" targetDirPath=$currentDirPath providerId=$providerId />
<input type="submit" value="作成" class="imui-small-button" />
</form>
<form id="moveDirForm" name="moveDirForm" method="POST"
action="sample/office365/filer">
<imart type="input" style="hidden" name="targetDirPath" id="targetDirPathForMove" />
<imart type="hidden" providerId=$providerId />
</form>
<form id="showDetailForm" name="showDetailForm" method="POST"
action="sample/office365/filer/show_detail" target="office365_show_detail">
<imart type="input" style="hidden" name="targetDirPathForShowDetail" id="targetDirPathForShowDetail" />
<imart type="hidden" providerId=$providerId />
</form>
<form name="removeFileOrDirForm" id="removeFileOrDirForm" method="POST"
action="sample/office365/filer/remove">
<imart type="input" style="hidden" id="targetPathForRemove" name="targetPathForRemove" />
<imart type="hidden" targetDirPath=$currentDirPath providerId=$providerId />
</form>
<form name="downloadFileForm" id="downloadFileForm" method="POST"
action="sample/office365/filer/download">
<imart type="input" style="hidden" name="targetFilePath" id="targetFilePath" />
<imart type="hidden" providerId=$providerId />
</form>
<form method="POST" name="showIframeForm" id="showIframeForm"
action="sample/office365/filer/show_iframe" target="office365_show_iframe">
<imart type="input" style="hidden" name="targetPathForShowIframe" id="targetPathForShowIframe" />
<imart type="hidden" providerId=$providerId />
</form>
</div>
|
5.8. ルーティングテーブルを作成する¶
「スクリプト開発モデル用ルーティングテーブル」を利用してURLに対して スクリプト開発モデル のプログラムの割り当てを行います。
詳しくは「スクリプト開発モデル プログラミングガイド 」-「ルーティング 」を参照してください。
実装例
%CONTEXT_PATH%/WEB-INF/conf/routing-jssp-config/office365.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?xml version="1.0" encoding="UTF-8"?>
<routing-jssp-config
xmlns="http://www.intra-mart.jp/router/routing-jssp-config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.intra-mart.jp/router/routing-jssp-config routing-jssp-config.xsd ">
<authz-default mapper="welcome-all" ></authz-default>
<file-mapping path="/sample/office365/filer" page="sample/office365/filer/index" />
<file-mapping path="/sample/office365/filer/remove" page="sample/office365/filer/remove"/>
<file-mapping path="/sample/office365/filer/download" page="sample/office365/filer/download" />
<file-mapping path="/sample/office365/filer/upload" page="sample/office365/filer/upload" />
<file-mapping path="/sample/office365/filer/create_dir" page="sample/office365/filer/create_dir" />
<file-mapping path="/sample/office365/filer/show_detail" page="sample/office365/filer/show_detail" />
<file-mapping path="/sample/office365/filer/show_iframe" page="sample/office365/filer/show_iframe" />
</routing-jssp-config>
|