Patrick\’s Bytes

15, July 2008

Not blogging today. Busy with my new HTC Touch Diamond

Filed under: HTC Touch Diamond,Windows Mobile — patrickyong @ 11:59 pm

DSC00499

 

DSC00500

Just got my new HTC Touch Diamond phone today so I guess I will be busy configuring it and skip blogging for a day or two.

Moonlight 0.7 ships! Silverlight’s homepage rendered in Linux

Filed under: Mono Moonlight — patrickyong @ 12:00 am

image

There you have it, Novell ships Moonlight 0.7 and now it works perfectly in Firefox ver2.0 and 3.0 as well. If you followed my workaround for Moonlight 0.6 here, you have to disable to script.

Above its a screenshot of Moonlight 0.7 working in Ubuntu 8.04 with Firefox 3.0.

Go here for the download.

9, July 2008

MOSS 2007 BDC Definition Editor gotchas

Filed under: BDC,Sharepoint — patrickyong @ 2:32 pm

What is Business Data Catalog(BDC)?

The BDC is essentially a catalog of business applications that are of interest to SharePoint Server 2007 users, and it bridges the gap between the portal and business applications by bringing in key data from various applications to SharePoint sites, lists, search, and user profiles. The BDC is the key infrastructural component around which most of the other business data features of SharePoint Server 2007 are built. Administrators can register business applications in the BDC, after which the data in the application is immediately available to SharePoint through the business data features described below. A key requirement for each registered business application is an XML-based metadata model that describes the application programming interfaces (API) of the application or the schema of the database that maps to business objects (e.g. customer) and properties (e.g. name) that a SharePoint user can understand. These metadata models can be easily created by DBAs or database developers.

For example you can expose a table in a SQL Server database

image

On to a Business Data List webpart in MOSS 2007.

image

Creating an application definition use to be a pain because you have to define every properties and entities inside a XML file without the help of any tools. Then came BDC Man to over this problem but it comes with a pocket burning price tag. So somewhere early this year, SharePoint SDK update includes a simple BDC Definition Editor. Now you can have (almost) all the features found in BDC Man for free!

Connecting to a database is easy, fire up DBC Def Editor

image Click on Add LOB System

image On the Add LOB System window, you can connect to a DB or Webservice, for this I click on Connect to Database

image Key in the connection string and click Connect

image After that on the right you can see 2 new buttons, I click on Add Table to bring in a table now

image I select the table Currency and drag in over to the blue blank space.

image For this I going to use 1 table only, so I click at the bottom.

image Name it as ‘currency’

image  Now the definition has been created. Logically I can click Export and upload it to MOSS. The exported Application Definition is a XML file shown below

  <?xml version="1.0" encoding="utf-8" standalone="yes"?> <lobsystem xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemalocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd" 
	type="Database" version="1.0.0.0" name="currency"> 	<lobsysteminstances> 		<lobsysteminstance name="currency_Instance"> 			<properties> 				<property type="System.String" name="rdbconnection Data Source">localhost</property> 				<property type="System.String" name="rdbconnection Initial Catalog">simpledb</property>  				<property type="System.String" name="rdbconnection Integrated Security">True</property>  				<property type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider" name="DatabaseAccessProvider">SqlServer</property>  				<property type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAuthenticationMode" name="AuthenticationMode">PassThrough</property>  			</properties> 			</lobsysteminstance></lobsysteminstances> 			<entities> 				<entity name="Currency" estimatedinstancecount="10000"> 					<identifiers><identifier name="name" typename="System.String" /></identifiers> 					<methods><method name="Find_Currency"> 					<properties> 						<property type="System.Data.CommandType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="RdbCommandType">Text</property>  						<property type="System.String" name="RdbCommandText">Select "Name","Description" from Currency where Name=@Name</property>  					</properties> 					<parameters> 						<parameter name="@Name" direction="In"> 							<typedescriptor name="name" typename="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" identifiername="Name" /> 						</parameter> 						<parameter name="@Currency" direction="Return"> 							<typedescriptor name="Reader" typename="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" iscollection="true"> 							<typedescriptors> 								<typedescriptor name="Record" typename="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 									<typedescriptors> 							 										<typedescriptor name="name" typename="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" identifiername="Name" /> 											<typedescriptor name="Description" typename="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />																		</typedescriptors> 										</typedescriptor> 									</typedescriptors> 								</typedescriptor> 							</parameter> 						</parameters> 						<methodinstances> 							<methodinstance type="SpecificFinder" name="Find_Currency_Instance" returnparametername="@Currency" returntypedescriptorname="Reader" returntypedescriptorlevel="0" /> 						</methodinstances> 					</method> 					<method name="FindAll_Currency"> 					<properties> 						<property type="System.Data.CommandType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="RdbCommandType">Text</property>  						<property type="System.String" name="RdbCommandText">Select "Name" from Currency</property>  					</properties> 					<parameters> 						<parameter name="@Currency" direction="Return"> 							<typedescriptor name="Reader" typename="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" iscollection="true"> 								<typedescriptors> 									<typedescriptor name="Record" typename="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> 										<typedescriptors> 											<typedescriptor name="name" typename="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" identifiername="Name" /> 										</typedescriptors> 									</typedescriptor> 								</typedescriptors> 							</typedescriptor> 						</parameter> 					</parameters> 					<methodinstances> 						<methodinstance type="IdEnumerator" name="FindAll_Currency_Instance" returnparametername="@Currency" returntypedescriptorname="Reader" returntypedescriptorlevel="0" /> 					</methodinstances> 				</method> 			</methods> 		</entity> 	</entities> </lobsystem>  

Imagine you have to do this manually even for a single database table!!

 image

So now go to your Shared Service Admin site to upload the def file.  Click on Import application definition

image Choose the file and click Import on the next screen.

image  There you go, no problem reported.

image

So now with the app def imported I go back to my SharePoint site to add the Business Data list webpart.

image

To bind my Currency table to the part, I open up the webpart editor. At the Type textbox click on the telephone book icon.

image

To my surprise, when I open up the Business Data Type Picker, it reported There are no Business Data Type loaded in the Catalog! So what went wrong? The Currency Add Def indeed imported.

Actually the def editor left out a couple of things which need the user to manually configure which I found out later.

image

First one, the Business Data List webpart uses a Finder method instance of the app def to list the data. The def editor by default only create the SpecificFinder and the IdEnumerator method instances.

image

To verify this, open up your Event Viewer and you will see errors in Application log.

To create another method instance, right click on Methods and click Add Method

Change the name of the new method to List

image

On RdbCommandText, copy the one from the SpecificFinder but remove the where clause

Then add a new Return parameter. Right click on Parameter and choose Add Parameter.

Change the name to @Currency

image

Now right click @Currency and select Create Root TypeDescriptor

image

Cut the story short, you now continue to construct the parameter as per the one on Find_Currency method. Only thing is you do not need to create the input parameter @Name.

image

Right click Instances and choose Add Method Instance, select the radio button ‘Finder’ on the Create Method Instance window. The Return TypeDescriptor should be Reader.

image

After that go over to Currency Entity, fill in the name of the Title field. The purpose of the Title field is to tell MOSS later which column to display the action menu.

Having mentioned action menu, I won’t be created any Action for this entity but instead use the default ‘View Profile’ action menu.

image

Now update the version number to 1.1 else BDC will complain version conflict. After that export the definition to xml file and import it to MOSS.

image

Double confirm the version number is 1.1 now.

image

Then go back to my SharePoint site, funny thing is now you need to remove the blank web part and insert a new Business Data List webpart. Then open the webpart editor and you will see your Currency table there.

 

image

Add that to the editor and exit the edit mode. You can now see the Currency table listed here.

8, July 2008

Another futuristic video by Microsoft

Filed under: Misc — patrickyong @ 9:57 pm

Quite some time ago we saw this video about the future and how people do their banking.

[YouTube=http://www.youtube.com/watch?v=CNBJYH2jhko]
YouTube – Microsoft’s future vision on banking

The technologies showcased that time was a bit ‘old’ you still see the old Windows Mobile devices with stylus (its so yesterday huh). So fast forward a bit, Microsoft industry innovation group comes out with this video about how technologies help us with our health in the future. Some currently hot technologies like multi touch (it will be found on any devices, any furnitures including a smart card which will be your digital wallet) and WPF driven user experiences (developers can really get a lot of inspirations of how application UI should look like here). Check it out here.

[YouTube=http://www.youtube.com/watch?v=V35Kv6-ZNGA]
YouTube – Microsoft Future Vision : Healthcare

IE7 Pro First Impression

Filed under: IE7 Pro — patrickyong @ 12:00 am

image

What? Internet Explorer also got Pro edition? How much must I pay?

Actualy IE7 Pro is a free addon for Internet Explorer 7 which comes with tones of features to make Internet Explorer rocks again. Upon install you will see a IE7 Pro icon on the lower right of your IE window.

image

Right click on it will brings up a host of stuff you can do

image

My Favourite features would be the ability to auto refresh a website as shown below, so those websites which are not AJAX enabled I can set it to auto pull information from the web server.

image

I have long yearn for a light weight Download Manager just like Firefox and now I got it in IE7Pro!

image

Open up preferences and its like a pandora box with features like FasterIE webpage prefetch mechanism and more plugins like Alexa/ Google Page ranks

image

 

So don’t wait, go download it here http://www.ie7pro.com/

6, July 2008

Don’t play play, XBox 360 price drop

Filed under: xbox,XNA — patrickyong @ 12:07 am

pricedropSG_header

MS just reduced its price on XBox 360 in Singapore to SGD499. But no news yet XBox will be officially sold in Malaysia. So go across the crossway to get one!

pricedropSG_xbox360_pack

More reasons to buy a test unit for your XNA development. They got tonnes of starter kit like 3D car racing and RPG game to used as sample to build the next Electronic Arts.

     

4, July 2008

Composite WPF Guidance aka Prism ships!

Filed under: Composite WPF,Prism,WPF — patrickyong @ 2:38 am

 

The Composite Application Guidance for WPF is designed to help you more easily build enterprise-level Windows Presentation Foundation (WPF) client applications. This guidance will help you design and build flexible composite WPF client applications – applications that use loosely coupled, independently evolvable pieces that work together within the overall application.

RIScreenShots_small

Check it out!

Download

Getting Started

Prism Homepage at Codeplex

2, July 2008

Office Tips: Line Breaks Without Bullets

Filed under: Office,Word — patrickyong @ 11:37 am

Tested on Word 2007

When you’re creating a bulleted or numbered list in Microsoft Office Word or Microsoft Office PowerPoint, you might want an item to appear in the list without a bullet or without incrementing the number. You can start a new line without a bullet by pressing SHIFT+ENTER. The next time you press the ENTER key, the new line will continue the bulleted or numbered list.

Passing large files over WCF channel

Filed under: WCF — patrickyong @ 10:32 am

If you want to pass large binary files via a WCF channel, you need to increase the maxStringContentLength on your WCF host app.config/web.config file. From my sample on my IssueTracker project, I added a new bindings element to the system.serviceModel section as below:
        <bindings>
            <wsHttpBinding>
                <binding name=”WSHttpBinding_IDataService” closeTimeout=”00:01:00″
                    openTimeout=”00:01:00″ receiveTimeout=”00:10:00″ sendTimeout=”00:01:00″
                    bypassProxyOnLocal=”false” transactionFlow=”false” hostNameComparisonMode=”StrongWildcard”
                    maxBufferPoolSize=”2147483647″ maxReceivedMessageSize=”2147483647″
                    messageEncoding=”Text” textEncoding=”utf-8″ useDefaultWebProxy=”true”
                    allowCookies=”false”>
                    <readerQuotas maxDepth=”2147483647″ maxStringContentLength=”2147483647″ maxArrayLength=”2147483647″
                        maxBytesPerRead=”2147483647″ maxNameTableCharCount=”2147483647″ />
                    <reliableSession ordered=”true” inactivityTimeout=”00:10:00″
                        enabled=”false” />
                    <security mode=”Message”>
                        <transport clientCredentialType=”Windows” proxyCredentialType=”None”
                            realm=”” />
                        <message clientCredentialType=”Windows” negotiateServiceCredential=”true”
                            algorithmSuite=”Default” establishSecurityContext=”true” />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>

        Having done that, your service will still not using this binding configuration, you need to add the binding name to the bindingConfiguration attribute inside your service element.

  <services>
      <service behaviorConfiguration=”DataServiceBehavior” name=”Zuko.Service.DataService”>
        <endpoint address=”” binding=”wsHttpBinding” contract=”Zuko.Service.IDataService” bindingConfiguration=”WSHttpBinding_IDataService”>
          <identity>
            <dns value=”localhost” />
          </identity>
        </endpoint>
        <endpoint address=”mex” binding=”mexHttpBinding” contract=”IMetadataExchange” />
      </service>
    </services>

1, July 2008

Microsoft Open Specification v1.0 released

Filed under: .NET Programming,Exchange,Office,Sharepoint,SQL Server,WCF,WPF — patrickyong @ 8:49 am

Awhile ago I blogged about Microsoft releasing products protocol documentation which are essential design specifications. That was about 2 months ago and the documents are of beta version.

Today the official version 1 is out that it covers the following products.

  1. Windows
  2. WCF
  3. Windows Server Protocol
  4. .NET Framework
  5. Office
  6. Office Binary File Format
  7. SharePoint
  8. Exchange
  9. SQL Server
  10. VBA Language Spec
  11. XAML
« Previous PageNext Page »

Blog at WordPress.com.