Pages

Showing posts with label sharing. Show all posts
Showing posts with label sharing. Show all posts

Wednesday, March 11, 2015

Contact Sharing using Google Apps Script

Editors Note: This article is written by Steve Webster and Vinay Thakker who work at Dito. Dito has developed applications such as Dito Directory which is available in the Google Apps Marketplace.

You just created your own contact group in Google Apps Contact Manager and now you want to share this contact group with a few other coworkers (not the entire company). Over the last couple of years, our team at Dito often got this request from our customers. We decided to leverage Google Spreadsheets & Google Apps Script to allow sharing of user’s “personal contact group” with only a select group of coworkers.

How does it work?

The Apps Script implements a three step wizard. Upon completion of the wizard, the script sends the sharing recipients a link to open the spreadsheet to import the user’s recently shared contact group. The three steps in the wizard are.
  • Step 1 lists all the current contact groups in user’s account. The user can select the group he/she wants to share.
  • Step 2 allows user to select the colleagues with whom the user wants to share his/her personal contact group with.
  • Step 3 lets the user submit the sharing request.

Designing using Apps Script Services

Apps Script has various services which can be used to build the user interface, access the user’s contact list and send emails without the need to compile and deploy any code.

1. Security (guide)

Before a script can modify a user’s contacts, it needs to be authorized by that user. The authorization process takes place when a user executes the script for the first time. When a user makes a request to share his/her contacts, our script sends a link to the intended recipients by email. Upon clicking this link and the “Run Shared Contact Groups” button in the spreadsheet, the recipient will first need to grant authorization to execute the script. By clicking the “Run Shared Contacts Groups” button again, the script will proceed with creating the shared contact group.

2. Spreadsheet Service

In developing this script, there was a fair amount of data that needed to be exchanged between different users. We used Apps Script’s Spreadsheet Service for temporarily storing this data.

// grab the group titled "Sales Department"
var group = ContactsApp.getContactGroup("Sales Department");
// from that group, get all of the contacts
var contacts = group.getContacts();
// get the sheet that we want to write to  
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Contact Data");
// iterate through contacts
for (var i in contacts) {
//save each of the values into their own columns
sheet.getRange(i, 1, 1, 1).setValue(contacts[i].getGivenName());
sheet.getRange(i, 2, 1, 1).setValue(contacts[i].getFamilyName());
...
sheet.getRange(i, 13, 1, 1).setValue(contacts[i].getWorkFax());     
sheet.getRange(i, 14, 1, 1).setValue(contacts[i].getPager());       
sheet.getRange(i, 15, 1, 1).setValue(contacts[i].getNotes());       
}

3. Ui Service

Ui Services in Google Apps Scripts have an underlying Google Web Toolkit implementation. Using Ui Services in Apps Script, we easily built the user interface consisting of a 3 step wizard. In designing Ui using Ui Services, we used two main types of Ui elements - Layout Panels and Ui widgets. The layout panels, like FlowPanel, DockPanel, VerticalPanel, etc., allow you to organize the Ui widgets. The Ui widgets (TextBoxes, RadioButtons, etc.) are added to layout panels. Ui Services make it very easy to assemble and display a Ui interface very quickly.



We built each of the components on their own, and then nested them by using the “add” method on the desired container. The UI widgets in the screenshot above were constructed by the code below:

// create app container, chaining methods to set properties inline.
var app = UiApp.createApplication().setWidth(600).setTitle(Share The Group);
// create all of the structural containers
var tabPanel   = app.createTabPanel();
var overviewContent = app.createFlowPanel();
var step1Content = app.createFlowPanel();
var step2Content = app.createFlowPanel();
var step3Content = app.createFlowPanel();
// create u/i widgets
var selectLabel = app.createLabel("Select one of your Contact Groups you want to share with others.");
var contactGroupDropdown = app.createListBox().setName(groupChooser);
// add all children to their parents
overviewContent.add(selectLabel);
overviewContent.add(contactGroupDropdown);
tabPanel.add(overviewContent,"Overview");
tabPanel.add(step1Content,"Step 1");
tabPanel.add(step2Content,"Step 2");
tabPanel.add(step3Content,"Step 3");
app.add(tabPanel);
// tell the spreadsheet to display the app weve created.
SpreadsheetApp.getActiveSpreadsheet().show(app);


Continuing with this pattern, we created a pretty complex design using the UI Services. The next step in building a useful user interface is actually building in event handlers for the UI Widgets. Event Handlers let Apps Script know which function you want to run when your script needs to respond to a given user interaction. The code below is an example of a DropDownHandler that we used in our script in Step 1 of the wizard.

// create a function to execute when the event occurs. the
// callback element is passed in with the event.
function changeEventForDrowdown(el) {
 Browser.msgBox("The dropdown has changed!");
}
// create event handler object, indicating the name of the function to run
var dropdownHandler = app.createServerChangeHandler(changeEventForDrowdown);  
// set the callback element for the handler object.
dropdownHandler.addCallbackElement(tabPanel);
// add the handler to the "on change" event of the dropdown box
contactGroupDropdown.addChangeHandler(dropdownHandler);

4. Contacts Service

When a user of the script chooses to share a specific group, the script saves that group contact data into a spreadsheet. When a sharing recipient clicks on the run button to accept the contacts share request, the script fetches the contact group data from the spreadsheet and uses the Contacts Service to create contacts for the share recipients.

var group = ContactsApp.createContactGroup(myGroupName);
for (var i = 0; i < sheet.getLastRow(); i++) {
 var firstName = sheet.getRange(i, 1, 1, 1).getValue();
 var lastName = sheet.getRange(i, 2, 1, 1).getValue();
 var email = sheet.getRange(i, 3, 1, 1).getValue();
 var myContact = ContactsApp.createContact(firstName, lastName, email);
 // ...
 // set other contact details
 // ...
 myContact.addToGroup(group);
}

As this application shows, Apps Script is very powerful. Apps Script has the ability to create applications which allow you to integrate various Google and non-Google services while building complex user interfaces.

You can find Dito’s Personal Contact Group Sharing Script here. Click here to view the video demonstration of this application. You can also find Dito Directory on the Google Apps Marketplace.


Want to weigh in on this topic? Discuss on Buzz
Read more »

Saturday, February 28, 2015

October 2004 Issue ELC Knowledge Sharing Newsletter

(Originally posted in ELC on the 2nd November, 2004)

Assalamu Alaikum wrt wbt & Greetings to ALL!

Welcome to the October issue of ELC Knowledge Sharing newsletter. This issue contains several excellent articles and research papers found from various online resources during October, including an article written by Dr. Kamal Kishore (previously with UNITAR) on how to Manage virtual teams in a Virtual University (Students? experience). We hope you find the articles we have selected useful, and if there is something youd like to see in an upcoming issue, please let us know.

In this Issue:

  • Managing Virtual Teams in a Virtual University- Students Experiences
  • Categories of eLearning
  • Tips and Tricks for Teaching Online
  • Designing Online Courses to Discourage Dishonesty
  • Centers for Teaching, Learning, and Technology: What Fits Your Institution?
  • Effective Teaching with PowerPoint: A Learning Theory Approach
  • The Need for Universal Design in Online Learning Environments (OLEs)
  • Digital Libraries: The Catalyst to Transform Teacher Education
  • Game-Based Learning (The 21st Century Learning Appoach)
  • Ten Tips for College Success
  • 6 free e-Learning Tools from Univesity of British Columbia
  • A Convergent Participation Model for Evaluation of Learning Objects

1) Managing Virtual Teams in a Virtual University- Students Experiences Author: Dr. Kamal Kishore URL: http://elc.unitar.edu.my/modules.php?name=News&file=article&sid=250
Traffic congestion, parking problems, and rising transportation costs are forcing people to use electronic medium to communicate and stay in touch with each other. Decreasing costs, increasing speed and reliability of IT has enabled people to use this medium. Mergers and acquisitions across borders have emerged as a growing trend. The business is becoming global in scale and perspective. The developments have encompassed every business activity- education being no exception. The advancement of information technology is already transforming the education industry in a large scale worldwide. The opportunities for learning via the electronic environment are virtually limitless. E-learning transcends typical time and space barriers, allowing students to access learning opportunities day and night from various corners of the world?

2) Categories of eLearning Author: George Siemens URL: http://www.elearnspace.org/Articles/elearningcategories.htm
This paper attempts to present the categories, not procedures, of the elearning field. The categories of elearning:
- Courses
- Informal learning
- Blended learning
- Communities
- Knowledge management
- Networked learning
- Work-based learning (EPSS)
These various learning categories do not need to function in isolation?

3) Tips and Tricks for Teaching Online Authors: Kaye Shelton and George Saltsman URL: http://itdl.org/Journal/Oct_04/article04.htm
This paper summarizes some of the best ideas and practices gathered from successful online instructors and recent literature. Suggestions include good online class design, syllabus development, and online class facilitation offering hints for success for both new and experienced online instructors?

4) Designing Online Courses to Discourage Dishonesty Author: Barbara Christe URL: http://www.educause.edu/LibraryDetailPage/666&ID=EQM0348
One of the first questions questions asked of most Web-based educators is, How do you test the student? Following question is, How do you know the student is learning anything?" Barbara Christe presents in this article techniques used at Indiana University-Purdue University Indianaapolis within the Electrical and Computer Engineering Technology Department (offered seven distance education courses 42 times since 1998)...

5) Centers for Teaching, Learning, and Technology: What Fits Your Institution? Author: Kathleen Christoph, Carrie E. Regenstein and Ruth M. Sabean URL: http://www.educause.edu/LibraryDetailPage/666&ID=EDU9963

Centers for teaching, learning, and technology are becoming an important aspect of the emerging strategies for supporting faculty in their IT efforts as well as for the institutional efforts to understand the educational value of IT. Existing models for success include centers for teaching and learning (with or without technology), educational technology centers (often in libraries or IT organizations), and "virtual centers" with distributed collaborating components. What kind of center would work best for your institution considering its needs, its organization, and its culture? Is it a formal organizational unit or a federation of units? Is it physical or virtual? This panel will present the underlying goals, decision points, and strategies and will build a set of guidelines that attendees can use to develop or refine services that fit their campus needs and culture...

6) Effective Teaching with PowerPoint: A Learning Theory Approach Author: David M. Antonacci URL: http://www.educause.edu/LibraryDetailPage/666&ID=SWR0417
This presentation examines teaching and learning from an information-processing perspective, using the events of instruction developed by Robert Gagne. It shows you how to apply these ideas to developing PowerPoint presentations that effectively support instruction. It also presents many example slides highlighting important instructional capabilities of this technology. Gagnes Nine Events of Instruction:

  1. Gaining Attention - Reception. Use abrupt stimulus change.
  2. Informing Learner of the Objective - Expectancy. Tell learners what they will be able to do after learning.
  3. Stimulating Recall of Prior Learning - Retrieval to Working Memory. Ask for recall of previously learned knowledge or skills.
  4. Presenting the Stimulus - Selective Perception. Display the content with distinctive features
  5. Providing Learning Guidance - Semantic Encoding. Suggest a meaningful organization.
  6. Eliciting Performance - Responding. Ask learner to perform.
  7. Providing Feedback - Reinforcement. Give informative feedback.
  8. Assessing Performance - Retrieval and Reinforcement. Require additional learner performance with feedback.
  9. Enhancing Retention and Transfer - Retrieval and Generalization. Provide spaced reviews and varied practice...

7) The Need for Universal Design in Online Learning Environments (OLEs) Author: Roberts, K. URL: http://www.aace.org/pubs/aacej/dispart.cfm?paperID=19
The power of the Web is in its universality. Universal design allows information and communication to be accessed by all users regardless of disability. Websites, educational courseware, and online learning environments (OLEs) are created for those who have good vision and manual dexterity. This eliminates some people, as in the United States alone, 52.6 million people have disabilities. The ability of over 30 million people in the United States is compromised by inaccessible computer design. The Web is a fundamental tool in education. Students who cannot access the Web will be limited in their ability to fully participate and obtain education equivalent to their non-disabled peers. Educational facilities must become aware of the needs and issues of individuals with disabilities so that they can develop a plan for developing accessible Web sites and OLEs. The Internet has the power to provide greater independence and participation for all users, including those with disabilities...

8) Digital Libraries:The Catalyst to Transform Teacher Education Authors: Bolick, C.M., Hicks, D., Lee, J., Molebash, P., & Doolittle, P. URL: http://www.aace.org/pubs/aacej/dispart.cfm?paperID=20
Digital libraries are changing the way academic disciplines within universities are conceptualized. The nation?s scholars are investing their careers and millions of dollars to use technology to rethink the nature of their disciplines. These advances are affecting academic research and instruction as academic disciplines restructure in response to technologies. This article presents a framework for how digital libraries should be used in teacher education...

9) Game-Based Learning (The 21st Century Learning Appoach) Author: Joel Foreman URL: http://www.educause.edu/pub/er/erm04/erm0454.asp
Herein lies a moral about how videogames are influencing higher education. To learn more about videogames in academe, Joel Foreman sought out the insights of five leading-edge thinkers in the field: James Paul Gee, J. C. Herz, Randy Hinrichs, Marc Prensky, and Ben Sawyer. All five had traveled to San Jose, California, in March 2004 for the Serious Games Summit at the annual Game Developers Conference. They discussed the following six topics:

  • The dysfunctions of conventional instruction
  • The power of simulations
  • The importance of game-based learning communities
  • The reasons videogames promise a better learning future
  • The changes necessary for the new paradigm to take hold
  • The practical steps that colleges/universities and influential academics can take to move institutions down the trail blazed by USC and others.
  • He spoke with each of the five individually, culled their comments from several hours of recordings, and then combined the comments to simulate the continuity and interaction of a group discussion. He has also asserted some editorial license to eliminate the infelicities and redundancies of speech...

10) Ten Tips for College Success Author: Kimeiko Hotta Dover URL: http://adulted.about.com/cs/studentprofiles/a/frank_k_2.htm
Returning to school and getting a Ph.D. at the age of 47 wasnt easy for former mechanic and rock musician Frank Koscielski. So, he developed a variety of strategies to maximize the time available for study and writing:

  1. Take a speed reading course.
  2. Never go anywhere without a book.
  3. Keep a tape recorder in the car.
  4. Find a quiet place to study and be a little selfish with your time.
  5. Use post-it notes as bookmarks.
  6. Kill your TV! (e.g. ESPN)
  7. Be an active reader (Take notes).
  8. Find time to rest.
  9. Exercise a bit.
  10. Read all your work aloud to someone else...

11) 6 free e-Learning Tools from University of British Columbia Author: Univesity of British Columbia URL: http://www.learningtools.arts.ubc.ca/
The six (6) e-learning tools listed below are publicly available for academic use, within and outside the Univesity of British Columbia. Periodically Arts IS will release new tools to this site, so it is worth putting this site in your favorites . You are invited to explore these exciting new learning tools, and make free use of the learning objects they generate for educational or research purposes.

  • Timeline Tool - Quickly construct an interactive timeline with audio and visual effects.
  • Discussion Extractor - Export and save WebCT Discussions as portable "learning objects".
  • WYSIWYG Tool - easy access to an online "What You See Is What You Get" web package.
  • Multimedia Learning Object Authoring Tool - A tool that enables content experts to easily create multimedia based learning objects
  • Character Stroke Recorder - A language learning tool designed to help students in learning multi-byte based characters.
  • Vocabulary Memorization Platform - Self learning vocabulary platform to students while learning a new language The actual source code of all tools listed is NOT currently available, but will soon be made available under the Open Source Initiative Foundations GPL license...

12) A Convergent Participation Model for Evaluation of Learning Objects Authors: John Nesbit, Karen Belfer, and John Vargo URL: http://www.cjlt.ca/content/vol28.3/nesbit_etal.html
The properties that distinguish learning objects from other forms of educational software - global accessibility, metadata standards, finer granularity and reusability - have implications for evaluation. This article proposes a convergent participation model for learning object evaluation in which representatives from stakeholder groups (e.g., students, instructors, subject matter experts, instructional designers, and media developers) converge toward more similar des.criptions and ratings through a two-stage process supported by online collaboration tools. The article reviews evaluation models that have been applied to educational software and media, considers models for gathering and meta-evaluating individual user reviews that have recently emerged on the Web, and describes the peer review model adopted for the MERLOT repository. The convergent participation model is assessed in relation to other models and with respect to its support for eight goals of learning object evaluation:

  • Aid for searching and selecting
  • Guidance for use
  • Formative evaluation
  • Influence on design practices
  • Professional development and student learning
  • Community building
  • Social recognition, and
  • Economic exchange.....

Thats All Folks!

Warm Regards & Sincerely,

Zaid Ali Alsagoff

Read more »