Exemplo n.º 1
0
        public static String GetAppPath(long appId)
        {
            ContentApp app = ContentApp.findById(appId);

            if (app == null)
            {
                throw new Exception("app not found: Content.AppId=" + appId);
            }
            return(HtmlLink.ToApp(app));
        }
Exemplo n.º 2
0
        private static String getAppDirName(long appId)
        {
            ContentApp app = ContentApp.findById(appId);

            if (app == null)
            {
                throw new Exception("app not found: Content.AppId=" + appId);
            }
            return(HtmlLink.GetStaticDir(app));
        }
Exemplo n.º 3
0
        private bool isAutoMakeHtml(int appId)
        {
            ContentApp app = ContentApp.findById(appId);

            if (app == null)
            {
                return(false);
            }

            ContentSetting setting = app.GetSettingsObj();

            return(setting.IsAutoHtml == 1);
        }
Exemplo n.º 4
0
        // 初始化当前app
        private ContentApp initApp(MvcContext ctx, IMemberApp mapp)
        {
            IAppContext context = new AppContext();
            int         appId   = mapp.AppOid;

            context.Id = appId;

            ContentApp app = ContentApp.findById(appId);

            context.obj = app;
            context.setAppType(app.GetType());
            ctx.utils.setAppContext(context);
            return(app);
        }
Exemplo n.º 5
0
        //---------------------------------


        /// <summary>
        /// 安装app
        /// </summary>
        /// <returns></returns>
        protected IMemberApp createApp()
        {
            int          installerId = 4;
            AppInstaller installer   = installerService.GetById(installerId);

            IMember owner   = this.owner;
            User    creator = this.user;
            String  name    = appName;

            IMemberApp mapp   = appService.Add(creator, owner, name, installer.Id, AccessStatus.Public);
            String     appUrl = UrlConverter.clearUrl(mapp, ctx, this.owner);

            IMenu menu = menuService.AddMenuByApp(mapp, name, "", appUrl);

            ContentApp newApp = ContentApp.findById(mapp.AppOid);

            this.app = newApp;

            return(mapp);
        }
Exemplo n.º 6
0
        private IMemberApp createApp()
        {
            int          appInfoId = 4;
            AppInstaller info      = appinfoService.GetById(appInfoId);

            IMember owner   = this.user;
            User    creator = this.user;
            String  name    = lang.get("homepage");

            IMemberApp myuserApp = appService.Add(creator, owner, name, info.Id, AccessStatus.Public);
            //String appUrl = UrlConverter.clearUrl( myuserApp, ctx );
            String appUrl = UrlConverter.clearUrl(myuserApp, ctx, owner);

            IMenu menu = menuService.AddMenuByApp(myuserApp, name, "", appUrl);

            menu.Url     = "default";
            menu.OrderId = 99;
            menuService.Update(menu);

            this.app = ContentApp.findById(myuserApp.AppOid);

            return(myuserApp);
        }
Exemplo n.º 7
0
 public static String GetlAppDirName( int appId ) {
     ContentApp app = ContentApp.findById( appId );
     if (app == null) throw new Exception( "app not found: Content.AppId=" + appId );
     return HtmlLink.GetStaticDir( app );
 }
Exemplo n.º 8
0
 private static ContentApp getApp(ContentSection section)
 {
     return(ContentApp.findById(section.AppId));
 }