Example #1
0
        public ActionResult Detail(string AppName, string AppId, string StreamId, string AmbitoList, string StreamName, string dummy)
        {
            AppToPublishViewModel model = new AppToPublishViewModel();

            model.AppId      = AppId;
            model.AppName    = AppName;
            model.StreamName = StreamName;
            model.StreamID   = StreamId;

            ViewBag.AmbitoList = AmbitoList;

            string path = Server.MapPath("~/cert/client.pfx");

            QRSSenseAppDetail detail = new QRSSenseAppDetail();
            QRSSenseApp       newApp = new QRSSenseApp();

            // Prendo il nodo dei Report Distribuiti
            var ambito = AmbitiUtility.GetAmbitoById(new List <string>()
            {
                GetCookie("AmbitoId")
            }).FirstOrDefault();
            var distrNode = (from f in ambito.Nodes where f.NodeType == "D" select f).FirstOrDefault();
            //

            // Prendo le app pubblicate nel nodo dei Report Distribuiti
            List <SenseApplication> publishedApps;
            QlikAPI qlikAPIMaster = new QlikAPI(AmbitiUtility.GetAmbitoNode(GetCookie("AmbitoId"), distrNode.Id.ToString()).Link, GetCookie("UserID"), GetCookie("UserDirectory"), path);

            qlikAPIMaster.GetPublishedApps(out publishedApps);

            model.OverwriteRequired = false;
            // Controllo se c'è già un'app nello stream che si chiama così
            foreach (var publishedApp in publishedApps)
            {
                if (publishedApp.StreamID == StreamId && publishedApp.Name == AppName)
                {
                    model.OverwriteRequired = true;
                    model.AppToOverwriteId  = publishedApp.AppId;
                }
            }

            return(View("ToShare", model));
        }
Example #2
0
        public ActionResult Detail(string AppName, string AppId, string StreamId, string AmbitoList, string StreamName, string AppOldName, string dummy)
        {
            AppToPublishViewModel model = new AppToPublishViewModel();

            model.AppId      = AppId;
            model.AppName    = AppName;
            model.StreamName = StreamName;
            model.StreamID   = StreamId;
            model.AppOldName = AppOldName;

            ViewBag.AmbitoList = AmbitoList;

            string path = Server.MapPath("~/cert/client.pfx");

            QRSSenseAppDetail detail = new QRSSenseAppDetail();
            QRSSenseApp       newApp = new QRSSenseApp();

            // Prendo la lista delle app pubblicate
            List <SenseApplication> publishedApps;
            QlikAPI qlikAPIMaster = new QlikAPI(AmbitiUtility.GetAmbitoNode(GetCookie("AmbitoId"), GetCookie("NodeId")).Link, GetCookie("UserID"), GetCookie("UserDirectory"), path);

            qlikAPIMaster.GetPublishedApps(out publishedApps);

            model.OverwriteRequired = false;
            // Controllo se c'è già un'app nello stream che si chiama così
            foreach (var publishedApp in publishedApps)
            {
                if (publishedApp.StreamID == StreamId && publishedApp.Name == AppName)
                {
                    model.OverwriteRequired = true;
                    model.AppToOverwriteId  = publishedApp.AppId;
                }
            }

            return(View("ToPublish", model));
        }