Guy Burstein's Blog

All about the newest tools and technologies from Microsoft

News

Guy Burstein
Work:
Microsoft Israel, 2 Hapnina st', Raanana
Israel
Email:
Or, use this form.
Guy Burstein The Bu

Disclaimer
Postings are provided 'As Is' with no warranties and confer no rights.

Guy Burstein LinkedIn Profile

TwitterCounter for @bursteg

The Bu

Links

Articles

Blogs I Read

IIS URL Rewrite Module 2.0 – RTW

IIS URL Rewrite Module 2.0 – RTW

IIS URL Rewrite Module 2.0 The IIS URL Rewrite Module 2.0 – RTW is available for download. IIS URL Rewrite v2.0 is includes all the features from version 1.1, and adds extensibility support and outbound response rewriting. More specifically, v2.0 can be used to:

  • Express complex URL rewriting logic by using custom rewrite providers written in .NET.
  • Replace the URLs generated by a web application in the response HTML with a more user friendly and search engine friendly equivalent
  • Fix up the content of any HTTP response by using regular expression pattern matching.
  • Modify HTTP request and response headers and IIS server variables.

For the complete list of features available in this version, refer to Using URL Rewrite Module 2.0.

Install the URL Rewrite 2.0 – RTW

To install the URL Rewrite 2.0, use the download links at the module’s home page at http://www.iis.net/expand/urlrewrite. Note that this is a final, production ready release that is officially supported by Microsoft.

Install the URL Rewrite Extensibility Samples

An important new feature in this release is the support for custom rewrite providers that can be written in .NET. Custom rewrite providers can be used to implement complex rewrite logic which cannot be expressed by using built-in rewriting functionality.

The URL Rewrite Extensibility Samples include the .NET assemblies and the source code implementing the following providers:

  • DbProvider – this provider can be used to retrieve rewrite mappings from a SQL Server database table by executing a stored procedure;
  • FileMapProvider – this provider can be used to retrieve rewrite mappings stored in a text file;
  • FileContainsProvider – this provider can be used to check if any string in a text file is a substring of the provider’s input string.

Download the URL Rewrite Extensibility Samples from MSDN Code Gallery.

More Information

The following documentation about URL Rewrite 2.0 is available on IIS.net:

Also, visit the URL Rewrite Forum on IIS.NET if you have run into any problems when using the module or have questions or suggestions.

Enjoy!

Windows Server AppFabric Beta 2 is Available

Windows Server AppFabric Beta 2 is Available

Windows Server AppFabric Beta 2

On Monday, March 1st, we announced on the Window Server blog that Windows Server AppFabric Beta 2 is available for download. First publicized at PDC 2009, Windows Server AppFabric is a set of application services focused on improving the speed, scale, and management of Web, Composite, and Enterprise applications.

Note that this Beta is compatible with Visual Studio 2010 RC.

Developers and IT pros can expect the following benefits from Windows Server AppFabric:

· Faster Web Apps Made Easy - Windows Server AppFabric helps developers improve the speed and availability of web applications through distributed in-memory caching and replication technology that works with current ASP.NET applications.

· Simplified Composite Apps - Developers can simplify the development of composite applications with the pre-built application services in Windows Server AppFabric, used in conjunction with Visual Studio tools and .NET Framework capabilities (ASP.NET, WCF and WF).

· Enterprise Performance and Availability - An enterprise's most important and demanding applications can achieve elastic scale, performance, availability, and reliability with the help of Windows Server AppFabric.

Calls to Action

Additional Information & Resources

Enjoy!

TF254043: The readiness checks could not start

TF254043: The readiness checks could not start

Earlier today I tried to install Team Foundation Server 2010 RC on my Windows 7 machine. The installation went fine and easy, but the configuration wizard stopped with the following error:

TF254043: The readiness checks could not start. For more information, see the following log file: C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_DPLY_AT_0226_072157.log”

TF254043: The readiness checks could not start Team Foundation Server TFS Configuration Error

I opened the above log file and found the following error description:

[Error  @07:23:02.680] TF254043: The readiness checks could not start. For more information, see the following log file: C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs\CFG_DPLY_AT_0226_072157.log
[Error  @07:23:02.791]
Exception Message: The trust relationship between this workstation and the primary domain failed.
(type SystemException)

Exception Stack Trace:    at System.Security.Principal.NTAccount.TranslateToSids(IdentityReferenceCollection sourceAccounts, Boolean& someFailed)
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean& someFailed)
   at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess)
   at System.Security.Principal.NTAccount.Translate(Type targetType)
   at Microsoft.TeamFoundation.Common.UserNameUtil.GetMachineAccountName(String hostName)
   at Microsoft.TeamFoundation.Admin.VerifyFactory.CreateApplicationDatabaseNode(IApplicationTier appTier, String targetDatabaseName)
   at Microsoft.TeamFoundation.Admin.VerifyFactory.AppendApplicationTierVerifications(ICollection`1 nodes, IApplicationTier appTier, String targetDatabaseName, Boolean isReportingAlreadyConfigured)
   at Microsoft.TeamFoundation.Management.Controls.WizardCommon.BaseWizardController.AppendApplicationTierVerifications(ICollection`1 nodes)
   at Microsoft.TeamFoundation.Management.Controls.WizardCommon.BaseWizardController.GetVerificationTree()
   at Microsoft.TeamFoundation.Management.Controls.WizardCommon.BaseWizardController.StartVerification()

Solution:

Since my computer is connected to a domain, and while installing TFS I was working from home and not connected to my company’s network via VPN or DirectAccess, there was no connection to the domain controller.

To solve this issue I connected to my company’s network via VPN and ran the configuration wizard again. This time it went fine. If you don’t have a VPN connection, you’ll have to wait until next time you’re in the office.

TF254043: The readiness checks could not start Team Foundation Server TFS Configuration Error

SAVE THE DATE: Developers Academy 4

SAVE THE DATE: Developers Academy 4

Developer Academy 4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PHP בסביבת Windows: חדשות למפתחים

PHP בסביבת Windows: חדשות למפתחים

PHP 5.1.12 שוחררה

PHP בסביבת Windows גירסא 5.1.12 של PHP שוחררה וניתנת להורדה מאתר http://windows.php.net וכמובן דרך ה- Web Platform Installer. בגירסא החדשה מעל ל- 60 תיקוני באגים. פרטים נוספים על הגירסא החדשה ניתן למצוא בהודעה הרשמית על שחרור הגירסא ורשימה מלאה של השינויים ניתן למצוא ב- Change Log.

שוחררה גירסא 1.5 של רכיב FastCGI

צוות הפיתוח של IIS שחרר לאינטרנט גירסא חדשה של FasctCGI Extensions עבור IIS 6.0 ו- IIS 5.1. גירסא זו מבוססת על גירסא 1.0 ומוסיפה מספר חידושים ושיפורים, ביניהם:

  • זיהוי שינויים בקבצי php.ini – ניתן להגדיר את הרכיב להאזין לשינויים בקובץ php.ini וקבצים נוספים ולרענן את ה- Processes שב- Pool בהתאם לשינויים בהגדרות.
  • שינוי הגדרת ה- MaxInstances בזמן אמת – ניתן להגדיר את כמות ה- Processes המקסימלית שתהיה ב- Pool לצורך טיפול בבקשות נכנסות.

פרטים נוספים על הגירסא החדשה ניתן למצוא בהודעה על שחרור הגירסא.

שוחררה גירסא 1.0.1 של WinCache Extension for PHP

צוות הפיתוח של IIS שחרר גירסאת עדכון ל- Windows Cache Extensions for PHP המכילה מספר תיקוני באגים שדווחו על ידי לקוחות. התיקונים, שנבדקו בסביבת Production ע”י GoDaddy.com ו- masterhost.ru שוחררו במסגרת הגירסא.

ניתן למצוא פרטים נוספים על גירסאת העדכון בהודעת שחרור הגירסא, להוריד את העדכון מכאן ואת הקוד מאתר pecl.php.net.

תמיכה ב- Windows Azure נוספה ל- Zend Framework

PHP בסביבת Windowsחברת Zend הכריזה על זמינות גירסא 1.10 של Zend Framework, שבין השיפורים בה, מכילה תמיכה בשירותי הענן של Windows Azure. בעזרת התמיכה הזאת, מפתחים יכולים לפנות בצורה קלה ביותר מתוך אפליקציות PHP לשירותי הענן של Windows Azure לצורך שמירת נתונים, קבצים או לנהל תורים באופן סקלבילי ביותר. פרטים נוספים כאן.

מדריך: יצירת CRUD Application ב- PHP מעל SQL Server בענן

ידעתם שניתן לפתח אפליקציות PHP מעל SQL Server? בעזרת פרוייקט קוד פתוח ניתן לחולל באופן אוטומטי אפליקציה שלמה המבצעת פעולות CRUD (קריאה, כתיבה, עדכון ומחיקה) העובדת מעל SQL Server בארגון או בענן. מדריך מלא כאן.

תהנו!

הכרזה על תוכנית WebsiteSpark בישראל (ווב סייט ספארק)

הכרזה על תוכנית WebsiteSpark בישראל (וובסייט ספארק)

תוכנית WebsiteSpark בישראל ווב סייט ספארק אני שמח להכריז על הפעלת תוכנית WebsiteSpark (וובסייט ספארק) בישראל.

תוכנית וובסייט ספארק בישראל פונה לחברות פיתוח ועיצוב אתרים ולעצמאיים שבונים אפליקציות ואתרים עבור אחרים. היא מאפשרת להם לקבל תוכנות, תמיכה טכנית ומשאבים נוספים ממיקרוסופט למשך שלוש שנים, מאפשרת להם להרחיב את הפעילות העסקית ולבנות פתרונות מדליקים ב- ASP.NET, Silverlight, SharePoint ו- PHP, וכן באפליקציות קוד פתוח שנבנו על גביהם.

מה מספקת תוכנית ווב סייט ספארק?

תוכנית WebsiteSpark בישראל מספקת רישיונות תוכנה שניתן להשתמש בהם במשך שלוש שנים. ברגע שחברה / מפתח עצמאי נרשמים ומאושרים, הם יכולים להוריד ולהשתמש באופן מיידי בתוכנות הבאות של Microsoft:

  • 3 רישיונות של Visual Studio 2008 Professional Edition
  • רישיון של Expression Studio 3 (הכולל Expression Blend, Sketchflow ו- Web)
  • 2 רישיונות של Expression Web 3
  • רישיונות ל- 4 מעבדים של Windows Web Server 2008 R2
  • רישיונות ל- 4 מעבדים של SQL Server 2008 Web Edition
  • פנל שליטה DotNetPanel (המאפשר ניהול אתרים מרחוק)

תוכנית WebsiteSpark בישראל ווב סייט ספארק ניתן להשתמש ברישיונות ל- Windows Server ול- SQL Server הן לפיתוח והן לסביבת Production. ניתן לארח באופן עצמאי את השרתים או להשתמש ברישיונות במסגרת התקשרות עם חברה המספקת שירותי אחסון.

נכון להיום, משתתפות בתוכנית בארץ מספר חברות אחסון אתרים, המאפשרות להשתמש ברישיונות הניתנים בתוכנית כדי לקבל דרכן הצעות זולות מאד עבור שרתים ייעודיים (Dedicated Servers) או שרתים וירטואליים (VPS) לאחסון האתרים.

בשבועות הקרובים יצורפו לתוכנית מספר חברות אחסון נוספות.

בנוסף לתוכנות,  WebsiteSpark בישראל מספקת הזדמנויות לשותפים לצמוח ולבנות את העסק שלהם (כולל הפניות של לקוחות באמצעות תוכניות השותפים שלנו). היא גם כוללת תמיכת מוצרים (כולל שתי קריאות תמיכה טכנית) והכשרה מקוונת חינמית על המוצרים.

מי יכול להצטרף לתוכנית?

תוכנית WebsiteSpark בישראל פונה למפתחי אינטרנט עצמאיים וחברות קטנות לפיתוח ועיצוב אתרי אינטרנט. שתי הדרישות היחידות להצטרפות לתוכנית הן:

  1. החברה שלכם (או אתם במקרה של עצמאיים) בונים אתרים ואפליקציות Web עבור אחרים.
  2. בחברה שלכם יש כעת פחות מ- 10 עובדים.

אם אתם עומדים בדרישות אלה, אתם יכולים לבקר באתר של WebsiteSpark ולהירשם עוד היום.

התחייבויות מסגרת תוכנית WebsiteSpark

תוכנית WebsiteSpark בישראל ווב סייט ספארקההצטרפות לתוכנית היא בעלות 100 דולר, המשולמים בעת היציאה מהתוכנית בתום שלוש שנים.

בנוסף, על כל חברה המצטרפת לתוכנית להעלות לפחות אתר חדש בתוך שישה חודשים מיום הצטרפותה לתוכנית ולדווח על כך בפורטל ההשתתפות. לאחר העלאת האתר על שרת בישראל, (בדר"כ ע"י עבודה עם אחת מחברות אחסון האתרים שציינתי למעלה) העושה שימוש ברישיונות סביבת הייצור הניתנים במסגרת התוכנית, מביא להופעת החברה שפיתחה אותו בגלרייה, ומגבירה את נוכחותה באינטרנט.

מה קורה לאחר שלוש שנים?

ווב סייט ספארק היא תוכנית לשלוש שנים. אין כל התחייבות להמשיך להשתמש בכל תוכנה שהיא לאחר ששלוש השנים מסתיימות, ואין כל עלות עבור שלוש השנים למעט 100 דולר דמי שימוש בתוכנית שיש לשלם בתום שלוש השנים.

בתום שלוש השנים, משתתפי תוכנית WebsiteSpark בישראל יוכלו לבחור לרכוש את כל התוכנות הכלולות ב- WebsiteSpark במחירים אטרקטיבים המיועדים למשתתפי התוכנית בלבד.

סיכום

תוכנית WebsiteSpark מצטרפת לשתי תוכניות "Spark" המוצלחות שהשקנו בעבר – BizSpark עבור סטראטאפים, ו- DreamSpark עבור סטודנטים.

תוכנית WebsiteSpark מגיעה בזמן שבו האקלים הכלכלי עדיין קשה והיא עוזרת למפתחים ולחברות על ידי פיתוח קשרים עסקיים, הכשרה והתוכנות נדרושות כדי להתחיל ולפתח פתרונות מצליחים מעל פלטפורמת ה- Web של מיקרוסופט.

תוכנית WebsiteSpark בישראל ווב סייט ספארק בקרו ב- http://www.microsoft.com/israel/web כדי ללמוד יותר על פלטפורמת ה- Web של מיקרוסופט וכדי להוריד ולהתקין את ה- Web Platform Installer החדש של מיקרוסופט שהושק לאחרונה, שהופך את תהליך ההתקנה וההגדרה של שרתי אינטרנט ועמדות פיתוח לקל ומהיר הרבה יותר. לאחר מכן תוכלו לעיין, להוריד ולהשתמש באפליקציות קוד פתוח מתוך הגלרייה: Windows Web Application Gallery.

בהצלחה!

‫ישראלי זכה בתחרות העולמית לפיתוח אפליקציות ל- Windows 7‬

‫ישראלי זכה בתחרות העולמית לפיתוח אפליקציות ל- Windows 7‬

בנימין בונדי לאחר הזכיה בתחרות העולמית

במהלך כנס המפתחים השנתי של מיקרוסופט, שהתקיים לאחרונה בלוס אנג'לס התקיים הגמר העולמי של התחרות Code7 לפיתוח אפליקציות ל- Windows 7. הזוכה הוא בנימין בונדי, בן 24 מחיפה, ארכיטקט תוכנה בחברת פרס-סנס (Press-Sense) מאור עקיבא. מלבד הזמנה לכנס היוקרתי, זכה בונדי בפרס כספי בסך 17,777$.

הראיון המלא שקיימתי עם בנימין בונדי - באתר ניוזגיק.

תהנו!

מפגש בלוגרים: עיצוב והבלוג והצצה לעוד 100 שנים

מפגש בלוגרים: עיצוב והבלוג והצצה לעוד 100 שנים

מפגש בלוגרים: עיצוב והבלוג והצצה לעוד 100 שניםאנו שמחים להזמינכם למפגש הבלוגרים הרבעוני שלנו ולהרים יחד כוסית לכבוד השנה החדשה.

המפגש ייערך ב- 8 לספטמבר במשרדי מיקרוסופט,
רחוב הפנינה 2 רעננה, קומה 0,
בין השעות 17:00 - 20:00.

מה בתוכנית?

17:00-17:45 מינגלינג וכיבוד
   
17:45-18:45   היכן יעבדו אנשי ה-IT בעוד מאה שנים?
דיון על ארגונים, על המהפכה שתשנה את כל מה שאנחנו יודעים על עבודה, ועל בלוגים ומדיה חברתית.

מרצה: ישראל בלכמן, סמנכ"ל אסטרטגיה ב"בלינק", איש מדיה חברתית וסוציולוג חובב.https://twitter.com/israelblechman
   
18:45-19:15  טאצ’ עליז לבלוגר שיעיז
איך לעצב את הבלוג ע”י שימוש ב- CSS

מרצה: אלעד אברון
http://blogs.microsoft.co.il/blogs/Ambious
http://www.twitter.com/Ambious
   
19:15-19:30 עדכונים

 

להרשמה לחצו כאן

אנא אשרו השתתפותכם מראש! לנרשמים תוסדר חניה במקום ללא תשלום.
המפגש לבלוגרים מקהילת הבלוגרים של blogs.microsoft.co.il

נתראה במפגש!

ניפגש מחר בהרצאה First Look at Visual Studio 2010 IDE

ניפגש מחר בהרצאה First Look at Visual Studio 2010 IDE

מחר בבוקר אעביר הרצאה בנושא החידושים ב- Visual Studio 2010 במסגרת יום עיון למפתחים. אני מאד מתרגש לקראת ההרצאה ובטוח שהיא הולכת להיות מעניינת ומהנה!

כמו בכל הרצאה שלי – יהיו משחקים, תחרויות והפעלות לקהל, ואני מזמין את כל מי שמגיע מחר ויש לו חשבון Twitter, להשתמש בתגית vs2010day# במהלך ההרצאה.

First Look at Visual Studio 2010 IDE גיא בטרשטיין

נתראה מחר!

‫10 טיפים וטריקים לשימוש ב- Internet Explorer 8‬

‫10 טיפים וטריקים לשימוש ב- Internet Explorer 8‬

10 טיפים וטריקים לשימוש ב- Internet Explorer 8 אקספלוררלפני כמה חודשים הושקה הגירסא החדשה של הדפדפן Internet Explorer 8, המכילה חידושים המשפרים את חווית הגלישה והופכים אותה לבטוחה יותר ומהירה יותר.

אתמול פורסם ב- Newsgeek מאמר שכתבתי בנושא ‫10 טיפים וטריקים לשימוש ב- Internet Explorer 8‬, ואתם מוזמנים לקרוא ולהינות!

Israel@PDC09 – המשלחת הישראלית לכנס המפתחים בלוס אנג’לס

Israel@PDC09 – המשלחת הישראלית לכנס המפתחים בלוס אנג’לס

Israel@PDC Israel@PDC08 Israel@PDC09

השבוע נפתחה ההרשמה ל- Professional Developer Conference שיתקיים בלוס אנג’לס בין ה- 17 ל- 19 בנובמבר. למי שלא מכיר, PDC הוא כנס עולמי שמיקרוסופט מקיימת מדי שנה / שנתיים ובו היא חושפת את חזונה הטכנולוגי לשנים הקרובות ומפתיעה בהכרזות מרעישות ביותר. רק לשם קבלת מושג, ב- PDC03 הוצגו הטכנולוגיות Avalon ו- Indigo שבשנת 2006 זכו להיות חלק מ- .Net Framework 3.0 ולהקרא WCF ו- WPF. ב- PDC05 הוצג לראשונה הרעיון של LINQ שיצא עם Visual Studio 2008, ובשנה שעברה נחשפו לראשונה Windows 7 ו- Windows Azure.

רשימה ראשונית של 30 הרצאות לכנס הקרוב פורסמה, ואפשר למצוא שם הרצאות על העתיד של Visual Studio, Silverlight, Sharepoint 2010 וכו’, ומנסיוני, ההפתעות הגדולות נחשפות רק בהרצאות המליאה של הכנס.

כמו בשנה שעברה, גם לקראת הכנס הנוכחי מתארגנת במיקרוסופט ישראל משלחת בשם Israel@PDC, המאגדת את כל הנציגים הישראלים הנוסעים לכנס. המשלחת נועדה לחבר בין הנציגים, לשתף ביניהם חווית מכנסים קודמים ולשתף טיפים כדי להפיק את המקסימום מהכנס. במהלך האירוע מקיימת המשלחת גם סעודה חגיגית ואיך אפשר בלי תמונה.

Israel@PDC

ההרשמה לכנס PDC, ולנרשמים עד ה- 15 בספטמבר ניתנת הנחה של 500$. אם אתם נוסעים לכנס בבקשה צרו איתי קשר, ואם אתם יודעים על מישהו שנוסע לכנס, בבקשה תגידו לו שיצור איתי קשר גם הוא כדי להיות חלק מהמשלחת ולהצטרף לחגיגה!

למי שלא נוסע, תמיד תוכלו להתעדכן בטוויטר על כל מה שאנשים כותבים על PDC09.

כמה פוסטים שגדי כתב על PDC08 ותמיד כיף לקרוא:

תהנו!

Seadragon – לשתף תמונות באיכות גבוהה (או - מי היה יהודה הלוי?)

Seadragon – לשתף תמונות באיכות גבוהה (או - מי היה יהודה הלוי?)

אחת הבעיות באתר שיתוף התמונות היא שהם מציגים תמונות באיכות בינונית בלבד. גם כדי לקצר את משך הזמן שלוקח להוריד תמונה וגם כדי שהתמונה תיכנס בגודל דף באינטרנט ללא צורך בגלילה של הדף.

אבל מה אם אני בכל זאת רוצה לשתף תמונה באיכות גבוהה, שלמשתמשים לא יקח הרבה זמן לצפות בה, שהיא תיכנס בגודל של דף אינטרנט אבל בנוסף תאפשר גם Zoom In לצפייה בפרטים הקטנים?

בדיוק בשביל זה אני אשתמש ב- Seadragon – שירות שיתוף תמונות חדש של מיקרוסופט.

לדוגמא, נניח שיש לי תמונה שכרגע נמצאת ב- Flickr, תמונה שצילמתי בשיטוט האחרון שלי עם המצלמה בתל אביב. כאשר העליתי אותה ל- Flickr, האתר יצר מספר עותקים של התמונה שלי ואחסן אותן בנפרד, ואני יכול לבחור באיזה גודל אני מעוניין לצפות.

Seadragon שיתוף תמונות

אני אבחר את הלינק לתמונה באיכות המירבית, אעתיק אותו ל- Seadragon, ואלחץ על Create.

האתר יעתיק את התמונה וימיר אותה לפורמט Deep Zoom. בסיום, אני אקבל את התמונה שלי באתר ואוכל לבצע Zoom In עמוק כדי לראות את הפרטים הקטנים. למשל – מי היה יהודה הלוי? (רמז: התשובה בתמונה)

ניתן עם לעשות Embed של התמונה בתוך דף אינטרנט, כפי שעשיתי כאן:

שיתוף נעים!

Windows 7: Create .Net Flickr Federated Search Connector

Windows 7: Create .Net Flickr Federated Search Connector

Windows 7 makes searching for content much easier with Federated Search. In this post I’ll talk about how to how to create a Flickr Federated Search Providers in .Net.

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx 

Before We Start

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx This sample uses Flickr API through Flickr.Net. In order to build your own version of this Flickr Federated Search Connector:

Create a new ASP.Net Web Application

Create a new ASP.Net Web Application with Visual Studio.

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdxAdd the Flickr.Net project (called FlickrNet.csproj) to your solution, and add a reference to it from your web application.

Add the Flickr API and Secret Key’s to your web.config in the AppSettings section:

<appSettings>

  <add key="flickr_api_key" value="923422ab4225345dfgdb777daf46"/>

  <add key="flickr_secret" value="aa8b23fsdfhyc3beda"/>

</appSettings>

Create the Flickr Search Provider

The following provider will be executed by the Windows Explorer client using HTTP GET, and will receive several parameters from it:

http://localhost:52903/Search.aspx?q=TechEdIsrael2008&start=1&count=20

It will perform the search against Flickr, and return the response as RSS.

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">

  <channel>

    <title>Flickr Search Results</title>

    <item>

      <title>IMG_0134c</title>

      <link>http://farm4.static.flickr.com/3100/2682983091_7cea404dc4_m.jpg</link>

      <description>show shadow dance techedisrael2008</description>

      <pubDate>Sun, 20 Jul 2008 01:47:25 GMT</pubDate>

      <media:content url="http://farm4.static.flickr.com/3100/2682983091_7cea404dc4_b.jpg"
                     type="image/jpeg" height="333" width="500" />

      <media:thumbnail url="http://farm4.static.flickr.com/3100/2_7cea404dc4_t.jpg" />

    </item>

    <item>

      ...

    </item>

  </channel>

</rss>

Create a new Web Form called Search.aspx.

To make it easier to test the response, right click the web application, and open the Properties window. Go to the Web pane, select Search.aspx as the start page and provide the query parameters:

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx

In the page markup, add a new asp:Repeater control that will define the template for each item in the response:

<asp:Repeater runat="server" ID="itemsRepeater">

</asp:Repeater>

In the page code behind, implement the logic that uses Flickr.Net to search for photos and bind the result to the repeater control:

protected void Page_Load(object sender, EventArgs e)

{

  string flickrApiKey = WebConfigurationManager.AppSettings["flickr_api_key"];

  string flickrSecret = WebConfigurationManager.AppSettings["flickr_secret"];

 

  string searchTerm = Request.QueryString["q"];

  int startPage = int.Parse(Request.QueryString["start"]);

  int count = int.Parse(Request.QueryString["count"]);

 

  Flickr flickr = new Flickr();

  flickr.ApiKey = flickrApiKey;

  flickr.ApiSecret = flickrSecret;

  Photos photos = flickr.PhotosSearch(null, "", 0, searchTerm,
                      DateTime.MinValue, DateTime.MinValue, 0,
                      count, startPage, PhotoSearchExtras.All);

 

  this.itemsRepeater.DataSource = photos.PhotoCollection;

  this.itemsRepeater.DataBind();

}

In the code above I first grab the API and secret key’s from the configuration file and then, I extract the parameters from the query string. I create a new instance of the Flickr object, and perform the actual search for photos, providing the page number and the number of items in each page. Finally, I bind the returned photo collection the the repeater control.

Replace the html header and footer with RSS header and footer in Search.aspx.

Before:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="FlickrFederatedSearch.Search" %>

 

<head runat="server">

  <title></title>

</head>

<body>

  <form id="form1" runat="server">

  <div>

    <asp:Repeater runat="server" ID="itemsRepeater">

    </asp:Repeater>

  </div>

  </form>

</body>

</html>

After:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="FlickrFederatedSearch.Search" %>

 

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">

  <channel>

    <title>Flickr Search Results</title>

    <asp:Repeater runat="server" ID="itemsRepeater">

    </asp:Repeater>

  </channel>

</rss>

Set the ItemTemplate of the Repeater control to display the photos data according to the output format:

<asp:Repeater runat="server" ID="itemsRepeater">

  <ItemTemplate>

    <item>

      <title><%# Eval("Title") %></title>

      <link><%# Eval("SmallUrl")%></link>

      <description><%# Eval("CleanTags")%></description>

      <pubDate>

        <asp:Literal runat="server"

         text='<%# ((FlickrNet.Photo)Container.DataItem).DateTaken.ToString("R") %>' />

      </pubDate>

      <media:content url='<%# Eval("LargeUrl")%>' type="image/jpeg" />

      <media:thumbnail url='<%# Eval("ThumbnailUrl")%>' />

    </item>

  </ItemTemplate>

</asp:Repeater>

Run the application. The browser should navigate to Search.aspx passing all the relevant query parameters. The response should be an RSS feed that contains items per photos found.

Creating the Flickr Federated Search Connector

Add a new Xml file to the project and name it FlickrFederatedSearch.osdx (stands for OpenSearch Description Xml). This file contains the data that Windows Explorer needs to order to perform the search against the search service.

<?xml version="1.0" encoding="utf-8" ?>

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">

  <ShortName>Flickr Federated Search</ShortName>

  <Url type="application/rss+xml"
      
template="http://.../Search.aspx?q={searchTerms}&amp;start={startPage}
&amp;count={count}" />

</OpenSearchDescription>

Notice in the above xml that the parameters are taken from some predefined names ({searchTerms}, {count} etc.), and the ampersands (&) are Html encoded.

Right click the .osdx file, and select Open With.

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx

 
In the Open With dialog, select Windows Explorer.

Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx

In the Add Search Connector dialog, click Add.

image

Now, Flickr Federated Search appears in the Favorites section in Windows 7 Explorer and you can use it for searching items.

 Windows 7 .Net Flickr Federated Search Connector Provider C# .osdx

Summary

In this post I’ve talked about how to create a Flickr Federated Search Connector for Windows 7 in .Net. The above provider provides basic features and can be enhanced with more capabilities described in the Windows 7 Federated Search Provider Implementer’s Guide.

Enjoy!

Windows 7: Register a New File Associations

Windows 7: Register a New File Associations

Windows 7: Register a New File Associations

Windows 7: Register a New File Associations Lets say I have a standard Windows Forms application that works with .guy file types (which is nothing but a text file):

This application can be launched from the command line with a file name as an argument:

> TextFilesViewer.exe SampleFile.guy

In this case, the application displays the file contents in the multiline textbox above:

private void ViewerForm_Load(object sender, EventArgs e)

{

  string[] args = Environment.GetCommandLineArgs();

  if (args.Length > 1)

  {

    string[] lines = File.ReadAllLines(args[1]);

    this.txtFileContents.Lines = lines;

  }

}

Since this application is the only application that knows how to work with .guy files, we would like to associate this file type with my application.

Windows 7: Register a New File Associations

In order to do that, add a reference to the RegistrationHelper sample. This is an exe that performs the actual registration of the file association and needs to be run with admin privileges. It can be found as a sample project in the WindowsAPICodePack\Samples\Shell\TaskbarDemo\CS\RegistrationHelper folderer

After you have added the reference you should add another file from the samples folder - RegistrationHelper.cs which is found in the WindowsAPICodePack\Samples\Shell\TaskbarDemo\CS\TaskbarDemo\ folder.
This file exposes several static methods that invoke the helper as another process with admin privileges.

private void registerFileTypeToolStripMenuItem_Click(object sender, EventArgs e)

{

  string appId = "TextFilesViewer";

 

  RegistrationHelper.RegisterFileAssociations(

    appId,

    false,

    appId,

    string.Format("{0} %1", Assembly.GetExecutingAssembly().Location),

    ".guy");

}

Notice that one of the parameters of RegistrationHelper.RegisterFileAssociations() method is the Application ID which is set to a meaningful name. I’ll talk more on the Application ID in later posts to understand its impact on additional features.

Windows 7: Register a New File AssociationsWhen the user tries to associate the file type, RegistratioinHelper will require admin privileges. If User Account Control (UAC) is enabled on your machine, you will be prompted to allow the registration utility to modify the registry.

After the registration completes, you can double click and .guy files in your machine, and the TextFilesViwer application will be launched to display its content.

Enjoy!

Getting Started with Windows 7 Development Through Windows API Code Pack

Getting Started with Windows 7 Development Through Windows API Code Pack

Windows API Code PackWindows API Code Pack 

Windows 7 is said to be a great operating system, much more secure, faster and productive than its predecessors. As with every version of Windows, it also contains a huge amount of new features exposed for developers as API’s, unfortunately, as unmanaged code. The Windows SDK team is working on a project called Windows API Code Pack which provides managed wrappers for Windows API’s.

Downloading the Windows API Code Pack, you’ll get a Zip file containing both the Windows API Code Pack Source and Samples. In the next few posts I’ll explore the new features of the new OS and provide the managed ways to leverage them from your applications using the above source and samples.

Enjoy!

More Posts Next page »