Example #1
0
        /// <summary>
        /// Returns the location where Templates are stored for the current app
        /// </summary>
        public string AppPathRoot(bool useSharedFileSystem, PathTypes pathType)
        {
            var    wrapLog = Log.Call <string>($"{useSharedFileSystem}, {pathType}");
            string basePath;

            //var useSharedFileSystem = locationId == Settings.TemplateLocations.HostFileSystem;
            switch (pathType)
            {
            case PathTypes.Link:
                basePath = useSharedFileSystem
                        ? _linkPaths.ToAbsolute(Settings.PortalHostDirectory, Settings.AppsRootFolder)
                        : App.Site.AppsRootLink;
                break;

            case PathTypes.PhysRelative:
                basePath = useSharedFileSystem
                        ? _linkPaths.ToAbsolute(Settings.PortalHostDirectory, Settings.AppsRootFolder)
                        : App.Site.AppsRootPhysical;
                break;

            case PathTypes.PhysFull:
                basePath = useSharedFileSystem
                        ? ServerPaths.FullAppPath(Path.Combine(Settings.PortalHostDirectory, Settings.AppsRootFolder))
                        : App.Site.AppsRootPhysicalFull;
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(pathType), pathType, null);
            }

            var finalPath = Path.Combine(basePath, App.Folder);

            return(wrapLog(finalPath, finalPath));
        }
Example #2
0
        public IRenderingHelper Init(IBlock block, ILog parentLog)
        {
            this.LinkLog(parentLog);
            var appRoot = _linkPaths.ToAbsolute("~/");

            Block       = block;
            Context     = block.Context;
            AppRootPath = appRoot;

            return(this);
        }
Example #3
0
 protected override WebResourceDto GetSystem() =>
 new WebResourceDto
 {
     Url = _linkPaths.ToAbsolute("~/")
 };