Beispiel #1
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            OpenAPI client = new OpenAPI();

            string token;
            IList <contentItem> contentList = new List <contentItem>();


            token = client.getTokenID(txtUsername.Text, txtPass.Text, txtServer.Text);

            contentList = client.getContentItems(txtServer.Text, token);

            txtTest.Text += token;

            txtTest.Text += "\n";
        }
Beispiel #2
0
        public void check(string schedule)
        {
            OpenAPI   client = new OpenAPI();
            string    token, username, password, server;
            string    scheduleName, scheeduleframeId;
            schedules currenetSchedule = new schedules();

            username = Settings.Default.username;
            password = Settings.Default.password;
            server   = Settings.Default.server;

            token = client.getTokenID(username, password, server);

            currenetSchedule = client.GetScheduleDetails(server, token, schedule);

            scheduleName     = currenetSchedule.items.data.scheduleName;
            scheeduleframeId = currenetSchedule.items.data.frameId;

            MessageBox.Show(scheduleName + " \n" + scheeduleframeId);
        }
Beispiel #3
0
        public void check(string contentID)
        {
            OpenAPI client = new OpenAPI();
            string  token, username, password, server;

            string        contentName, contentmediaType;
            contentDetail currenetContent = new contentDetail();

            username = Settings.Default.username;
            password = Settings.Default.password;
            server   = Settings.Default.server;

            token = client.getTokenID(username, password, server);

            currenetContent = client.GetContentDetails(server, token, contentID);

            contentName      = currenetContent.items.contentName;
            contentmediaType = currenetContent.items.mediaType;

            MessageBox.Show(contentName + " \n" + contentmediaType);
        }
Beispiel #4
0
        public void getContentsfromCMS()
        {
            OpenAPI client = new OpenAPI();
            string  token, imgPath, username, password, server;
            int     count = 0;

            IList <contentItem> contentList = new List <contentItem>();

            username = Settings.Default.username;
            password = Settings.Default.password;
            server   = Settings.Default.server;

            token = client.getTokenID(username, password, server);

            contentList = client.getContentItems(server, token);

            foreach (var content in contentList)
            {
                imgPath = client.downloadImages(server, content, token, username);
                this.dataGridView1.Rows.Add();

                this.dataGridView1.Rows[count].Height = 109;
                Image img;

                img = Image.FromFile(imgPath);

                this.dataGridView1.Rows[count].Cells[0].Value = img;
                this.dataGridView1.Rows[count].Cells[1].Value = content.contentName;
                this.dataGridView1.Rows[count].Cells[2].Value = content.totalSize;
                this.dataGridView1.Rows[count].Cells[3].Value = content.creatorId;
                this.dataGridView1.Rows[count].Cells[4].Value = content.createDate;
                this.dataGridView1.Rows[count].Cells[5].Value = content.contentId;

                count++;
            }
            setRowNumber(this.dataGridView1);
        }
Beispiel #5
0
        public void publish(string schedule, string content, string init, string finish, string days)
        {
            OpenAPI client = new OpenAPI();
            string  token, username, password, server;

            DateTime inicio, fin;
            string   strInit, strEnd;


            programSchedule         publish = new programSchedule();
            programScheduleItemlist itms = new programScheduleItemlist();

            schedules currenetSchedule = new schedules(); //retrive  information  from current schedule
            string    frameID, thumbnailPath;

            contentDetail currenetContent = new contentDetail();////retrive  information  from content
            string        contentName, mediaType;


            username = Settings.Default.username;
            password = Settings.Default.password;
            server   = Settings.Default.server;


            inicio = Convert.ToDateTime(init);
            fin    = Convert.ToDateTime(finish);

            strInit = inicio.ToString("yyyy-M-d");
            strEnd  = fin.ToString("yyyy-M-d");


            token = client.getTokenID(username, password, server);

            currenetSchedule = client.GetScheduleDetails(server, token, schedule);
            currenetContent  = client.GetContentDetails(server, token, content);

            contentName   = currenetContent.items.contentName;
            mediaType     = currenetContent.items.mediaType;
            thumbnailPath = currenetContent.items.thumbFilePath;

            frameID = currenetSchedule.items.data.channelList[0].frameList[0].frameId;

            if (days == "")
            {
                days = "mon,tue,wed,thu,fri,sat,sun";
            }



            itms.channelNo     = 1;
            itms.cifsSlideTime = "5";
            itms.contentId     = content;
            itms.contentName   = contentName;
            itms.contentType   = mediaType;
            itms.duration      = "86399";
            itms.frameId       = frameID;
            itms.inputSource   = "";
            itms.isSync        = "";
            itms.monthday      = "";
            itms.playerMode    = "single";
            itms.priority      = 1;
            itms.repeatType    = "day_of_week";
            itms.safetyLock    = "";
            itms.scheduleType  = "LFD";
            itms.startDate     = strInit;
            itms.startTime     = "00:00:00";
            itms.stopDate      = strEnd;
            itms.thumbnailPath = thumbnailPath;
            itms.weekdays      = days;

            List <programScheduleItemlist> Itemlist = new List <programScheduleItemlist>();

            Itemlist.Add(itms);

            publish.backgroundMusic   = "";
            publish.contentMute       = "";
            publish.contentSyncOn     = "0";
            publish.deployReserve     = "false";
            publish.description       = null;
            publish.deviceGroupIds    = "50";//TODO
            publish.deviceType        = "SPLAYER";
            publish.itemList          = Itemlist;
            publish.deviceTypeVersion = 4;  //Splayer  SSSP4
            publish.scheduleGroupId   = 14; //TODO
            publish.scheduleName      = "Publicaado desde API";
            publish.vwlType           = "";


            client.putSchedule(server, token, publish, schedule);
        }