예제 #1
0
 public ContentModule(ICms nodeTreeCms)
 {
     Get["/"] = Get["/{any}"] = _ =>
     {
         var node = nodeTreeCms.DocumentNodeByUrl(Request.Url.Path);
         return View[node.ViewPath, node];
     };
 }
예제 #2
0
 public AdminModule(ICms nodeTreeCms)
     : base(nodeTreeCms.Settings.AdminUrl)
 {
     Get["/"] = Get["/{root}"] = parameters =>
     {
         return nodeTreeCms.AdminPage(Request.Url.Path).ToString();
     };
     Post["/"] = Post["/{root}"] = parameters =>
     {
         return nodeTreeCms.AdminPage(Request.Url.Path, Request.Form).ToString();
     };
 }
예제 #3
0
 public TreeService(
     ISetupResolver <ICollectionSetup> collectionResolver,
     ISetupResolver <IPageSetup> pageResolver,
     ISetupResolver <IEnumerable <ITreeElementSetup> > treeElementResolver,
     ICms cms,
     IRepositoryResolver repositoryResolver,
     IAuthService authService,
     IParentService parentService)
 {
     _collectionResolver  = collectionResolver;
     _pageResolver        = pageResolver;
     _treeElementResolver = treeElementResolver;
     _cms = cms;
     _repositoryResolver = repositoryResolver;
     _authService        = authService;
     _parentService      = parentService;
 }
예제 #4
0
        internal static ICms Create(byte[] cmsBytes)
        {
            if (cmsBytes == null)
            {
                throw new ArgumentNullException(nameof(cmsBytes));
            }
#if IS_SIGNING_SUPPORTED
            ICms cms = null;
#if IS_DESKTOP
            NativeCms nativeCms = NativeCms.Decode(cmsBytes);
            cms = new NativeCmsWrapper(nativeCms);
#else
            SignedCms signedCms = new SignedCms();
            signedCms.Decode(cmsBytes);
            cms = new ManagedCmsWrapper(signedCms);
#endif
            return(cms);
#else
            throw new NotSupportedException();
#endif
        }
예제 #5
0
 public TreeService(
     ISetupResolver <CollectionSetup> collectionResolver,
     ISetupResolver <PageSetup> pageResolver,
     ISetupResolver <IEnumerable <TreeElementSetup> > treeElementResolver,
     ICms cms,
     IRepositoryResolver repositoryResolver,
     IAuthService authService,
     IParentService parentService,
     IConcurrencyService concurrencyService,
     IHttpContextAccessor httpContextAccessor)
 {
     _collectionResolver  = collectionResolver;
     _pageResolver        = pageResolver;
     _treeElementResolver = treeElementResolver;
     _cms = cms;
     _repositoryResolver  = repositoryResolver;
     _authService         = authService;
     _parentService       = parentService;
     _concurrencyService  = concurrencyService;
     _httpContextAccessor = httpContextAccessor;
 }