简体   繁体   English

是否将复杂的AngularJS Web应用程序与CMS集成?

[英]Integrating complex AngularJS web application with CMS?

I've developed a web application using AngularJS that has some significant complexity to it. 我已经使用AngularJS开发了一个Web应用程序,它具有相当大的复杂性。 For example, a user can record a video through the web interface, which triggers a custom server process to analyze the video, which the front end then retrieves from the server and presents in a graph. 例如,用户可以通过Web界面录制视频,这会触发自定义服务器进程来分析视频,然后前端从服务器中检索该视频并以图形显示。

I've set up a video server (wowza) and created an angular directive to wrap the video player which plays RTMP video streams (a requirement is also that videos can only be played from specific IP addresses), as well as directives to wrap the video recorder and a service to interact with the server-side analysis code. 我已经设置了视频服务器(wowza),并创建了一个角度指令来包装播放RTMP视频流的视频播放器(还要求只能从特定IP地址播放视频),以及包装指令。录像机和与服务器端分析代码进行交互的服务。

The client would ideally like the pages and videos to be managed through a CMS. 理想情况下,客户希望通过CMS管理页面和视频。 I have no experience with CMS systems. 我没有CMS系统的经验。 Is this possible and how would I go about this? 这可能吗,我将如何处理?

There are a few CMS systems specifically designed to work with Angular: 有一些专门用于Angular的CMS系统:

Many of the 'traditional' CMS solutions are multi page based as opposed to Angular's 'single page' architecture which can make integration a little tricky. 许多“传统” CMS解决方案都是基于多页的,而不是Angular的“单页”架构,这会使集成变得有些棘手。

Its worth checking whatever approach you select has a believable migration path to Angular 2 also. 值得检查的是,无论您选择哪种方法,都可以向Angular 2迁移。

You can go about this by creating a custom page on your chosen CMS framework that fetches the database for all liked pages and videos and returns them as json or xml object similar to a web service... 您可以通过在所选的CMS框架上创建自定义页面来解决此问题,该页面将为所有喜欢的页面和视频获取数据库,并将它们作为json或xml对象返回,类似于网络服务...

Then on your angularjs code you can create a service that fetches all liked pages and videos from the custom page that you have created using $http request and of course using that custom page's url... 然后在您的angularjs代码上,您可以创建一个服务,该服务从您使用$ http请求创建的自定义页面中获取所有喜欢的页面和视频,当然也要使用该自定义页面的url ...

factory('LikedItemsService', function($http, $q) {
  return {
    getLikedItems: function(loginData) {
      var q = $q.defer();
      $http({ 
        url:"http://mydomain/cms/api/custompage", //just a sample custom page url
        method:"POST",
        headers: {
          'Content-Type': 'application/json'
        }
      }).then(function(resp) {       
          q.resolve(resp.data);
      }, function(err) {
          q.reject(err);
          console.log(err);
          alert('An unexpected error occured. Please try again later.');
      });

      return q.promise;
    }
  }
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM