Thursday, 09 September 2010

The products listed above, and their associated names, icons and logos, are the intellectual property of Microsoft Corporation.

Messenger Blog Syndicate  
Windows Live Messenger Beta Released!
Inside Windows Live Messenger: -

 

clip_image001 Posted by Aaron

After months and months of hard work (and a lot of fun!) the Windows Live Messenger team is proud to release our latest beta! I’m so excited I dressed up for this post!

If you love Messenger as much as we do, head over to http://download.live.com and grab the new beta. If the beta is not available for your area just yet, keep checking back throughout the day. We always welcome your feedback, so head over to the forums and let us know what you think. If you run into a problem check out the help page. Also head over to Windows Live Wire to see where Windows Live is going.

Over the next few weeks the Messenger bloggers and I will be going through many of the new features in more detail. For today, I’ll give you a brief highlight.

Favorites.

                If you are like me, you have a few IM buddies you chat with a little more frequently than others. People like your family, best friends, or significant other hold a special place in your heart, and now they hold a special place in your favorite IM client.

Groups.

                Messenger has had groups for some time now, but they were nothing like the new Groups! You can create a group of friends that has its own conversation window, among many other benefits. It’s a whole new way to stay in touch with your sports team, community group, or just a bunch of friends.

What’s New Feed.

                Any time your buddies update their Space, add photos, change their display picture or PSM you’ll get a quick notification in the What’s New Feed. It is a great way to keep up to date with your friends.

New Look and Feel.

                This is probably the first new thing you’ll see when you install the beta. A lot has changed in the latest version, from the main window to the conversation window, there are all sorts of visual changes to make Messenger even better.

Personalization.

                Messenger has always had great ways to express yourself, but in the latest version we take it to a whole new level. Dynamic display photos, animated display photos, and hyperlinked personal status message URLs,.. but the most dramatic feature has to be Scenes. Wait until you see it!

Sign in from multiple places at the same time.

                Now you can sign in to Messenger from several locations at once! Keep your home PC logged in and sign in at work, school, or the local internet café for a quick chat with friends without signing off your home PC.

Photo sharing

                Messenger now lets you share photos in your conversation like never before. Two-way, fully synchronous photo sharing is a really sweet way to share photos.  

There are tons more features that I just don’t have time to talk about, so head on over to the http://download.live.com to grab the beta and explore all the new features for yourself. Stay tuned to MessengerSays for detailed posts about all of the features above in the coming weeks!

View article..

Introducing a new MessengerSays blogger and a hint of things to come.
Inside Windows Live Messenger: -

  lonn  Posted by Lonn.

1) Introduction of a new poster.
2) Get ready as we kick this blog into high gear.
3) A hint of things to come.

Hello MessengerSays readers,

I wanted to quickly introduce myself.  My name is Lonn and I work on the Windows Live Messenger product management team.  I work here at Microsoft HQ, in Redmond, WA, but am a proud Canadian that grew up in Toronto eating poutine and watching hockey. J   I’ve been a chat/IM enthusiast since I got my first computer (VIC 20), and still remember the days of chatting with sysops with my 1200 baud modem.  Eventually, I joined the world of IRC, wrote a few of my own chat applications and entered the modern day IM world when I was introduced to ICQ. (Who remembers the unforgettable ‘uh-oh’ message notification sound? J )  Shortly thereafter, I discovered Microsoft’s Messenger application, and have never looked back.

Nearly 10 years later, I am a bonafide Windows Live Messenger ‘fanatic’ (as my team has dubbed me) and will be working closely with Aaron, Dharmesh and the rest of the Windows Live Messenger team to kick this blog into high gear.  We will work hard to not only bring you timely information on what’s new and what’s coming, but also to spend time listening to/reading what all of you have to say.

Messenger has been the source of many fun times (changing the personal status message on my friend’s account or messaging their contacts when they forget to log out ;) ) as well as many fond memories (video/voice/chats with my family/friends while I lived abroad).  However, the fact remains that no matter what you are using Windows Live Messenger for, connecting with people is, at the end of the day, what it’s all about.

With over 300 million active users a month, in over 59 markets, and 36 languages, Windows Live Messenger is more than just another piece of software for most of us, it’s a part of our everyday life and a key tool for how we communicate and stay in sync with our friends and family, no matter where they are in the world.

So… Hello, hallo, bonjour, 你好, Hola, こんにちは, olá! … (I added the translator bot Dharmesh wrote about in the last post, and it works great!)

I am looking forward to meeting all of you soon. 

We have some interesting announcements coming up very soon, so stay tuned. :)

Thanks for reading.

Lonn


View article..

Translating using Windows Live Messenger
Inside Windows Live Messenger: -

 IMG_6508 posted by Dharmesh

Greetings Messenger fans –

One of the benefits of working at a place like Microsoft is that there are all sorts of teams working on cool technology that we get to share with each other.  Messenger just benefited from such a group within Microsoft Research that focuses on translation technologies.  Which is great for a person like me that has friends who speak another language - especially since I often need help remembering translations.

If you want to interact with the new translator agent, just add mtbot@hotmail.com to your contact list and start chatting. You can have one-on-one conversations with the bot where it will respond with the translation.  Or you can invite a friend and each chat in a different language with the bot translating between you. 

image

Today, the bot can translate:

  • English to/from:
    • Arabic
    • Chinese Simplified
    • Chinese Traditional
    • Dutch
    • French
    • German
    • Italian
    • Japanese
    • Korean
    • Portuguese
    • Russian (Russian --> English only)
    • Spanish
  • Chinese Simplified <-> Chinese Traditional

The team will continue to add more languages over the next several months.  So if you're looking for a particular language / translation, definitely let us know.

And for another cool use of the same technology, check this out: http://www.windowslivetranslator.com

View article..

New Windows Live Agents Blog Location
Windows Live Agents -

Greetings,

Windows Live Agents Blog has been moved.

New location is: http://blogs.msdn.com/windowsliveagents/

Thank you,

Windows Live Agents Team.


View article..

PHI Pointers
Windows Live Agents -

To ensure that your agent is launched without a hitch in 5.0 using PHI, we have compiled some pointers that will make the process run more smoothly.

Registering Your Agent in PHI

After you add your agent on PHI, the registration is not completed until you click to apply for hosting. If the project state is still “Initial,” we will not see that you applied for hosting.

Hosting Application

When you apply for hosting on PHI, we ask that you put as much information in the application as possible. Many applications are rejected because they lack information about what the agent is, who the customer is, etc. Please include answers to the following:

- What does this agent do?

- Who is the customer?

- Does it target users under the age of 18?

- Is it promoting a Microsoft product and/or service?

- What is the expected launch date?

- What languages(s) does it speak?

- Is it part of a Microsoft ad buy?

- How and when will it be promoted?

Please also fill out the application in English. If your application is filled out in a language other than English, it will be rejected, as the reviewers are native English speakers.

Connections File

Many file check-ins are getting rejected due to the screen name entry points. When entering the screen names in the connections file, please be sure to do the following:

                - All screen names are unique

                - Template screen names are removed

Please also make sure that you define all datasources that the project uses in the connections file.

.dls File

If your .dls file does not include the following, the project will run on our servers with errors:

<domain-list import="/Shared/SharedSettings.dls">

When you create the project using the template included in Visual Studio, the above line will be in the .dls by default. Do *not* remove it.

Reason for Rejection

If you have uploaded your project files and the status of the project goes back to “Awaiting Initial Project Checkin by Developer,” chances are your project files were rejected for some reason. The WLA team will never reject your project without putting an explanation.  Click on the project name and scroll to the bottom of the page—there will be a section called “Reason for Rejection.”


View article..

PHI Hosting Process
Windows Live Agents -

PHI - Hosting Process

Partner Hosting Infrastructure, or PHI, is a tool that will allow developers to apply for Microsoft to host their Agent projects. Developers will be able to upload their code, manage projects, and be informed of the current state of their projects. This section will go over the tools that developers have available to them when developing a project, taking it live, and making changes to project files.

The following is a quick overview of the PHI process, followed by a detailed explanation of the hosting process.

  • Initial project application – log in to PHI and click on “Apply for New Agent”. Fill in the application form.
  • Apply for Hosting – after your application is filled in, you will be in the “Initial” state. Once you are satisfied with your application, click “Apply for Hosting”. Microsoft will then review your project application. Don’t forget to sign and submit the Hosting Agreement.
  • Project check-in – once your project application has been approved and Microsoft has received your signed Hosting Agreement, you can check in your project. For details on how to do this, see Step 2 below.
  • Hosting – Once the project is checked in, Microsoft will review your project files and get them hosted in the data center. You must provide a screen name for your Agent before being hosted. You will then be able to talk to your Agent online. You can edit your Agent at any time.
  • Going Live – Once you are satisfied with your Agent’s content, click “Submit Project Details for Review”. This will trigger another review by Microsoft, after which your project will go live.

 

A more detailed description:

Step 1: Initial Project Application

 

1.     Let’s assume that you have already created a project called sampleProj and you now want it to be hosted and take it live.

2.     Go to http://phi.agents.live.com

3.     In the top right corner, click on the “Sign In” link and sign in with your WLID.

4.     In the “Agents Home” page, click on “Apply for New Agent”.

5.     Enter “sampleProj” as the Agent Name, and fill out the rest of the form.

6.     Ensure that you complete, sign, and send back the Hosting Agreement (if this is your first Agent) or the Statement of Work (if you have already completed a Hosting Agreement).

7.     Once you have filled out and sent back the appropriate documents, check the “I have signed and sent back the hosting agreement.” checkbox and then click “Save”. You will be taken back to the Agents Home page, and your project should be in the “Initial” state.

 

Step 2: Check in Code for a Project

 

To be able to check in your project code, you must first apply for hosting. To do this:

1.     Click the “Apply for Hosting” link next to your new project.

2.     Click the “Apply for Hosting” button

3.     You should be taken back to the landing page, and the project state should now be “Awaiting Initial Project Hosting Approval by Microsoft”.

At this point, you must wait for the reviewers at Microsoft to go over your application and approve it. You will know that a project has been approved when the state changes from “Awaiting Initial Project Hosting Approval by Microsoft” to “Waiting for Legal Documents from Developers”. The reviewers will need to ensure that they have received legal documents from you. If they have, they will update your project to the “Awaiting Initial Project Checkin by Developer” state.

Once your project is in this state, you can check in your code. To do so:

1.     Open up your project in the Visual Studio IDE.

2.     Go to Tools -> Windows Live Agents Tools ->Code Management -> Sign in to Windows Live

3.     Sign in using the same WLID that you applied for the project with in PHI

4.     Go to Tools -> Windows Live Agents Tools -> Code Management -> Check In Project

5.     Select the project. Make sure it has the SAME NAME as the project you applied for in PHI (in our case, sampleProj). Then click “Check In”.

6.     Note: This initial check in will be version 2. This is expected.

Your project is now checked in!

Step 3: Hosting and Testing Your Project

 

After checking in your code, the state of your project should be “Awaiting Critical File Review by Microsoft”. Microsoft will need to review your critical files (in this stage, the only critical file is the .connections file) before proceeding.

Once your code review is in progress, your project will be in the “Initial Critical Files Under Review by Microsoft” state.

If the files are approved, the state will change to “Pending Hosting in Data Center by Microsoft”. This means that you are waiting for the Operations team to move your files to the data center. Once this is complete, your project will be hosted, and the state will change to “Hosted”. At this point, your files are live in our data center.

From the Hosted state and going forward, files can be modified and checked in at any time. The only file modifications that will require review are checkins of the connections file. You can think of being in the Hosted state as being in a staging environment.

To talk to your agent on Messenger, you will need to add a staging screen name to your project. To do this, click on the “Manage Screen Names” link in the “Actions” column next to your project. Enter a WLID that you would like for your staging screen name. The WLID will be validated before being added to your project.

Step 4: Going Live

 

Once you are satisfied that your project is ready to go live, you need to submit your project for review. To do this:

1.     Click the “Submit Project Details for Review” link in the “Actions” column next to your project.

2.     Click the “Submit Project Details for Review” button.

3.     The project state should now be “Hosted: Awaiting Go-Live Approval from Microsoft”.

Once the Microsoft reviewers have reviewed and are satisfied with your project, they will submit the project files to Ops for deployment in the data center. The state of your project will change to “Hosted: Pending Go-Live in Data Center by Microsoft”.

Once your project has been put in the data center, the project state will be updated to “Live”.

To add your live screen name and talk to your Agent via Messenger, you again use the “Manage Screen Names” link on your PHI landing page. Enter the WLID that you would like your Agent to have. The WLID will be validated before it is added to the project.

 

How to Modify Files

 

You have two options available to you when you would like to modify files in your project.

Using the Console

You can use the KMS Console at https://sampleProj.console.agents.live.com to modify the project. This will allow you to edit topics and responses fairly easily. For more control, however, you would want to use the IDE to make project changes.

Using the IDE

You can use the IDE to check in files in the same way that you checked in the project originally. Please note that using the IDE will check in an entire project, and does not allow you to check in just a single file.

To check out using the IDE, you must first sign in and then acquire the lock by clicking on Tools -> Windows Live Agents Tools -> Code Management -> Check Out Project. You can then edit whichever files you wish. While a project is checked out to you, no one will be able to edit any of the project files using the IDE or KMS.

To check in, click on Tools -> Windows Live Agents Tools -> Code Management -> Check In Project.

 

Checking In the Connections File

When you check in the connections file, it must be reviewed and approved before being hosted or going live in the data center. Check in the connections file as you would check in any other file (see directions above).

Checking in your project when the .connections file has not been modified will not trigger a review. Those changes should propagate immediately.

 

Adding Project Developers/Contributors

 

Besides the project owner, there are two other roles that you may have:

·         Developer – A developer is allowed to check out, modify, and check in a project

·         Consumer – A consumer is allowed to check out a project, but all project files will be read-only. They cannot check in any changes.

To add a developer or consumer to your project, click on the “Manage Developers” link in the “Actions” column next to your project name. Enter a valid Windows Live ID that your developer/consumer will be using to log in, and select the appropriate role.

 

Summary

 

Using PHI will allow you to apply for hosting and track your project online. It also allows you to upload your code using the Visual Studio SDK. The tools that are available in PHI make it much easier for developers to get projects hosted in the Microsoft data center.

 


View article..

Visual Studio hints
Windows Live Agents -
If you are moving from the old Colloquis IDE to the Visual Studio-based Windows Live Agents SDK, and you've never used Visual Studio, you may be a little lost.  This post aims to collect simple hints and tricks for agent developers new to working with Visual Studio.  This is just a start -- if you have any hints, please do comment, and later on we'll post a sequel. 
 
Also, this is by no means much of a guide to Visual Studio as a whole, and is really meant to get you started and oriented for agent-development tasks.  Also, it's not a guide for creating agents.  The first resource for using the new SDK is the Windows Live Agents SDK documentation.  You should start there before doing anything.
 
Agents menus
Here are some common menu locations for agent-development tasks:
 
Edit -> Find and Replace   ... Lots of options for searching through single or multiple files.  Regular expressions work!
View -> Solution Explorer ... This is rougly equivalent to the Explorer feature in the old IDE, and lets you see the project files in a tree view.
View -> Class View          ... Lets you see all the project's domains and packages as a flat list of classes.
View -> Error list             ... Displays compile errors and warnings.
View -> Output                ... Similar to the "Misc Debug" pane of the old IDE, displays compiler messages.
View -> Other Windows -> Conversation Window            ... Where you compile and talk to the agent.
View -> Other Windows -> Comprehension Info Window  ... Displays match scoring information.
Project -> Add DLS Item                ... Add datasources and other DLS items.
Project -> ProjectName Properties  ... Specify compile parameters like buddy id, filter, and command-line options.
Tools -> Windows Live Agents Tools -> Code Management              ... The SDK's interface to the Partner Hosting Infrastructure.
Tools -> Windows Live Agents Tools -> Request License Certificate  ... Get a new license cert.
Tools -> Windows Live Agents Tools -> Management Console          ... Launches the web management console within Visual Studio.
Tools -> Windows Live Agents Tools -> Update connections file        ... Attempts to update the connections file based on the content of your project.
Tools -> Windows Live Agents Tools -> Performance                       ... Various tools for measuring performance.
Tools -> Options ... Set things like tabs and syntax highlighting.
 
Show All Files
By default, the SDK will mount a filesystem in the Solution Explorer, which may affect performance if there are a lot of files, causing the editor to lag.  If this is the case, you can click "Show All Files" to remove the All Files view, and navigate to files through the Class View.  Editing will be a lot faster.  Set Show All Files to false by default at Tools -> Options -> Windows Live Agents SDK -> SDK Settings -> General -> "Show All Files on project open."
 
Keyboard Shorcuts 
As of right now, there isn't a keyboard shortcut for starting/stopping the agent in the Conversation Window.  However, here are some shorcuts you may find useful:
 
CTRL-K CTRL-C ... comment
CTRL-K CTRL-U ... uncomment
CTRL-ALT-L ... Solution Explorer
CTRL-TAB ... toggle through open windows
CTRL-Shift-<arrow key> ... move forward/backward by one word
 
Many other shortcuts are listed next to the menu items they correspond to.
 
Window Arrangement
One of the best things about Visual Studio is the flexibility it provides for laying out your environment.  Any window can be tabbed, docked, or floating, and you can drag everything around the way you like.  Right click a window title, or click the small arrow in the top of the pane, to see your options. 
 

View article..

Definition of Reporting Terms in Usage Reporting in 5.0
Windows Live Agents -

 

When your agent launches, you will be given access to the Knowledge Management Server, which includes a Usage Reporting section. The URL is https://YourProjectName.console.agents.live.com.

 

When you navigate to the Usage Reporting site, you will see date range options in the left pane, and report results in the right pane.  The default date is the present day.  You can switch days by clicking on the calendar on the left.

 

If you click on “Custom Range” on the upper left side of the page, you can view usage reports for a custom date range. Please note that when viewing a Custom Range, the Unique User and New User numbers will be incorrect. There is no way for us to accurately assess these numbers.

 

At the top of the page, you may see the following sections of reporting: Volume Summary, User Demographics, Languages Used, Activity Usage, Compliance, Category Analysis, Topic Analysis, and Clickthroughs. The default reporting view is Volume Summary. The sections of Usage Reporting you see, depends on how you have set up the usage_config.xml your project uses. For more information on customizing the usage_config.xml, click here.

 

Definition of Reporting Terms: 

 

Volume Summary Section

 

Total Queries:             

The total number of queries in all sessions within the specified time period. For example, if the time period includes 100 sessions, there could be 1000 or more total queries.

 

Total Sessions:           

The total number of sessions within the specified time period.

 

Unique Users:             

The number of unique users within the specified time period. Each user is counted once, regardless of how often they interact with the agent. For example, if one person has ten separate sessions with the agent during the specified time period, they are still identified as one unique user.

 

New Users:                  

The number of users whose initial session with the agent occurred during the specified time period.

 

Average Queries Per Session:

Total queries within the specified time period divided by total sessions within the specified time period.

 

Average Sessions Per Unique Users:  

Number of unique users within the specified time period divided by total number of sessions within the specified time period.

 

Category & Topic Analysis Sections

 

Category Analysis is broken out into two sections: Category Distribution Per Query and Category Distribution Per Session. Category Distribution Per Query breaks down how many queries for the chosen date range matched to a category. Category Distribution Per Session breaks down how many times a query matched on a Category during a session.

 

Topic Analysis is only broken out into one section: Topic Distribution (By Query). This measures how many times users’ queries matched to a specific topic for the chosen date range.

 

For information on how to log Category and Topic Analysis in your project, click here.

 

Clickthrough Section

 

The Clickthrough section breaks down how many times a user is presented a link and how many times a user clicks on the link.

 

Total Impressions

Number of times a user is presented a link in their conversation with the bot.

 

Total Clicks

Number of times a user clicks on the link he / she is presented.

 

For information on tracking ClickThroughs in your project, click here.

 

Languages Used Section

 

Agent detects what languages users speak to the agent in.

 

Activity Usage Section

 

Tracks how many users accept or reject an invitation to open the Activity Window.

 

Compliance Section

 

Conversations Stopped

Number of conversations interrupted after detecting user was typing sensitive topics beyond the scope of the agent.

 

Sensitive Sequences Rejected

Number of answers that were blocked by the output filter, displaying an error message to the user.

 

Sensitive Sequences Trusted

Number of answers that would have been blocked by the output filter, but were let through because of the use of the tag <trusted>.

 

Answers Invoking Trust

Number of messages that were displayed with the tag <trusted>…</trusted> in them. It includes both messages that would have passed the output filter or failed it.

 


View article..

Hosting Options for your Agents
Windows Live Agents -

Microsoft offers the ability to host your Agent within our data center if you exceed the capacity of the SDK’s self-hosting ability.  While most developers should easily fit in the self-host option, we understand that having failover for your Agent might be an important need for your clients/business.  Please be aware that when applying through our hosting system, PHI (http://phi.agents.live.com), you will be subject to some small fees, based on your traffic.  If you are working with somebody from MSN or Windows Live, we’ll work together to figure out the right solution for you.  There are virtually no feature differences in the self-host option, although you will be asked to sign Hosting Agreements and ensure that you test your Agent for Policy compliance.


View article..

An advanced look at Web Services and DataSources - Part II
Windows Live Agents -
This is a continuation on An Advanced Look at Web Services and DataSources.  The original entry is located here:   http://windowsliveagents.spaces.live.com/blog/cns!5BCD45E519E07634!711.entry
 

Now let’s take a look at the datasource itself.  The datasource essentially is a function itself, with arguments to pass, and variables to return. In the preprocess section, the POST_DATA variable where the XML SOAP request string was built is put into here.  In addition, the actual web service URL is stated here as well. 

 

In the preprocess section, there are also two built-in variables that can be used, LIMIT and OFFSET.  These two variables are used to ‘page’ results in a cursor.  In the example above, we look at LIMIT to populate a variable called MAXRESULTS. The MAXRESULTS variable is then used in the COUNT element (in this case 10) to bring back 10 results per request.  If the user needs more, then the datasource then starts at the next row and retrieves 10 more results.

 

The simple xml section is a hierarchical representation of the XML response from the SOAP API, to be flattened out into a 2-dimension look when the data is retrieved.  Indentation is used to signify a parent-child relationship. The {loop=content} statement acts as a loop within the XML, iterating through the XML.  The end nodes (highlighted in BOLD) are the fields that is used to capture information and passed back to the calling routine.  Note that fields can be skipped in the simple xml section if the user does not need it.

 

It should be noted here that by using simple xml to represent the XML response, there is no provision for providing a “dynamic” representation of the XML using simple xml.  So in essence, you would have to potentially write a different datasource function for each different search type in this case.  For generate an advanced datasource that could output differently depending on the search type would require outputting a datasource in Buddyscript. We’ll cover this in a different blog.

 

 

datasource LiveSearchAPI(SEARCH, CULTURE_INFO) => Title, Description, Url, Source, NewsYear, NewsMonth, NewsDay, NewsHour, NewsMinute, NewsSecond {expire="in 1 hour" continue_on_error="true" timeout="15" }

  preprocess

    if LIMIT>10 || LIMIT<=0

      MAXRESULTS = 10

    else

      MAXRESULTS = LIMIT

    FIELDLIST = "Title Description Url Source DateTime"

    POST_DATA = BuildSearchAPIPostData(SEARCH, "News", OFFSET, MAXRESULTS, CULTURE_INFO, FIELDLIST)

  http

    http://soap.search.msn.com:80/webservices.asmx

    header

      Accept: application/soap+xml

    postdata {encode=no}

      POST_DATA

  simple xml

    Envelope

      Body

        SearchResponse

          Response

            Responses

              SourceResponse

                Offset => RESULTOFFSET    // Where we're starting from.

                Total => TOTAL     // Total number of results.  

                Results

                  Result {loop=content}

                    Title

                    Description

                    Url

                    Source

                    DateTime

                      Year

                      Month

                      Day

                      Hour

                      Minute

                      Second

  postprocess

    INFO.Offset = RESULTOFFSET

    INFO.MaxCount = TOTAL

    return INFO

 

 

There are other datasource properties that should be considered to either increase performance and or deal with potential errors in accessing/retrieving information from the datasource.  The first one is the Timeout property.  You can specify this time in order to lengthen or shorten the time it takes before the datasource quits accessing the web service.  The default value is 10 seconds.  In our case, we have it at 15 seconds.  The next property is the continue_on_error property.  By changing this property to ‘yes’, execution will still continue and the datasource caller can retrieve the error message in the SYS.Data.Error variable.  This is only on those sources that call the ABErrorProc.  The final property is very important.  It is the Expire property.  This determines how long retrieved data should be valid, i.e. kept in cahsed memory.  The ability to cache retrieved data in memory will improve performance on retrieving information in the datasource.  You should consider these factors:

 

1) how often does the data change?

2) how often will the same retrieved data be asked again?

3) how large is the retrieved data set?

4) server memory cache size (N/A on hosted applications)

5) how fast does the web service perform?

 

All of these are considerations.  In our case, since news items change frequently, we’ll set it for a relatively short time period, say 1 hour. 

 

Examples of the Expire property:

 

Expire=”never” /* this is the default expiration for most non-Buddyscript datasources */

Expire=”in 1 hour”

Expire =”now”  /* no caching at all, same as “never” */

Expire=”tomorrow at 5am” /* Note that this time is the server time, not the client time.  In hosted applications, this is in GMT time */

 

The postprocess section is important for returning a range of information.  For datasources that do not handle the processing of data using offsets and limits (i.e. simple xml), if the postprocess section is missing, the processing QueryServer will process the data coming back from the datasource in its entirety. In cases where the output coming back is one entity or one row, or if the amount of data needed to be processed is small, the postprocess section is not needed.

 

  postprocess

    INFO.Offset = RESULTOFFSET

    INFO.MaxCount = TOTAL

    return INFO

 

Looking at the postprocess section, this section is used to set the offset and total count of rows in a variable.  This variable is then used by Buddyscript to control the display of output.

 

In this case, INFO is the name of an object variable. The names of the variables inside the object is Offset and MaxCount, and these values are populated from the datasource:

 

                Offset => RESULTOFFSET    // Where we're starting from.

                Total => TOTAL     // Total number of results.  

 

 

Finally, here is a crude routine to pass a request to the Live Search API, access the web service and display the contents of the data, using Buddyscript code to control the amount of data coming in.

 

? Tell me some news about STRING=Anything

  LOCALE="en-us"

  TITLE, DESCRIPTION, LINK, SOURCE, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND = LiveSearchAPI(STRING, LOCALE) show 10

    * Here are the results:

    - TITLE, SOURCE

    * <blank/>

      <ifmore>Type "more" for more news.</ifmore>

  else

    - Sorry, no news sites were found for your input.  

 

In the input, you could ask a question such as “Tell me some news about Baron Davis” for example, and get back results that looks like this (notice that the output only contains 2 out of the 10 arguments returned, Title and Source):

 

Here are the results:

 

Baron Davis Going South, San Francisco Gate

The Baron Davis, Gilbert Arenas Switch-a-roo?, San Francisco Gate

Clippers set sights on Baron Davis, Los Angeles Times

Baron Davis on verge of signing with Clippers, Washington Post

NBA: Warriors trying to woo Brand, Newsday

Baron Davis becomes free agent, Chicago Sun-Times

Report: Davis to ditch Warriors for Clippers, FOXSports.com

Logo? Colors? History? Don't mean a thing if you ain't got that team, CBS Sportsline

Davis on verge of joining Clippers, CNN Sports Illustrated

Davis on verge of signing with Clippers, Salon

 

Type “more” for more news.

.

.

.

.

 

 

Notice that in the pattern routine, there is an option called SHOW 10.  This means to output 10 rows at a time.  Buddyscript will go to the output datasource to retrieve the information, which in this case happens to be exactly 10 rows, since the request was to buffer 10 rows per datasource request.  If the user were to type in “more”, another 10 rows will be retrieved from the datasource and 10 more rows will be displayed, and so on.  (Note that there is a Buddyscript variable named SYS.Presentation.Maxlength that also controls the number of characters that can be displayed on an IM client.  Depending on what this is set to, this number will also control the number of rows displayed back.)

 

With the SHOW command, this allows the user a quick and equivalent way of emulating a forward read-only cursor, i.e. displaying x number of rows of output at one time.  The other option would be to put the data into an object and loop through the object, displaying each row, which involved more coding. It’s very possible that for control purposes, the latter method is the right way to go, but for quick coding and display, SHOW is very powerful.

 

Hopefully you have gotten a chance to absorb the intricacies of using datasources by accessing a really powerful web service.  Thanks for your attention!

 

 
 

View article..

PreviousNext
Copyright 2009. Sponsored by nsquared   |  Terms Of Use  |  Privacy Statement
Content on this site is generated from the developer community and shared freely for your enjoyment and benefit. This site is run independently of Microsoft and does not express Microsoft's views in any way.