コード例 #1
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(GUID="", MVID="")
        if form.GUID and form.MVID:
            # Run as Application User
            new_jwt = jwt_tools.build_jwt(str(form.GUID))
            group_delete = False
        else:
            # Run as Account User
            new_jwt = jwt_tools.build_account_jwt()
            group_delete = True

        api_status, group_data, response_msg, api_msg = api_tools_group.group_list(
            new_jwt, group_delete, form.GUID, form.MVID)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_group_list(group_data)

        # Display as needed
        return render.group_list(op_status=api_status,
                                 op_guid=form.GUID,
                                 op_mvid=form.MVID,
                                 op_data=final_output,
                                 op_API=render_tools.render_api_msg(api_msg))
コード例 #2
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(MVID="",
                         p_id="",
                         g_id="",
                         _create="",
                         _read="",
                         _update="",
                         _delete="",
                         _list="")
        account_jwt = jwt_tools.build_account_jwt()
        api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_update(
            account_jwt, form.MVID, form.p_id, form.g_id, form._create,
            form._read, form._update, form._delete, form._list)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            if form.p_id:
                # If a policy ID exists we are editing an existing policy
                final_output = render_tools.render_policy_manage(
                    policy_data, False)
            else:
                # No policy ID, new policy
                final_output = render_tools.render_policy_manage(
                    policy_data, True)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #3
0
    def POST(self):
        form = web.input(GUID="",
                         MVID="",
                         video_id="",
                         videoName="",
                         videoDesc="",
                         videoLocation="",
                         videoOwner="",
                         videoSubject="",
                         videoViewers="",
                         videoGroups="")

        # build JWT
        new_jwt = jwt_tools.build_jwt(str(form.GUID))

        # update video on medvid.io
        api_status, return_data, response_msg, api_msg = api_tools_video.video_update(
            new_jwt, form.video_id, form.videoName, form.videoDesc,
            form.videoLocation, form.videoOwner, form.videoSubject,
            form.videoViewers, form.videoGroups)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_update(return_data)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #4
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		form = web.input(GUID="", MVID="", videoName="", videoDesc="", videoLoc = "", file_id ="", videoLocation="", videoSubject="", videoViewers="", videoGroups="")
		
		# get local file path from UUID
		file_path = ""
		for x in file_list:
			if x[0] == form.file_id:
				file_path = str(x[1])

		# build JWT
		new_jwt = jwt_tools.build_jwt(str(form.GUID))

		# upload to medvid.io
		api_status, return_data, response_msg, api_msg = api_tools_video.video_post(new_jwt, form.MVID, form.videoName, form.videoDesc, form.videoLoc, file_path, form.videoSubject, form.videoViewers, form.videoGroups)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_new(return_data)

		# remove temp file
		os.remove(file_path)

		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #5
0
    def GET(self):
        input_data = web.input(op_mvid="", op_guid="", op_vid="")
        status_msg = "Please specifiy a user and video to update!"

        if input_data.op_mvid and input_data.op_guid and input_data.op_vid:
            # Loaded to edit a specific video
            new_jwt = jwt_tools.build_jwt(str(input_data.op_guid))
            api_status, video_data, response_msg, api_msg = api_tools_video.video_get(
                new_jwt, input_data.op_vid)
            if api_status:
                # Able to load and edit video
                return render.video_update(op_status = True, op_data = None, op_mvid = input_data.op_mvid, op_guid = input_data.op_guid, op_vid = input_data.op_vid, \
                 op_vname = video_data.get('video_title'), op_vdesc = video_data.get('video_desc'), op_vloc = video_data.get('video_location'), \
                 op_vown = video_data.get('video_owner_id'), op_vsub = video_data.get('video_subject_id'), op_vvids = video_data.get('video_user_viewer_ids'), op_vgids = video_data.get('video_group_viewer_ids'), \
                 op_API = render_tools.render_api_msg(api_msg))
            else:
                return render.video_update(
                    op_status=False,
                    op_data=response_msg,
                    op_mvid="",
                    op_guid="",
                    op_vid="",
                    op_vname="",
                    op_vdesc="",
                    op_vloc="",
                    op_vown="",
                    op_vsub="",
                    op_vvids="",
                    op_vgids="",
                    op_API=render_tools.render_api_msg(api_msg))

        return render.video_update(op_status=False,
                                   op_data=status_msg,
                                   op_mvid="",
                                   op_guid="",
                                   op_vid="",
                                   op_vname="",
                                   op_vdesc="",
                                   op_vloc="",
                                   op_vown="",
                                   op_vsub="",
                                   op_vvids="",
                                   op_vgids="",
                                   op_API=None)
コード例 #6
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		form = web.input(file_id="", GUID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, smil_url, response_msg, api_msg = api_tools_video.video_play(new_jwt, form.file_id)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_play(smil_url)

		return render.video_play(op_status=api_status, op_data = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #7
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		form = web.input(policy_id="")
		account_jwt = jwt_tools.build_account_jwt()
		api_status, delete_policy_id, response_msg, api_msg = api_tools_policy.policy_delete(account_jwt, form.policy_id)
		
		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_policy_delete(delete_policy_id)

		return render.status(op_status=api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #8
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		form = web.input(file_id="", GUID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, delete_video_id, response_msg, api_msg = api_tools_video.video_delete(new_jwt, form.file_id)
		
		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_delete(delete_video_id)

		return render.status(op_status=api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #9
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def GET(self):
		# Execute API Call
		account_jwt = jwt_tools.build_account_jwt()
		api_status, user_data, response_msg, api_msg = api_tools_user.user_list(account_jwt)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_user_list(user_data)

		# Display as needed
		return render.user_list(op_status = api_status, op_data = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #10
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		# Gather data; execute API call
		form = web.input(GUID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, app_user_id, user_id, response_msg, api_msg = api_tools_user.user_profile(new_jwt)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_user_new(app_user_id, user_id)

		# Display as needed
		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #11
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		# Gather data; execute API call
		form = web.input(name="")
		account_jwt = jwt_tools.build_account_jwt()
		api_status, new_group_id, new_group_name, response_msg, api_msg = api_tools_group.group_new(account_jwt, form.name)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_group_new(new_group_id, new_group_name)

		# Display as needed
		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #12
0
    def POST(self):
        form = web.input(file_id="", GUID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, smil_url, response_msg, api_msg = api_tools_video.video_play(
            new_jwt, form.file_id)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_play(smil_url)

        return render.video_play(op_status=api_status,
                                 op_data=final_output,
                                 op_API=render_tools.render_api_msg(api_msg))
コード例 #13
0
    def POST(self):
        form = web.input(file_id="", GUID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, delete_video_id, response_msg, api_msg = api_tools_video.video_delete(
            new_jwt, form.file_id)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_delete(delete_video_id)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #14
0
    def POST(self):
        form = web.input(policy_id="")
        account_jwt = jwt_tools.build_account_jwt()
        api_status, delete_policy_id, response_msg, api_msg = api_tools_policy.policy_delete(
            account_jwt, form.policy_id)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_policy_delete(delete_policy_id)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #15
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		form = web.input(GUID="", MVID="", video_id = "", videoName="", videoDesc="", videoLocation="", videoOwner="", videoSubject="", videoViewers="", videoGroups="")

		# build JWT
		new_jwt = jwt_tools.build_jwt(str(form.GUID))

		# update video on medvid.io
		api_status, return_data, response_msg, api_msg = api_tools_video.video_update(new_jwt, form.video_id, form.videoName, form.videoDesc, form.videoLocation, form.videoOwner, form.videoSubject, form.videoViewers, form.videoGroups)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_video_update(return_data)

		return render.status(op_status = api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #16
0
    def GET(self):
        # Execute API Call
        account_jwt = jwt_tools.build_account_jwt()
        api_status, user_data, response_msg, api_msg = api_tools_user.user_list(
            account_jwt)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_user_list(user_data)

        # Display as needed
        return render.user_list(op_status=api_status,
                                op_data=final_output,
                                op_API=render_tools.render_api_msg(api_msg))
コード例 #17
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(GUID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, app_user_id, user_id, response_msg, api_msg = api_tools_user.user_profile(
            new_jwt)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_user_new(app_user_id, user_id)

        # Display as needed
        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #18
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def GET(self):
		input_data = web.input(op_mvid = "", op_guid = "", op_vid = "")
		status_msg = "Please specifiy a user and video to update!"

		if input_data.op_mvid and input_data.op_guid and input_data.op_vid:
			# Loaded to edit a specific video
			new_jwt = jwt_tools.build_jwt(str(input_data.op_guid))
			api_status, video_data, response_msg, api_msg = api_tools_video.video_get(new_jwt, input_data.op_vid)
			if api_status:
				# Able to load and edit video
				return render.video_update(op_status = True, op_data = None, op_mvid = input_data.op_mvid, op_guid = input_data.op_guid, op_vid = input_data.op_vid, \
					op_vname = video_data.get('video_title'), op_vdesc = video_data.get('video_desc'), op_vloc = video_data.get('video_location'), \
					op_vown = video_data.get('video_owner_id'), op_vsub = video_data.get('video_subject_id'), op_vvids = video_data.get('video_user_viewer_ids'), op_vgids = video_data.get('video_group_viewer_ids'), \
					op_API = render_tools.render_api_msg(api_msg))
			else:
				return render.video_update(op_status = False, op_data = response_msg, op_mvid = "", op_guid = "", op_vid = "", op_vname = "", op_vdesc = "", op_vloc = "", op_vown = "", op_vsub = "", op_vvids = "", op_vgids = "", op_API = render_tools.render_api_msg(api_msg))
		
		return render.video_update(op_status = False, op_data = status_msg, op_mvid = "", op_guid = "", op_vid = "", op_vname = "", op_vdesc = "", op_vloc = "", op_vown = "", op_vsub = "", op_vvids = "", op_vgids = "", op_API = None)
コード例 #19
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(GUID="", MVID="")
        new_jwt = jwt_tools.build_jwt(str(form.GUID))
        api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_list(
            new_jwt, form.GUID, form.MVID)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_policy_list(policy_data)

        return render.policy_list(op_status=api_status,
                                  op_guid=form.GUID,
                                  op_mvid=form.MVID,
                                  op_data=final_output,
                                  op_API=render_tools.render_api_msg(api_msg))
コード例 #20
0
    def POST(self):
        # Gather data; execute API call
        form = web.input(name="")
        account_jwt = jwt_tools.build_account_jwt()
        api_status, new_group_id, new_group_name, response_msg, api_msg = api_tools_group.group_new(
            account_jwt, form.name)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_group_new(
                new_group_id, new_group_name)

        # Display as needed
        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #21
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		# Gather data; execute API call
		form = web.input(MVID="", p_id = "", g_id = "", _create = "", _read = "", _update = "", _delete = "", _list = "")
		account_jwt = jwt_tools.build_account_jwt()
		api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_update(account_jwt, form.MVID, form.p_id, form.g_id, form._create, form._read, form._update, form._delete, form._list)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			if form.p_id:
				# If a policy ID exists we are editing an existing policy
				final_output = render_tools.render_policy_manage(policy_data, False)
			else:
				# No policy ID, new policy
				final_output = render_tools.render_policy_manage(policy_data, True)

		return render.status(op_status=api_status, op_message = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #22
0
    def POST(self):
        form = web.input(GUID="",
                         MVID="",
                         videoName="",
                         videoDesc="",
                         videoLoc="",
                         file_id="",
                         videoLocation="",
                         videoSubject="",
                         videoViewers="",
                         videoGroups="")

        # get local file path from UUID
        file_path = ""
        for x in file_list:
            if x[0] == form.file_id:
                file_path = str(x[1])

        # build JWT
        new_jwt = jwt_tools.build_jwt(str(form.GUID))

        # upload to medvid.io
        api_status, return_data, response_msg, api_msg = api_tools_video.video_post(
            new_jwt, form.MVID, form.videoName, form.videoDesc, form.videoLoc,
            file_path, form.videoSubject, form.videoViewers, form.videoGroups)

        # Construct Render Output
        if api_status == False:
            final_output = render_tools.render_error(response_msg)
        else:
            final_output = render_tools.render_video_new(return_data)

        # remove temp file
        os.remove(file_path)

        return render.status(op_status=api_status,
                             op_message=final_output,
                             op_API=render_tools.render_api_msg(api_msg))
コード例 #23
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		# Gather data; execute API call
		form = web.input(GUID="", MVID="")
		if form.GUID and form.MVID:
			# Run as Application User
			new_jwt = jwt_tools.build_jwt(str(form.GUID))
			group_delete = False
		else:
			# Run as Account User
			new_jwt = jwt_tools.build_account_jwt()
			group_delete = True

		api_status, group_data, response_msg, api_msg = api_tools_group.group_list(new_jwt, group_delete, form.GUID, form.MVID)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_group_list(group_data)
		
		# Display as needed
		return render.group_list(op_status = api_status, op_guid = form.GUID, op_mvid = form.MVID, op_data = final_output, op_API = render_tools.render_api_msg(api_msg))
コード例 #24
0
ファイル: app.py プロジェクト: ReelDx/medvidio-webapp-demo
	def POST(self):
		# Gather data; execute API call
		form = web.input(GUID="", MVID="")
		new_jwt = jwt_tools.build_jwt(str(form.GUID))
		api_status, policy_data, response_msg, api_msg = api_tools_policy.policy_list(new_jwt, form.GUID, form.MVID)

		# Construct Render Output
		if api_status == False:
			final_output = render_tools.render_error(response_msg)
		else:
			final_output = render_tools.render_policy_list(policy_data)

		return render.policy_list(op_status = api_status, op_guid = form.GUID, op_mvid = form.MVID, op_data=final_output, op_API = render_tools.render_api_msg(api_msg))