Node.jsベースのCMS calipsoを動かしてみる

Node.jsベースのCMS calipsoを動かしてみる

Clock Icon2014.06.30 11:27

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。



(WYSIWYGRole


 


(一)MacOS X 10.8.5

(二)Node.js 0.10.29

(三)npm 1.4.16

(四)mongodb 2.4.10

(五)calipso 0.3.50


 calipsoNode.js,mongodb,npm
 /Library/WebServer/Documents/MySite
$ sudo npm install calipso -g
$ sudo calipso site /Library/WebServer/Documents/MySite
$ cd /Library/WebServer/Documents/MySite
$ calipso server

calipsocalipso server server.port=3000 &

calipsoURL http://127.0.0.1:3000 calipso

calipso_2
Installation PasswordInstallation Password

calipso_1_1
Installation Password Create Database (mongodb

calipso_3
DBAdminCreate Admin 

calipso_4
Aloha Text Editor

calipso_5


calipso_7_1


Admin ADMINISTRATION / Core / Configuration Theme Frontend Theme  Admin Theme cleanslatecalipso

calipso_7_2


calipso_11


CONTENT MANAGEMENT

calipso_12
 Create  Next 

CMS

calipso_13
HTMLWYSIWYG

calipsoWYSIWYG


CMSWYSIWYGTINYMCE
TINYMCETinyMCE 4.1.0/tmp
$ cd /tmp
$ unzip tinymce_4.1.0.zip
$ cd tinymce
$ cd js
$ sudo cp -rp tinymce /Library/WebServer/Documents/MySite/themes/downloaded/calipso/public/js
$ cd /Library/WebServer/Documents/MySite ←calipso site コマンドで指定したパス
$ cd themes/downloaded/calipso/templates/
$ sudo vi default.html

default.html</body>tinymce.init
</body>
<script type="text/javascript" src="/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
    selector: "textarea",
    theme: "modern",
    width: 850,
    plugins: [
         "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
         "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
         "save table contextmenu directionality emoticons template paste textcolor"
   ],
   content_css: "css/content.css",
   toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons",
   style_formats: [
        {title: 'Bold text', inline: 'b'},
        {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
        {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
        {title: 'Example 1', inline: 'span', classes: 'example1'},
        {title: 'Example 2', inline: 'span', classes: 'example2'},
        {title: 'Table styles'},
        {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
    ]
 });
</script>
<%- scripts %>
</html>

default.htmlcalipso

CONTENT MANAGEMENT Create  Next WYSIWYG

calipso_15
Aloha Rich Text EditorModuleTOP

calipso_16


calipso_17

calipsoRole


AdministratorContributorGuest3Role2Role

calipso_18
1Node
30 Jun 19:26:16 - error: Attempting to add menu item with invalid params, please update your module for the 0.3.0 api, path: return

/Library/WebServer/Documents/MySite/node_modules/mongoose/lib/utils.js:419
        throw err;
              ^
TypeError: Cannot read property 'permit' of undefined
    at CalipsoMenu.addMenuItem (/Library/WebServer/Documents/MySite/lib/core/Menu.js:83:14)
    at finish (/Library/WebServer/Documents/MySite/modules/core/user/user.js:245:29)
    at Promise.<anonymous> (/Library/WebServer/Documents/MySite/modules/core/user/user.js:273:7)
    at Promise.<anonymous> (/Library/WebServer/Documents/MySite/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)
    at Promise.emit (events.js:95:17)
    at Promise.emit (/Library/WebServer/Documents/MySite/node_modules/mongoose/node_modules/mpromise/lib/promise.js:79:38)
    at Promise.fulfill (/Library/WebServer/Documents/MySite/node_modules/mongoose/node_modules/mpromise/lib/promise.js:92:20)
    at /Library/WebServer/Documents/MySite/node_modules/mongoose/lib/query.js:1833:13
    at model.Document.init (/Library/WebServer/Documents/MySite/node_modules/mongoose/lib/document.js:251:11)
    at completeOne (/Library/WebServer/Documents/MySite/node_modules/mongoose/lib/query.js:1831:10)

user.js
$ cd /Library/WebServer/Documents/MySite/modules/core/user ←インストールしたディレクトリに適宜変更して下さい。
$ vi user.js

245
res.menu.adminToolbar.addMenuItem({name:'Delete Role', path:'return', url:'/admin/roles/' + role._id + '/delete', description:'Delete role ...', security:[], icon:"icon-close"});


res.menu.adminToolbar.addMenuItem(req,{name:'Delete Role', path:'return', url:'/admin/roles/' + role._id + '/delete', description:'Delete role ...', security:[], icon:"icon-close"});

addMenuItem req 
calipso serverRole

calipso_19


WYSIWYGWYSIWYGRole

この記事をシェアする

facebook logohatena logotwitter logo

© Classmethod, Inc. All rights reserved.