Пример #1
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);

            //Get endpoints by provider
            foreach (Endpoint e in auth.GetEndpoints(providerId))
            {
                XPress xPress = new XPress(e.href);

                //Staff
                //xPress.CreateXStaffUsers(SCHOOL_REFID);
                //xPress.DeleteXStaffUsers(SCHOOL_REFID);
                //xPress.DeleteXStaffUsernamesPasswords(SCHOOL_REFID);
                //XStaffs_GetXStaffsAccounts(xPress);

                //Student
                //xPress.CreateXStudentUsers(SCHOOL_REFID);
                //xPress.DeleteXStudentUsers(SCHOOL_REFID);
                //xPress.DeleteXStudentUsernamesPasswords(SCHOOL_REFID);
                //XStudents_GetXStudentsAccounts(xPress);

                Console.Read();
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);                                                               //Pass auth url, username, and password to authenticate to auth server

            foreach (Endpoint e in auth.GetEndpoints(providerId))                                                             //For the provided endpoint
            {
                XPress xPress = new XPress(e.href);                                                                           //Pass endpoint info to data API (token, href)

                foreach (XLeaType l in xPress.GetXLeas().Data)                                                                //Iterate through each xLea
                {
                    for (int i = 1; i <= xPress.GetLastPage(ServicePath.GetXRostersByXLea, l.refId, navigationPageSize); i++) //Get max page size for rosters by lea
                    {
                        foreach (XRosterType r in xPress.GetXRostersByXLea(l.refId, i, navigationPageSize).Data)              //Get each roster for each lea refId w/ paging
                        {
                            Console.WriteLine("courseTitle: " + r.courseTitle);
                            foreach (XPersonReferenceType p in r.students.studentReference) //Students for each course
                            {
                                Console.WriteLine("refId: " + p.refId);
                                Console.WriteLine("localId: " + p.localId);
                                Console.WriteLine("givenName: " + p.givenName);
                                Console.WriteLine("familyName: " + p.familyName);
                            }
                        }
                        Console.WriteLine("######## PAGE " + i + " ########");
                    }
                }
            }

            Console.Read();
        }
Пример #3
0
        /* xLeas */
        public static void GetXLeas(XPress xPress)
        {
            List <XLeaType> xLeaTypeList = xPress.GetXLeas(OPAQUE_MARKER).Data;

            foreach (XLeaType o in xLeaTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.leaName + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #4
0
        public static void GetXStudentsByXStaff(XPress xPress)
        {
            List <XStudentType> xStudentTypeList = xPress.GetXStudentsByXStaff(STAFF_REFID, OPAQUE_MARKER).Data;

            foreach (XStudentType o in xStudentTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #5
0
        public static void GetXContactsByXStudent(XPress xPress)
        {
            List <XContactType> xContactTypeList = xPress.GetXContactsByXStudent(STUDENT_REFID, OPAQUE_MARKER).Data;

            foreach (XContactType o in xContactTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #6
0
        public static void GetXRostersByXStudent(XPress xPress)
        {
            List <XRosterType> xRosterTypeList = xPress.GetXRostersByXStudent(STUDENT_REFID, OPAQUE_MARKER).Data;

            foreach (XRosterType o in xRosterTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.courseTitle + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #7
0
        public static void GetXStaffsByXRoster(XPress xPress)
        {
            List <XStaffType> xStaffTypeList = xPress.GetXStaffsByXRoster(ROSTER_REFID, OPAQUE_MARKER).Data;

            foreach (XStaffType o in xStaffTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #8
0
        public static void GetXCoursesByXSchool(XPress xPress)
        {
            List <XCourseType> xCourseTypeList = xPress.GetXCoursesByXSchool(SCHOOL_REFID, OPAQUE_MARKER).Data;

            foreach (XCourseType o in xCourseTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.courseTitle + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #9
0
        public static void GetXCalendarsByXLea(XPress xPress)
        {
            List <XCalendarType> xCalendarTypeList = xPress.GetXCalendarsByXLea(LEA_REFID, OPAQUE_MARKER).Data;

            foreach (XCalendarType o in xCalendarTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.schoolRefId + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #10
0
        public static void GetXSchoolsByXContact(XPress xPress)
        {
            List <XSchoolType> xSchoolTypeList = xPress.GetXSchoolsByXContact(CONTACT_REFID, OPAQUE_MARKER).Data;

            foreach (XSchoolType o in xSchoolTypeList)
            {
                Console.WriteLine(o.refId + " | " + o.schoolName + " | " + o.Metadata.SchoolYear);
            }
        }
Пример #11
0
 public static void XStudents_GetXStudentsAccounts(XPress xPress)
 {
     if (xPress.GetXStudentUsers(SCHOOL_REFID).Data != null)
     {
         foreach (XStudentType s in xPress.GetXStudentUsers(SCHOOL_REFID).Data)
         {
             Console.WriteLine("loginId: " + s.appProvisioningInfo.loginId);
             Console.WriteLine("tempPassword: "******"tempExpiryDate: " + s.appProvisioningInfo.tempPasswordExpiryDate);
         }
     }
 }
Пример #12
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);

            foreach (Endpoint e in auth.GetEndpoints(providerId))
            {
                XPress xPress = new XPress(e.href);

                if (xPress.GetXStudentsByXLea("15077B52-7D2A-4855-B41F-37FBA242522E").Data != null)
                {
                    foreach (XStudentType s in xPress.GetXStudentsByXLea("15077B52-7D2A-4855-B41F-37FBA242522E").Data)
                    {
                        Console.WriteLine("refId: " + s.refId);
                        Console.WriteLine("##### BEGIN ENROLLMENT #####");
                        Console.WriteLine("leaRefId: " + s.enrollment.leaRefId);
                        Console.WriteLine("schoolRefId: " + s.enrollment.schoolRefId);
                        Console.WriteLine("membershipType: " + s.enrollment.membershipType);
                        Console.WriteLine("entryDate: " + s.enrollment.entryDate);
                        Console.WriteLine("##### BEGIN ENTRY TYPE #####");
                        Console.WriteLine("ENTRY TYPE CODE: " + s.enrollment.entryType.code);
                        foreach (XOtherCodeType oct in s.enrollment.entryType.otherCode)
                        {
                            Console.WriteLine("OTHER ENTRY TYPE CODENAME: " + oct.codesetName);
                            Console.WriteLine("OTHER ENTRY TYPE CODE: " + oct.otherCodeValue);
                        }
                        Console.WriteLine("##### END ENTRY TYPE #####");
                        Console.WriteLine("exitDate: " + s.enrollment.exitDate);
                        Console.WriteLine("##### BEGIN EXIT TYPE #####");
                        Console.WriteLine("EXIT TYPE CODE: " + s.enrollment.exitType.code);
                        foreach (XOtherCodeType oct in s.enrollment.exitType.otherCode)
                        {
                            Console.WriteLine("OTHER EXIT TYPE CODENAME: " + oct.codesetName);
                            Console.WriteLine("OTHER EXIT TYPE CODE: " + oct.otherCodeValue);
                        }
                        Console.WriteLine("##### END EXIT TYPE #####");
                        Console.WriteLine("========================================");
                    }
                }
            }

            Console.ReadLine();
        }
Пример #13
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);
            foreach (Endpoint e in auth.GetEndpoints(providerId))
            {
                XPress xPress = new XPress(e.href);

                //XLeaType l = xPress.GetXLea("beds", "738121").getData();
                XLeaType l = xPress.GetXLea("local", "BT101").Data;
                Console.WriteLine(l.refId);
                Console.WriteLine(l.localId);
                Console.WriteLine(l.stateProvinceId);
                Console.WriteLine(l.leaName);
            }


            Console.Read();
        }
Пример #14
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);
            foreach (Endpoint e in auth.GetEndpoints(providerId))
            {
                XPress xPress = new XPress(e.href);

                string json = xPress.GetXLeas().Json;
                string xml  = xPress.GetXLeas(2018).Xml;
                Console.WriteLine(json);
                Console.WriteLine();
                Console.WriteLine(xml);

                //Console.WriteLine(xPress.GetXLea("03ACF04F-DC12-411A-9A42-E8323516D699").Json);
                //Console.WriteLine();
                //Console.WriteLine(xPress.GetXLea("03ACF04F-DC12-411A-9A42-E8323516D699").Xml);
            }
            Console.Read();
        }
Пример #15
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);
            foreach (Endpoint e in auth.GetEndpoints(providerId))
            {
                XPress xPress = new XPress(e.href);

                if (xPress.GetXLea(refId).Data != null)
                {
                    //foreach (XLeaType l in xPress.GetXLeas(refId).Data)
                    //{
                    XLeaType l = xPress.GetXLea(refId).Data;
                    Console.WriteLine("leaRefId: " + l.refId);
                    Console.WriteLine("leaName: " + l.leaName);
                    //}
                }
            }


            Console.Read();
        }
Пример #16
0
        static void Main(string[] args)
        {
            Authenticator auth = Authenticator.Instance;

            auth.Authenticate(authUrl, clientId, clientSecret);

            foreach (Endpoint e in auth.GetEndpoints(providerId))
            {
                XPress xPress = new XPress(e.href);

                /* xLeas */
                //GetXLeas(xPress);
                //GetXLeasByXSchool(xPress);
                //GetXLeasByXRoster(xPress);
                //GetXLeasByXStaff(xPress);
                //GetXLeasByXStudent(xPress);
                //GetXLeasByXContact(xPress);
                /* xSchools */
                //GetXSchools(xPress);
                //GetXSchoolsByXLea(xPress);
                //GetXSchoolsByXCalendar(xPress);
                //GetXSchoolsByXCourse(xPress);
                //GetXSchoolsByXRoster(xPress);
                //GetXSchoolsByXStaff(xPress);
                //GetXSchoolsByXStudent(xPress);
                //GetXSchoolsByXContact(xPress);
                /* xCalendars */
                //GetXCalendars(xPress);
                //GetXCalendarsByXLea(xPress);
                //GetXCalendarsByXSchool(xPress);
                /* xCourses */
                //GetXCourses(xPress);
                //GetXCoursesByXLea(xPress);
                //GetXCoursesByXSchool(xPress);
                //GetXCoursesByXRoster(xPress);
                /* xRosters */
                //GetXRosters(xPress);
                //GetXRostersByXLea(xPress);
                //GetXRostersByXSchool(xPress);
                //GetXRostersByXCourse(xPress);
                //GetXRostersByXStaff(xPress);
                //GetXRostersByXStudent(xPress);
                /* xStaffs */
                //GetXStaffs(xPress);
                //GetXStaffsByXLea(xPress);
                //GetXStaffsByXSchool(xPress);
                //GetXStaffsByXCourse(xPress);
                //GetXStaffsByXRoster(xPress);
                //GetXStaffsByXStudent(xPress);
                /* xStudents */
                //GetXStudents(xPress);
                //GetXStudentsByXLea(xPress);
                //GetXStudentsByXSchool(xPress);
                //GetXStudentsByXRoster(xPress);
                //GetXStudentsByXStaff(xPress);
                //GetXStudentsByXContact(xPress);
                /* xContacts */
                //GetXContacts(xPress);
                //GetXContactsByXLea(xPress);
                //GetXContactsByXSchool(xPress);
                //GetXContactsByXStudent(xPress);
            }

            Console.Read();
        }