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

Commit db57943

Browse files
author
Jamie Snape
committed
Update module template
1 parent cd5475b commit db57943

File tree

13 files changed

+160
-65
lines changed

13 files changed

+160
-65
lines changed
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
<?php
2-
32
/*=========================================================================
4-
MIDAS Server
5-
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
6-
69328 Lyon, FRANCE.
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
All rights reserved.
6+
More information http://www.kitware.com
7+
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0.txt
713
8-
See Copyright.txt for details.
9-
This software is distributed WITHOUT ANY WARRANTY; without even
10-
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11-
PURPOSE. See the above copyright notices for more information.
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
1219
=========================================================================*/
1320

1421
/** App controller for the @MN@ module */
1522
class @MN_CAP@_AppController extends MIDAS_GlobalModule
1623
{
1724
public $moduleName = '@MN@';
18-
} //end class
19-
?>
25+
}

utils/moduleTemplate/Notification.php

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
<?php
2-
/** notification manager*/
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
All rights reserved.
6+
More information http://www.kitware.com
7+
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0.txt
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
=========================================================================*/
20+
21+
/** Notification manager for the @MN@ module */
322
class @MN_CAP@_Notification extends MIDAS_Notification
423
{
524
public $moduleName = '@MN@';
625

7-
/** init notification process */
26+
/** Init notification process */
827
public function init()
928
{
1029
$fc = Zend_Controller_Front::getInstance();
@@ -14,13 +33,10 @@ public function init()
1433
$this->addCallBack('CALLBACK_CORE_ITEM_DELETED', 'handleItemDeleted');
1534
}
1635

17-
/**
18-
* STUB: example of receiving a callback when an item is deleted
19-
*/
36+
/** STUB: Example of receiving a callback when an item is deleted */
2037
public function handleItemDeleted($params)
2138
{
2239
$itemDao = $params['item'];
23-
// TODO do something about this item dao
40+
// TODO: Do something with this item DAO
2441
}
2542
}
26-
?>
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<?php
22
/*=========================================================================
3-
MIDAS Server
4-
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
5-
69328 Lyon, FRANCE.
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
All rights reserved.
6+
More information http://www.kitware.com
67
7-
See Copyright.txt for details.
8-
This software is distributed WITHOUT ANY WARRANTY; without even
9-
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10-
PURPOSE. See the above copyright notices for more information.
11-
=========================================================================*/
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0.txt
1213
13-
?>
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
=========================================================================*/
Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,57 @@
11
<?php
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
All rights reserved.
6+
More information http://www.kitware.com
7+
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0.txt
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
=========================================================================*/
220

321
/** Controller template for the @MN@ module */
422
class @MN_CAP@_ThingController extends @MN_CAP@_AppController
5-
{
23+
{
624
public $_models = array();
725
public $_moduleModels = array();
826

9-
// STUB
27+
/** STUB: Example get action */
1028
function getAction()
1129
{
1230
$id = $this->_getParam('id');
1331
$this->view->id = $id;
1432
}
1533

16-
// STUB
34+
/** STUB: Example create action */
1735
function createAction()
1836
{
1937
$this->disableLayout();
2038
$this->disableView();
2139
echo JsonComponent::encode(array('status' => 'ok', 'message' => 'Done'));
2240
}
2341

24-
// STUB
42+
/** STUB: Example update action */
2543
function updateAction()
2644
{
2745
$this->disableLayout();
2846
$this->disableView();
2947
echo JsonComponent::encode(array('status' => 'ok', 'message' => 'Done'));
3048
}
3149

32-
// STUB
50+
/** STUB: Example delete action */
3351
function deleteAction()
3452
{
3553
$this->disableLayout();
3654
$this->disableView();
3755
echo JsonComponent::encode(array('status' => 'ok', 'message' => 'Done'));
3856
}
39-
}//end class
57+
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
CREATE TABLE IF NOT EXISTS `@MN@_thing` (
32
`thing_id` bigint(20) NOT NULL AUTO_INCREMENT,
43
`creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
5-
PRIMARY KEY (`thing_id`),
4+
PRIMARY KEY (`thing_id`)
65
);

utils/moduleTemplate/database/pgsql/1.0.0.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
CREATE TABLE @MN@_thing (
32
thing_id serial PRIMARY KEY,
43
creation_date timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
<?php
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
All rights reserved.
6+
More information http://www.kitware.com
27
3-
/** App dao for @MN@ module */
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0.txt
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
19+
=========================================================================*/
20+
21+
/** App DAO for the @MN@ module */
422
class @MN_CAP@_AppDao extends MIDAS_GlobalDao
523
{
624
public $_module = '@MN@';
7-
} //end class
8-
?>
25+
}
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
<?php
22
/*=========================================================================
3-
MIDAS Server
4-
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
5-
69328 Lyon, FRANCE.
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE
5+
All rights reserved.
6+
More information http://www.kitware.com
67
7-
See Copyright.txt for details.
8-
This software is distributed WITHOUT ANY WARRANTY; without even
9-
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10-
PURPOSE. See the above copyright notices for more information.
8+
Licensed under the Apache License, Version 2.0 (the "License");
9+
you may not use this file except in compliance with the License.
10+
You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0.txt
13+
14+
Unless required by applicable law or agreed to in writing, software
15+
distributed under the License is distributed on an "AS IS" BASIS,
16+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
See the License for the specific language governing permissions and
18+
limitations under the License.
1119
=========================================================================*/
1220

1321
/** Base model class for the @MN@ module */
1422
class @MN_CAP@_AppModel extends MIDASModel
15-
{
23+
{
1624
public $moduleName = '@MN@';
17-
}
18-
?>
25+
}

utils/moduleTemplate/models/base/ThingModelBase.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
See the License for the specific language governing permissions and
1818
limitations under the License.
1919
=========================================================================*/
20+
21+
/** Base model class template for the @MN@ module */
2022
abstract class @MN_CAP@_ThingModelBase extends @MN_CAP@_AppModel
21-
{
22-
/** constructor */
23+
{
24+
/** Constructor */
2325
public function __construct()
2426
{
2527
parent::__construct();
@@ -32,5 +34,4 @@ public function __construct()
3234
);
3335
$this->initialize();
3436
}
35-
}
36-
?>
37+
}

utils/moduleTemplate/models/dao/ThingDao.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
See the License for the specific language governing permissions and
1818
limitations under the License.
1919
=========================================================================*/
20-
/** Dao for @MN@ thing */
20+
21+
/** DAO template for the @MN@ module */
2122
class @MN_CAP@_ThingDao extends @MN_CAP@_AppDao
2223
{
2324
public $_model = 'Thing';
2425
public $_module = '@MN@';
2526
}
26-
?>

0 commit comments

Comments
 (0)