OSDN Git Service

[Develop and Manual test] /workspace ページの開発 v0.3.0p0027
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 27 Jan 2016 19:22:47 +0000 (04:22 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 27 Jan 2016 19:22:47 +0000 (04:22 +0900)
    /workspaceに、workspace内の全てのファイルを表示。
 On branch master
 Changes to be committed:
modified:   front-end/app/scripts/App.ts
modified:   front-end/app/scripts/controllers/Execution.ts
modified:   front-end/app/scripts/controllers/Workspace.ts
modified:   front-end/app/scripts/declares.ts
modified:   front-end/app/scripts/directives/Command.ts
new file:   front-end/app/scripts/directives/Directory.ts
modified:   front-end/app/scripts/entry.ts
modified:   front-end/app/scripts/reference.ts
modified:   front-end/app/scripts/services/APIEndPoint.ts
modified:   front-end/app/templates/command.html
new file:   front-end/app/templates/directory.html
modified:   front-end/app/templates/workspace.html
modified:   front-end/dist/bundle.js
modified:   front-end/dist/templates/command.html
new file:   front-end/dist/templates/directory.html
modified:   front-end/dist/templates/workspace.html

16 files changed:
front-end/app/scripts/App.ts
front-end/app/scripts/controllers/Execution.ts
front-end/app/scripts/controllers/Workspace.ts
front-end/app/scripts/declares.ts
front-end/app/scripts/directives/Command.ts
front-end/app/scripts/directives/Directory.ts [new file with mode: 0644]
front-end/app/scripts/entry.ts
front-end/app/scripts/reference.ts
front-end/app/scripts/services/APIEndPoint.ts
front-end/app/templates/command.html
front-end/app/templates/directory.html [new file with mode: 0644]
front-end/app/templates/workspace.html
front-end/dist/bundle.js
front-end/dist/templates/command.html
front-end/dist/templates/directory.html [new file with mode: 0644]
front-end/dist/templates/workspace.html

index 617d1f0..9b819dc 100644 (file)
@@ -43,9 +43,11 @@ namespace app {
     zephyr.controller('historyController', controllers.History);
     zephyr.controller('commandController', directives.CommandController);
     zephyr.controller('optionController', directives.OptionController);
+    zephyr.controller('directoryController', directives.DirectoryController);
 
     zephyr.directive('headerMenu', directives.HeaderMenu.Factory());
     zephyr.directive('command', directives.Command.Factory());
     zephyr.directive('option', directives.Option.Factory());
+    zephyr.directive('directory', directives.Directory.Factory());
 
 }
index 22127e0..fc931f7 100644 (file)
@@ -26,6 +26,14 @@ namespace app.controllers {
 
         public remove(index: number, list: declares.CommandInfo[]) {
             list.splice(index, 1);
+
+            /**
+             * Commandディレクティブから実行する際にはExecution.commandInfoListの参照を取得できない。
+             * ディレクティブ経由でExecution.commandInfoListの参照を取得。
+             * this.commandInfoList.splice(index, 1);
+             * 上記のコードは実行できない。
+             * thisがremoveの呼び出し元となるため。
+             */
         }
 
         public close() {
index 76d1c77..273dd69 100644 (file)
@@ -2,22 +2,32 @@ namespace app.controllers {
     export class Workspace {
 
         public page: string;
-        public fileInfo: declares.IFileInfo[];
+        public directoryList: declares.IDirectoryInfo[];
 
         public static $inject = ['$scope', 'APIEndPoint'];
 
         constructor(private $scope: ng.IScope, private APIEndPoint: services.APIEndPoint) {
+            this.directoryList = [];
+
             var controller = this;
+            var directoryList = this.directoryList;
 
-            this.page = 'workspace';
+            var o = {
+                fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                name: '',
+                parentId: '',
+                fileType: '',
+                createdAt: '',
+                updatedAt:'', 
+                path: '/'
+            };
+            directoryList.push(o);
 
-            this.APIEndPoint
-                .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04') // rootのfileId
-                .$promise
-                .then(function(result) {
-                    controller.fileInfo = result.info;
-                    console.log(result);
-            });
         } 
+        
+        public addDirectory(info: declares.IDirectoryInfo, directoryList: declares.IDirectoryInfo[]) {
+            directoryList.push(info);
+        }
+
     }
 }
index 5214228..cd764b8 100644 (file)
@@ -31,11 +31,21 @@ namespace app.declares {
         fileId: string,
         name: string,
         parentId: string,
-        fileType: number,
+        fileType: string,
         createdAt: string,
         updatedAt: string
     }
 
+    export interface IDirectoryInfo extends IFileInfo {
+        fileId: string,
+        name: string,
+        parentId: string,
+        fileType: string,
+        createdAt: string,
+        updatedAt: string,
+        path: string
+    }
+
     export interface IResponse extends ng.resource.IResource<IResponse> {
         status: string,
         info: any
index a40614f..ec6bec9 100644 (file)
@@ -47,7 +47,7 @@ namespace app.directives {
 
         public static $inject = ['APIEndPoint', '$scope'];
 
-        // From parent directive.show bindToController property
+        // From parent directive bindToController property
         private index: string;
         private name: string;
         private remove: Function;
@@ -64,6 +64,8 @@ namespace app.directives {
         constructor(private APIEndPoint: services.APIEndPoint, private $scope: ng.IScope) {
             var controller = this;
 
+            console.log(this.list);
+
             // Get OptionControlFile and bind it to $scope.options
             this.APIEndPoint
                 .getOptionControlFile('dcdFilePrint')
diff --git a/front-end/app/scripts/directives/Directory.ts b/front-end/app/scripts/directives/Directory.ts
new file mode 100644 (file)
index 0000000..e39bfae
--- /dev/null
@@ -0,0 +1,80 @@
+namespace app.directives {
+
+    export class Directory implements ng.IDirective {
+
+        public restrict: string;
+        public replace: boolean;
+        public templateUrl: string;
+        private fileInfo: declares.IFileInfo;
+        public controller: string;
+        public controllerAs: string;
+        public bindToController: Object;
+
+        /**
+         * constructor
+         *
+         * @param 
+         */
+        constructor() {
+            this.restrict = 'E';
+            this.replace = true;
+            this.controller = 'directoryController';
+            this.controllerAs = 'ctrl';
+            this.bindToController = {
+                info: '=',
+                add: '&',
+                list: '=',
+                files: '='
+            };
+            this.templateUrl = 'templates/directory.html';
+        }
+
+        /**
+         * instance生成
+         * @returns {function(): HeaderMenu}
+         * @constructor
+         */
+        public static Factory(): ng.IDirectiveFactory {
+            var directive = () => {
+            return new Directory();
+            };
+            return directive;
+        }
+    }
+
+    export class DirectoryController {
+
+        public static $inject = ['APIEndPoint', '$scope'];
+
+        // From parent directive bindToController property
+        public info: declares.IDirectoryInfo;
+        public files:declares.IFileInfo[];
+        public add: Function;
+        public list: declares.IDirectoryInfo[];
+
+        constructor(private APIEndPoint: services.APIEndPoint, private $scope: ng.IScope) {
+            var controller = this;
+
+            this.APIEndPoint
+                .getFiles(this.info.fileId)
+                .$promise
+                .then((result) => {
+                    if(result.status === 'success') {
+                        controller.files = result.info;
+                        angular.forEach(result.info, (file) => {
+                            if(file.fileType === '0') {
+                                var o = file;
+                                if(controller.info.path === '/') {
+                                    o.path = '/' + file.name;
+                                } else {
+                                    o.path = controller.info.path + '/' + file.name;
+                                }
+
+                                controller.add()(o, controller.list);
+                            }
+                        });
+                    };
+                });
+        }
+    }
+}
index 72e6eb6..00f169f 100644 (file)
@@ -15,6 +15,7 @@ import './services/MyModal.ts';
 import './directives/Option.ts';
 import './directives/Command.ts';
 import './directives/HeaderMenu.ts';
+import './directives/Directory.ts';
 
 // controllers
 import './controllers/Execution.ts';
index 9e58a1c..3e70e6e 100644 (file)
@@ -8,6 +8,7 @@
 /// <reference path="./directives/Command.ts" />
 /// <reference path="./directives/HeaderMenu.ts" />
 /// <reference path="./directives/Option.ts" />
+/// <reference path="./directives/Directory.ts" />
 
 /// <reference path="./controllers/Execution.ts" />
 /// <reference path="./controllers/Workspace.ts" />
index 5235d09..865b3bc 100644 (file)
@@ -30,7 +30,6 @@ namespace app.services {
             if(fileId) {
                 endPoint += '/' + fileId;
             }
-            console.log(endPoint);
             return <declares.IResponseFileInfo>this.resource(endPoint).get();
         }
     }
index 13ba289..f9beaed 100644 (file)
@@ -1,5 +1,5 @@
 <div>
-<uib-accordion-group heading="{{ctrl.heading}}" is-open="ctrl.isOpen" panel-class="panel-danger">
+    <uib-accordion-group heading="{{ctrl.heading}}" is-open="ctrl.isOpen" panel-class="panel-danger">
         <uib-accordion-heading>
             <h4 class="panel-title">
                 [{{ctrl.index}}: {{ctrl.name}}]
diff --git a/front-end/app/templates/directory.html b/front-end/app/templates/directory.html
new file mode 100644 (file)
index 0000000..150e1fd
--- /dev/null
@@ -0,0 +1,23 @@
+<div>
+    <h3 class="page-header">{{ctrl.info.path}}</h3>
+    <table class="table table-striped table-responsive">
+        <tr>
+            <th></th>
+            <th>name</th>
+            <th>fileId</th>
+            <th>parentId</th>
+            <th>fileType</th>
+            <th>createdAt</th>
+            <th>updatedAt</th>
+        </tr>
+        <tr ng-repeat="l in ctrl.files">
+            <td><span class="glyphicon glyphicon-folder-open" ng-show="l.fileType==='0'" aria-hidden="true"></span></td>
+            <td>{{l.name}}</td>
+            <td>{{l.fileId}}</td>
+            <td>{{l.parentId}}</td>
+            <td>{{l.fileType}}</td>
+            <td>{{l.createdAt}}</td>
+            <td>{{l.updatedAt}}</td>
+        </tr>
+    </table>
+</div>
index bbd378c..bf7925a 100644 (file)
@@ -1,3 +1,6 @@
-workspace
-
-{{c.page}}
+<div class="container">
+    <div class="row">
+        <directory index="i" info="info" list="c.directoryList" add="c.addDirectory" ng-repeat="(i, info) in c.directoryList"></directory>
+    </div>
+    <button type="button" class="btn btn-default" ng-click="c.test()">WORKSPACE</button>
+</div>
index f162847..bfadc62 100644 (file)
@@ -58,6 +58,7 @@
        __webpack_require__(15);
        __webpack_require__(16);
        __webpack_require__(17);
+       __webpack_require__(18);
 
 
 /***/ },
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
-                       this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
-                           .$promise
-                           .then(function (result) {
-                           controller.fileInfo = result.info;
-                           console.log(result);
-                       });
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
                    }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
                        if (fileId) {
                            endPoint += '/' + fileId;
                        }
-                       console.log(endPoint);
                        return this.resource(endPoint).get();
                    };
                    return APIEndPoint;
                        this.APIEndPoint = APIEndPoint;
                        this.$scope = $scope;
                        var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
                            .getOptionControlFile('dcdFilePrint')
                            .$promise
        })(app || (app = {}));
        var app;
        (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
            var controllers;
            (function (controllers) {
                var Execution = (function () {
                    function Workspace($scope, APIEndPoint) {
                        this.$scope = $scope;
                        this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
                        var controller = this;
-                       this.page = 'workspace';
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
+                   }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
+                   Workspace.$inject = ['$scope', 'APIEndPoint'];
+                   return Workspace;
+               })();
+               controllers.Workspace = Workspace;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var History = (function () {
+                   function History($scope) {
+                       this.page = "History";
+                   }
+                   History.$inject = ['$scope'];
+                   return History;
+               })();
+               controllers.History = History;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           'use strict';
+           var appName = 'zephyr';
+           app.zephyr = angular.module(appName, ['ui.router', 'ngResource', 'ui.bootstrap']);
+           app.zephyr.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
+               $urlRouterProvider.otherwise('/execution');
+               $locationProvider.html5Mode({
+                   enabled: true,
+                   requireBase: false
+               });
+               $stateProvider
+                   .state('execution', {
+                   url: '/execution',
+                   templateUrl: 'templates/execution.html',
+                   controller: 'executionController',
+                   controllerAs: 'c'
+               })
+                   .state('workspace', {
+                   url: '/workspace',
+                   templateUrl: 'templates/workspace.html',
+                   controller: 'workspaceController',
+                   controllerAs: 'c'
+               })
+                   .state('history', {
+                   url: '/history',
+                   templateUrl: 'templates/history.html',
+                   controller: 'historyController',
+                   controllerAs: 'c'
+               });
+           });
+           app.zephyr.service('APIEndPoint', app.services.APIEndPoint);
+           app.zephyr.service('MyModal', app.services.MyModal);
+           app.zephyr.controller('executionController', app.controllers.Execution);
+           app.zephyr.controller('workspaceController', app.controllers.Workspace);
+           app.zephyr.controller('historyController', app.controllers.History);
+           app.zephyr.controller('commandController', app.directives.CommandController);
+           app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
+           app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
+           app.zephyr.directive('command', app.directives.Command.Factory());
+           app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
+       })(app || (app = {}));
+
+
+/***/ },
+/* 18 */
+/***/ function(module, exports) {
+
+       var app;
+       (function (app) {
+           var declares;
+           (function (declares) {
+               var CommandInfo = (function () {
+                   function CommandInfo(name) {
+                       this.name = name;
+                   }
+                   return CommandInfo;
+               })();
+               declares.CommandInfo = CommandInfo;
+           })(declares = app.declares || (app.declares = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var services;
+           (function (services) {
+               var APIEndPoint = (function () {
+                   function APIEndPoint($resource) {
+                       this.$resource = $resource;
+                   }
+                   APIEndPoint.prototype.resource = function (endPoint) {
+                       var customAction = {
+                           method: 'GET',
+                           isArray: false
+                       };
+                       return this.$resource(endPoint, {}, { customAction: customAction });
+                   };
+                   APIEndPoint.prototype.getOptionControlFile = function (command) {
+                       var endPoint = '/api/optionControlFile/' + command;
+                       return this.resource(endPoint).get();
+                   };
+                   APIEndPoint.prototype.getFiles = function (fileId) {
+                       var endPoint = '/api/v1/workspace';
+                       if (fileId) {
+                           endPoint += '/' + fileId;
+                       }
+                       return this.resource(endPoint).get();
+                   };
+                   return APIEndPoint;
+               })();
+               services.APIEndPoint = APIEndPoint;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var services;
+           (function (services) {
+               var MyModal = (function () {
+                   function MyModal($uibModal) {
+                       this.$uibModal = $uibModal;
+                       this.modalOption = {
+                           backdrop: true,
+                           controller: null,
+                           templateUrl: null,
+                           size: null
+                       };
+                   }
+                   MyModal.prototype.open = function (modalName) {
+                       if (modalName === 'SelectCommand') {
+                           this.modalOption.templateUrl = 'templates/select-command.html';
+                           this.modalOption.size = 'lg';
+                       }
+                       return this.$uibModal.open(this.modalOption);
+                   };
+                   return MyModal;
+               })();
+               services.MyModal = MyModal;
+           })(services = app.services || (app.services = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var Command = (function () {
+                   function Command() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.scope = true;
+                       this.controller = 'commandController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           index: '=',
+                           name: '=',
+                           remove: '&',
+                           list: '='
+                       };
+                       this.templateUrl = 'templates/command.html';
+                   }
+                   Command.Factory = function () {
+                       var directive = function () {
+                           return new Command();
+                       };
+                       directive.$inject = [];
+                       return directive;
+                   };
+                   return Command;
+               })();
+               directives.Command = Command;
+               var CommandController = (function () {
+                   function CommandController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       console.log(this.list);
                        this.APIEndPoint
-                           .getFiles('1f83f620-c1ed-11e5-9657-7942989daa04')
+                           .getOptionControlFile('dcdFilePrint')
                            .$promise
                            .then(function (result) {
-                           controller.fileInfo = result.info;
                            console.log(result);
+                           controller.options = result.info;
                        });
+                       this.files = ['a.file', 'b.file', 'c.file'];
+                       this.heading = "[" + this.index + "]: dcdFilePring";
+                       this.isOpen = true;
+                       this.$scope.$on('close', function () {
+                           controller.isOpen = false;
+                       });
+                   }
+                   CommandController.prototype.submit = function () {
+                       var params = {};
+                       angular.forEach(this.options, function (option) {
+                           var inputs = [];
+                           angular.forEach(option.arg, function (arg) {
+                               if (arg.input) {
+                                   inputs.push(arg.input);
+                               }
+                           });
+                           if (inputs.length > 0) {
+                               params[option.option] = inputs;
+                           }
+                       });
+                       console.log(params);
+                   };
+                   CommandController.prototype.removeMySelf = function (index) {
+                       this.remove()(index, this.list);
+                   };
+                   CommandController.$inject = ['APIEndPoint', '$scope'];
+                   return CommandController;
+               })();
+               directives.CommandController = CommandController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var HeaderMenu = (function () {
+                   function HeaderMenu() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.templateUrl = 'templates/header-menu.html';
                    }
+                   HeaderMenu.Factory = function () {
+                       var directive = function () {
+                           return new HeaderMenu();
+                       };
+                       return directive;
+                   };
+                   return HeaderMenu;
+               })();
+               directives.HeaderMenu = HeaderMenu;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var Option = (function () {
+                   function Option() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'optionController';
+                       this.bindToController = {
+                           info: '=',
+                           files: '='
+                       };
+                       this.scope = true;
+                       this.templateUrl = 'templates/option.html';
+                       this.controllerAs = 'ctrl';
+                   }
+                   Option.Factory = function () {
+                       var directive = function () {
+                           return new Option();
+                       };
+                       directive.$inject = [];
+                       return directive;
+                   };
+                   return Option;
+               })();
+               directives.Option = Option;
+               var OptionController = (function () {
+                   function OptionController() {
+                       var controller = this;
+                       angular.forEach(controller.info.arg, function (arg) {
+                           if (arg.initialValue) {
+                               if (arg.formType === 'number') {
+                                   arg.input = parseInt(arg.initialValue);
+                               }
+                               else {
+                                   arg.input = arg.initialValue;
+                               }
+                           }
+                       });
+                   }
+                   OptionController.$inject = [];
+                   return OptionController;
+               })();
+               directives.OptionController = OptionController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var directives;
+           (function (directives) {
+               var Directory = (function () {
+                   function Directory() {
+                       this.restrict = 'E';
+                       this.replace = true;
+                       this.controller = 'directoryController';
+                       this.controllerAs = 'ctrl';
+                       this.bindToController = {
+                           info: '=',
+                           add: '&',
+                           list: '=',
+                           files: '='
+                       };
+                       this.templateUrl = 'templates/directory.html';
+                   }
+                   Directory.Factory = function () {
+                       var directive = function () {
+                           return new Directory();
+                       };
+                       return directive;
+                   };
+                   return Directory;
+               })();
+               directives.Directory = Directory;
+               var DirectoryController = (function () {
+                   function DirectoryController(APIEndPoint, $scope) {
+                       this.APIEndPoint = APIEndPoint;
+                       this.$scope = $scope;
+                       var controller = this;
+                       this.APIEndPoint
+                           .getFiles(this.info.fileId)
+                           .$promise
+                           .then(function (result) {
+                           if (result.status === 'success') {
+                               controller.files = result.info;
+                               angular.forEach(result.info, function (file) {
+                                   if (file.fileType === '0') {
+                                       var o = file;
+                                       if (controller.info.path === '/') {
+                                           o.path = '/' + file.name;
+                                       }
+                                       else {
+                                           o.path = controller.info.path + '/' + file.name;
+                                       }
+                                       controller.add()(o, controller.list);
+                                   }
+                               });
+                           }
+                           ;
+                       });
+                   }
+                   DirectoryController.$inject = ['APIEndPoint', '$scope'];
+                   return DirectoryController;
+               })();
+               directives.DirectoryController = DirectoryController;
+           })(directives = app.directives || (app.directives = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var Execution = (function () {
+                   function Execution(MyModal, $scope) {
+                       this.MyModal = MyModal;
+                       this.$scope = $scope;
+                       this.commandInfoList = [];
+                   }
+                   ;
+                   Execution.prototype.add = function () {
+                       this.$scope.$broadcast('close');
+                       this.commandInfoList.push(new app.declares.CommandInfo('dcdFilePrint'));
+                   };
+                   Execution.prototype.open = function () {
+                       var result = this.MyModal.open('SelectCommand');
+                       console.log(result);
+                   };
+                   Execution.prototype.remove = function (index, list) {
+                       list.splice(index, 1);
+                   };
+                   Execution.prototype.close = function () {
+                       console.log("close");
+                   };
+                   Execution.$inject = ['MyModal', '$scope'];
+                   return Execution;
+               })();
+               controllers.Execution = Execution;
+           })(controllers = app.controllers || (app.controllers = {}));
+       })(app || (app = {}));
+       var app;
+       (function (app) {
+           var controllers;
+           (function (controllers) {
+               var Workspace = (function () {
+                   function Workspace($scope, APIEndPoint) {
+                       this.$scope = $scope;
+                       this.APIEndPoint = APIEndPoint;
+                       this.directoryList = [];
+                       var controller = this;
+                       var directoryList = this.directoryList;
+                       var o = {
+                           fileId: '1f83f620-c1ed-11e5-9657-7942989daa00',
+                           name: '',
+                           parentId: '',
+                           fileType: '',
+                           createdAt: '',
+                           updatedAt: '',
+                           path: '/'
+                       };
+                       directoryList.push(o);
+                   }
+                   Workspace.prototype.addDirectory = function (info, directoryList) {
+                       directoryList.push(info);
+                   };
                    Workspace.$inject = ['$scope', 'APIEndPoint'];
                    return Workspace;
                })();
            app.zephyr.controller('historyController', app.controllers.History);
            app.zephyr.controller('commandController', app.directives.CommandController);
            app.zephyr.controller('optionController', app.directives.OptionController);
+           app.zephyr.controller('directoryController', app.directives.DirectoryController);
            app.zephyr.directive('headerMenu', app.directives.HeaderMenu.Factory());
            app.zephyr.directive('command', app.directives.Command.Factory());
            app.zephyr.directive('option', app.directives.Option.Factory());
+           app.zephyr.directive('directory', app.directives.Directory.Factory());
        })(app || (app = {}));
 
 
index 13ba289..f9beaed 100644 (file)
@@ -1,5 +1,5 @@
 <div>
-<uib-accordion-group heading="{{ctrl.heading}}" is-open="ctrl.isOpen" panel-class="panel-danger">
+    <uib-accordion-group heading="{{ctrl.heading}}" is-open="ctrl.isOpen" panel-class="panel-danger">
         <uib-accordion-heading>
             <h4 class="panel-title">
                 [{{ctrl.index}}: {{ctrl.name}}]
diff --git a/front-end/dist/templates/directory.html b/front-end/dist/templates/directory.html
new file mode 100644 (file)
index 0000000..150e1fd
--- /dev/null
@@ -0,0 +1,23 @@
+<div>
+    <h3 class="page-header">{{ctrl.info.path}}</h3>
+    <table class="table table-striped table-responsive">
+        <tr>
+            <th></th>
+            <th>name</th>
+            <th>fileId</th>
+            <th>parentId</th>
+            <th>fileType</th>
+            <th>createdAt</th>
+            <th>updatedAt</th>
+        </tr>
+        <tr ng-repeat="l in ctrl.files">
+            <td><span class="glyphicon glyphicon-folder-open" ng-show="l.fileType==='0'" aria-hidden="true"></span></td>
+            <td>{{l.name}}</td>
+            <td>{{l.fileId}}</td>
+            <td>{{l.parentId}}</td>
+            <td>{{l.fileType}}</td>
+            <td>{{l.createdAt}}</td>
+            <td>{{l.updatedAt}}</td>
+        </tr>
+    </table>
+</div>
index bbd378c..bf7925a 100644 (file)
@@ -1,3 +1,6 @@
-workspace
-
-{{c.page}}
+<div class="container">
+    <div class="row">
+        <directory index="i" info="info" list="c.directoryList" add="c.addDirectory" ng-repeat="(i, info) in c.directoryList"></directory>
+    </div>
+    <button type="button" class="btn btn-default" ng-click="c.test()">WORKSPACE</button>
+</div>