Developing Shared Applications Susanne Lefvert June 10, 2004

29 Slides421.00 KB

Developing Shared Applications Susanne Lefvert June 10, 2004 Access Grid Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Overview Enhance collaboration Several applications included in AGTk – Shared Browser – Shared Presentation Viewer Framework to support plug-in applications Access Grid Retreat 2004

AGTk Environment Security, authorization, and authentication Framework for SOAP messages Invocation of the application code Access Grid Retreat 2004

Shared Application Venue SOAP connection Shared Application Service (Stores state) Event Channel Shared Application Client (Displays state) Shared Application Client (Displays state) Access Grid Retreat 2004 Shared Application Client (Displays state)

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Shared Application Client SOAP connection Venue Shared Application Service Event Channel SharedAppClient Your Application Shared Application Client Access Grid Retreat 2004

SharedAppClient Join() Shutdown() RegisterEventCallback() SendEvent() SetData() GetData() InitLogging() SetParticipantStatus() SetParticipantProfile() GetPublicId() GetVenueUrl() GetApplicationState() GetParticipants() GetComponents() GetDataKeys() GetParticipantStatus() Access Grid Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Example Shared Application: Question and Answer Tool Access Grid Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Ask a question at a seminar. Audience Member View all questions Provide contact info Ask a question Provide answer method Cancel a question Follow up question Change a question Vote Start/end a session View all questions Notify presenter Prioritize questions Moderator Remove question Mark question Archive questions MergeGrid duplicates Access Retreat 2004

Ask a question at a seminar. Audience Member View all questions Provide contact info Ask a question Provide answer method Cancel a question Follow up question Change a question Vote Start/end a session View all questions Notify presenter Prioritize questions Moderator Remove question Mark question Archive questions MergeGrid duplicates Access Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use Cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

User Interface Design Audience View Access Grid Retreat 2004

User Interface Design Moderator View Access Grid Retreat 2004

Design Diagram Model SharedApplication/EventService -observers NotifyObservers() AddObserver() RegisterObserver() UnRegisterObserver() SharedAppClient SharedQuestionTool -sharedAppClient -allQuestions SendQuestion() GetMyQuestions() GetAllQuestions() SendQuestionCb() Join() RegisterEventCallback() SendEvent() GetData() SetData() GetDataKeys() Observer Update() AudienceView ModeratorView -sharedQuestionTool : SharedQuestionTool -sharedQuestionTool : SharedQuestionTool Update() Update() Access Grid Retreat 2004

Design Diagram Model SharedApplication/EventService -observers NotifyObservers() AddObserver() RegisterObserver() UnRegisterObserver() NotifyObservers() SharedQuestionTool -sharedAppClient -allQuestions SendQuestion() GetMyQuestions() GetAllQuestions() SendQuestionCb() SendQuestion(text) SetData(publicId, xmlQuestionList) SendEvent(“SendQuestion”, question) SendQuestionCb(event) Observer GetAllQuestions() Update() GetMyQuestions() AudienceView ModeratorView -sharedQuestionTool : SharedQuestionTool -sharedQuestionTool : SharedQuestionTool Update() Update() Access Grid Retreat 2004 SharedAppClient Join() RegisterEventCallback() SendEvent() GetData() SetData() GetDataKeys()

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

class SharedQuestionTool(Model): SEND QUESTION "SendQuestion" def init ( self, appUrl, debugMode 0, logFile None): Model. init (self) self.allQuestions [] def SendQuestion(self, text): '''Called when an audience member clicks the send button.''' question self. CreateQuestion(text) myQuestions self.GetMyQuestions() myQuestions.append(question) # Create shared application client self.sharedAppClient SharedAppClient("SharedQuestionTool") # Store questions in the venue application service. questions self. ToXML(myQuestions) self.sharedAppClient.SetData(self.publicId, questions) # Get client profile configDir UserConfig.instance().GetConfigDir() clientProfileFile os.path.join(configDir, "profile") self.clientProfile ClientProfile(clientProfileFile) # Send the event. self.sharedAppClient.SendEvent(self.SEND QUESTION, question) return question # Join the application session self.sharedAppClient.Join(appUrl, self.clientProfile) self.publicId self.sharedAppClient.GetPublicId() def SendQuestionCb(self, event): '''Callback invoked when SEND QUESTION events arrive. ''‘ # Store data question event.data self.allQuestions.append(question) # Register event callback self.sharedAppClient.RegisterEventCallback(self.SEND QUESTION, self.SendQuestionCb) # Get all questions currently stored in the application service clients self.sharedAppClient.GetDataKeys() for clientId in clients: list self.sharedAppClient.GetData(clientId) if len(list) 0: qlist self. FromXML(list) for question in qlist: self.allQuestions.append(question) # Notify user interface. self.NotifyObservers() def GetAllQuestions(self, clientId None): '''Returns the entire question list.''' return self.allQuestions def GetMyQuestions(self): '''Returns my question list.''' myQuestions [] for question in self.allQuestions: if question["appId"] self.publicId: myQuestions.append(question) return myQuestions Access Grid Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Application Description Files SharedQuestionTool.app [application] name Shared Question Tool mimetype application/x-ag-question-tool extension sqtool files SharedQuestionTool.py, ObserverPattern.py [commands] Open %(python)s SharedQuestionTool.py -a % (appUrl)s Access Grid Retreat 2004

Access Grid Package Manager (AGPM) Use AGPM to register the application with your user environment. agpm.py –f SharedQuestionTool.app agpm.py –h (for more options) Access Grid Retreat 2004

Start Application Session Access Grid Retreat 2004

Access Grid Package Extension (agpkg) 1. Create a zip package of your files SharedQuestionTool.py ObserverPattern.py SharedQuestionTool.app 2. Rename it with extension agpkg SharedQuestionTool.agpkg 3. Opening SharedQuestionTool.agpkg from Venue Client installs the application Access Grid Retreat 2004

Outline Overview Shared Application Client Example: Question and Answer Tool – – – – Use cases/requirements Design Implementation Packaging and distribution Documentation Access Grid Retreat 2004

Documentation Contributed Software http://www.mcs.anl.gov/fl/research/accessgrid/wiki/moin.cgi/ContributedSoftware Reference Materials http://www.mcs.anl.gov/fl/research/accessgrid/wiki/moin.cgi/DevelopingSharedAp plications Access Grid Retreat 2004

Credits – This work was supported in part by the Mathematical, Information, and Computational Sciences Division subprogram of the Office of Advanced Scientific Computing Research, Office of Science, U.S. Department of Energy, under Contract W-31-109-ENG-38. – This material is based upon work supported in part by the National Science Foundation under Grant No. ANI0222509. – This material is supported in part by Microsoft Research. – This material is supported in part by the National Institute of Health/National Library of Medicine as part of the Advanced Biomedical Collaboratory project. Access Grid Retreat 2004

Back to top button