Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 9f46a0b

Browse files
author
Charles Ma
committed
ENH: refs #301 Added VXML definition
Fixed dashboard
1 parent 14e618e commit 9f46a0b

File tree

9 files changed

+520
-84
lines changed

9 files changed

+520
-84
lines changed

core/controllers/components/UtilityComponent.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function getAllModules()
3636
private function _initModulesConfig($dir)
3737
{
3838
$handle = opendir($dir);
39+
$modules = array();
3940
while(false !== ($file = readdir($handle)))
4041
{
4142
if(file_exists($dir.$file.'/configs/module.ini'))

core/views/item/view.phtml

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php
22
/*=========================================================================
33
MIDAS Server
44
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
@@ -30,39 +30,39 @@ if($this->preview) // module visualize
3030
echo "<a href='{$this->webroot}/download/?items={$this->itemDao->getKey()}'><img style='float:left;margin-right:2px;' alt='' src='{$this->coreWebroot}/public/images/icons/download.png'/>";
3131
if($this->itemIsLink)
3232
{
33-
echo $this->t('View as weblink');
33+
echo $this->t('View as weblink');
3434
}
3535
else
3636
{
37-
echo $this->t('Download');
37+
echo $this->t('Download');
3838
}
3939
echo '</a>';
4040
?>
4141
</div>
42-
42+
4343
<?php
4444
if($this->backUploaded)
4545
{
4646
echo '<div style="float:right;margin-right:2px;" class="genericBigButton ">';
4747
echo "<a href='{$this->webroot}/browse/uploaded'><img style='float:left;margin-right:2px;' alt='' src='{$this->coreWebroot}/public/images/icons/back.png'/>";
48-
echo $this->t('Back');
48+
echo $this->t('Back');
4949
echo "</a>";
5050
echo '</div>';
5151
}
5252
else if($this->currentFolder)
5353
{
5454
echo '<div style="float:right;margin-right:2px;" class="genericBigButton ">';
5555
echo "<a href='{$this->webroot}/folder/{$this->currentFolder->getKey()}'><img style='float:left;margin-right:2px;' alt='' src='{$this->coreWebroot}/public/images/icons/back.png'/>";
56-
echo $this->t('Back');
56+
echo $this->t('Back');
5757
echo "</a>";
5858
echo '</div>';
5959
}
6060
?>
61-
61+
6262
<br/>
6363
<div class="itemStats">
64-
<?php echo $this->itemDao->getView()?> <?php echo $this->t('views'); ?>,
65-
<?php echo $this->itemDao->getDownload()?> <?php echo $this->t('downloads');?></div>
64+
<?php echo $this->itemDao->getView()?> <?php echo $this->t('views'); ?>,
65+
<?php echo $this->itemDao->getDownload()?> <?php echo $this->t('downloads');?></div>
6666
</div>
6767
<div style='width:400px;' class="genericInfo">
6868
<div class="genericThumbnail">
@@ -74,7 +74,7 @@ if($this->preview) // module visualize
7474
<div class="genericSubtitle" style="color:grey;"><?php echo $this->itemSize;?></div>
7575

7676
</div>
77-
77+
7878
<table style='display:block;' class="midasTree">
7979
<thead>
8080
<tr>
@@ -94,19 +94,19 @@ if($this->preview) // module visualize
9494
echo " <td>{$revision->getChanges()}</td>";
9595
echo "</tr>";
9696
$node++;
97-
}
98-
?>
97+
}
98+
?>
9999
</tbody>
100100
</table>
101-
101+
102102
<h4 style="margin-bottom: 5px;"><?php echo $this->t('Latest revision metadata')?>:</h4>
103103

104104
<?php if(count($this->metadatavalues) == 0)
105105
{
106-
echo "No metadata for this revision.";
106+
echo "No metadata for this revision.";
107107
}
108-
else
109-
{
108+
else
109+
{
110110
?>
111111
<table style='display:block;' id="metadataTable" class="midasTree">
112112
<thead>
@@ -133,18 +133,18 @@ if($this->preview) // module visualize
133133
}
134134
echo " </td>";
135135
echo "</tr>";
136-
}
137-
?>
136+
}
137+
?>
138138
</tbody>
139139
</table>
140140
<?php } ?>
141141
<br/>
142142
<br/>
143-
143+
144144
<a onclick="$('#revisionContent').show();$(this).remove();"><?php echo $this->t('Show Content')?></a>
145-
145+
146146
<div id="revisionContent">
147-
147+
148148
<h4 style="margin-top: 0px;margin-bottom: 5px;"><?php echo $this->t('Latest revision content')?>:</h4>
149149

150150
<table style='display:block;' id="browseTable" class="midasTree">
@@ -165,12 +165,12 @@ if($this->preview) // module visualize
165165
echo " <td>{$this->Utility->formatSize($bitstream->getSizebytes())} </td>";
166166
echo " <td>{$bitstream->getMimetype()}</td>";
167167
echo "</tr>";
168-
}
169-
?>
168+
}
169+
?>
170170
</tbody>
171171
</table>
172172
</div>
173-
173+
174174
</div>
175175
<div class="viewSideBar">
176176
<?php
@@ -180,77 +180,86 @@ if($this->preview) // module visualize
180180

181181
<h1>Actions</h1>
182182
<ul>
183-
<?php
183+
<?php
184184
if($this->preview)
185185
{
186-
echo
186+
echo
187187
"<li>
188188
<a id='itemPreviewLink'><img alt='' src='{$this->coreWebroot}/public/images/icons/view.png'/> {$this->t('Preview')}</a>
189-
</li>
189+
</li>
190190
";
191191
}
192192
if($this->isModerator)
193193
{
194-
echo
194+
echo
195195
"<li>
196196
<a href='javascript:;' class='moveCopyLink' ><img alt='' src='{$this->coreWebroot}/public/images/icons/copy.png'/> {$this->t('Copy')}</a>
197-
</li>
197+
</li>
198198
<li>
199199
<a href='javascript:;' class='editItemLink' ><img alt='' src='{$this->coreWebroot}/public/images/icons/edit.png'/> {$this->t('Edit')}</a>
200-
</li>
200+
</li>
201201
<li>
202202
<a href='javascript:;' class='addMetadataLink' ><img alt='' src='{$this->coreWebroot}/public/images/icons/metadata.png'/> {$this->t('Add Metadata')}</a>
203-
</li>
203+
</li>
204204
<li>
205205
<a href='javascript:;' type='item' element='{$this->itemDao->getKey()}' class='sharingLink' ><img alt='' src='{$this->coreWebroot}/public/images/icons/share.png'/> {$this->t('Share')}</a>
206-
</li>
206+
</li>
207207
<li>
208208
<a href='javascript:;' type='item' element='{$this->itemDao->getKey()}' class='uploadRevisionLink' ><img alt='' src='{$this->coreWebroot}/public/images/icons/upload.png'/> {$this->t('Upload new revision')}</a>
209-
</li>
209+
</li>
210210
";
211+
$tmp = Zend_Registry::get('notifier')->callback("CALLBACK_REMOTEPROCESSING_IS_EXECUTABLE", array('item' => $this->itemDao));
212+
if(isset($tmp['remoteprocessing']) && $tmp['remoteprocessing'])
213+
{
214+
echo
215+
"<li>
216+
<a href='".$this->webroot."/remoteprocessing/executable/define/?itemId=".$this->itemDao->getKey()."'><img alt='' src='{$this->coreWebroot}/public/images/icons/metadata.png'/> {$this->t('Define Executable')}</a>
217+
</li>
218+
";
219+
}
211220
}
212221
if($this->isAdmin)
213222
{
214223
$modules = Zend_Registry::get('modulesEnable');
215224
if(in_array('statistics', $modules))
216225
{
217-
echo
226+
echo
218227
"<li>
219228
<a href='".$this->webroot."/statistics/item?id=".$this->itemDao->getKey()."'><img alt='' src='{$this->coreWebroot}/public/images/icons/metadata.png'/> {$this->t('Statistics')}</a>
220-
</li>
229+
</li>
221230
";
222231
}
223-
echo
232+
echo
224233
"
225234
<li>
226235
<a href='javascript:;' id='itemDeleteLink'><img alt='' src='{$this->coreWebroot}/public/images/icons/close.png'/> {$this->t('Delete')}</a>
227-
</li>
228-
";
236+
</li>
237+
";
229238
}
230239
?>
231240
</ul>
232241
</div>
233242
<?php
234243
}?>
235244
<div class="<?php echo (!$this->preview && !$this->isModerator && !$this->isAdmin)?'sideElementFirst':''; ?>sideElement<?php if(count($this->sameLocation) > 1) echo "Last"?> viewInfo">
236-
<h1>Info</h1>
237-
<table>
245+
<h1>Info</h1>
246+
<table>
238247
<tbody>
239-
<tr>
248+
<tr>
240249
<td><?php echo $this->t('Created')?></td>
241-
<td><?php echo $this->itemDao->creation?></td>
250+
<td><?php echo $this->itemDao->creation?></td>
242251
</tr>
243-
<tr>
244-
<td><?php echo $this->t('Uploaded by');?></td>
252+
<tr>
253+
<td><?php echo $this->t('Uploaded by');?></td>
245254
<td><?php echo $this->linkuser($this->itemDao->lastrevision->getUser())?></td>
246255
</tr>
247-
<tr>
248-
<td>Revision</td>
256+
<tr>
257+
<td>Revision</td>
249258
<td><?php echo $this->itemDao->lastrevision->getRevision()?></td>
250259
</tr>
251-
<tr>
260+
<tr>
252261
<td><?php echo $this->t('Files');?></td>
253-
<td><?php echo count($this->itemDao->lastrevision->getBitstreams())?></td>
262+
<td><?php echo count($this->itemDao->lastrevision->getBitstreams())?></td>
254263
</tr>
255264
</tbody>
256265
</table>
@@ -269,7 +278,7 @@ if($this->preview) // module visualize
269278
if(count($this->sameLocation) > 1)
270279
{?>
271280
<div class='sideElementLast viewSameLocation'>
272-
<h1><?php echo $this->t('In the same location')?></h1>
281+
<h1><?php echo $this->t('In the same location')?></h1>
273282
<ul>
274283
<?php
275284
foreach($this->sameLocation as $item)

modules/remoteprocessing/Notification.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,28 @@ public function init()
1414
{
1515
$this->enableWebAPI($this->moduleName);
1616
$this->addTask("TASK_REMOTEPROCESSING_ADD_JOB", 'addJob', "");
17+
$this->addCallBack('CALLBACK_REMOTEPROCESSING_IS_EXECUTABLE', 'isExecutable');
18+
1719
}//end init
1820

21+
/** check if item contains an executable */
22+
public function isExecutable($params)
23+
{
24+
$modelLoad = new MIDAS_ModelLoader();
25+
$itemModel = $modelLoad->loadModel('Item');
26+
$item = $params['item'];
27+
$revision = $itemModel->getLastRevision($item);
28+
$bitstreams = $revision->getBitstreams();
29+
foreach($bitstreams as $b)
30+
{
31+
if(is_executable($b->getFullPath()))
32+
{
33+
return true;
34+
}
35+
}
36+
return false;
37+
}
38+
1939
/** get Config Tabs */
2040
public function addJob($params)
2141
{

0 commit comments

Comments
 (0)