December 2007 - Posts
For you who haven't know, I'm very excited to share with y'all that two little story about our company – DyCode – have been published on detikinet.com on December 10, 2007 and Kompas Cyber Media on December 19, 2007. The articles also tell about other ISVs, which are: Rent@soft and Sangkuriang Studio. Thanks to everybody those have made this possible. To read the full articles, please follow this link:
detikinet.com: http://www.detikinet.com/index.php/detik.read/tahun/2007/bulan/12/tgl/10/time/152329/idnews/864834/idkanal/319
Kompas Cyber Media: http://www.kompas.com/ver1/Iptek/0712/19/194807.htm
Have a nice reading 
Since last week I wanna share about this. My hand is itchy want to blog, but what can I say, busy busy busy day :)
Back to the time when I and Reza delivered a talk in MSDN Day | VS2008 Deep Dive (Nov 2, 2007), I asked the audiences "How long you need to develop a page that contains a GridView displaying data from a table that has some references to other tables (off course you want to render the foreign key column as a text of selected column of foreign tables instead of the id/key value), complete with DetailView (displayed when one row of GridView is selected), also completed with edit & delete feature (the form need to render a DropDownList for foreign key column)? Everything need to build from scratch". Some audience say two hours, some say one hour, and even 30 minutes..Wow, that's fast. And then I came up with surprising answer, "5 minutes, maximum". How is that possible? This is why...
As you might know, ASP.NET team has released an extension to ASP.NET 3.5 called ASP.NET 3.5 Extensions CTP. It was previously called ASP.NET Futures (last time I know, it's July 2007 release). I won't say much about it. Just go to http://asp.net/downloads/3.5-extensions/ to get quick reading about it. There is a good quick start at http://quickstarts.asp.net/3-5-extensions. ScottGu has a nice blog about its introduction: http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-3-5-extensions-ctp-preview-released.aspx. Right now, I will say quite much about one of delivered features, called ASP.NET Dynamic Data Support.
For you who have been playing around with ASP.NET Futures, you might already know about Dynamic Data Support. It's a cool feature that allow us to quickly develop data-driven web site without having to create any pages (for basic usage). I repeat in other words, NOT A SINGLE PAGE has to be created to create a complete data-driven web site. Can you imagine that...I don't believe my self. Unlike other scaffolding framework that has some generators to generate pages, Dynamic Data doesn't need any generators.
Last time I presented about it in MSDN Day, many audiences think I was joking at that time. They think I've prepared the aspx pages before to build such a web site. When I showed them the files inside my VS solution, they finally believed that I didn't create any pages to get a web site run. A girl in the first row of seats even said: "males banget...". Does it mean we'll be lazier to develop ASP.NET web app? I don't know :)
In fact, what I've shown to them is only Dynamic Data of ASP.NET Futures (July). In this ASP.NET 3.5 Extensions release, it brings even more. One thing that I like the most of this release is that now it's more customizable. Previously, you won't be able to change the web control used for inserting/editing a column value. Now, you can use a user control (ascx file) for that purpose. The page templates used to generate pages are now exposed to us. The great thing among other things is Dynamic Data doesn't access tables directly using ADO.NET provider, now it uses LINQ to SQL (and in the future LINQ to Entities) to work with tables and views. Further input validations are now possible at model (LINQ model) level.
OK, enough for some "basa basi busuk" :), it's time to get started.
Preparation
1. Download
ASP.NET 3.5 Extensions CTP is not included by default in .NET 3.5 SDK or VS 2008. You need to download it first at http://asp.net/downloads/3.5-extensions. Click Download the ASP.NET 3.5 Extensions Preview link and you'll be brought to the download page. Click download button and ASPNetExt.exe file will be downloaded.
2. Installation
After the file downloaded, install it. The installation should be easy.
If you use AVG Free anti virus, during installation you might be prompted following dialog. Just Ignore it. It's caused by *.html.js file naming in Silverlight. Some smart people at Microsoft should fix this.
Installation should be finished successfully. Now you're ready to get started with Dynamic Data Support in ASP.NET 3.5.
First Dynamic Data WebSite
1. Open your holly Visual Studio 2008 :)
2. Create a new Dynamic Data WebSite
If previous installation is successfully, you'll see a new WebSite template is installed for you, that is Dynamic Data WebSite. Specify the location of new website, choose language (I prefer Visual C# :P), then OK.
If everything ok, following files are generated for you in your solution. I think you are familiar with all the files/folders, except (maybe) the App_Shared folder. if you look into App_Shared folder, it contains some page templates, user controls, and images those are shared across the Dynamic Data website.
3. Add database to manage
I'll add a very known database, Northwind. Right click to solution name and click Add Existing Item. Then find database MDF file. It should be MDF file, means SQL Server database file. Did I mention that Dynamic Data currently only SQL Server? If I haven't, yes it is. If in the future, it supports LINQ to Entities, maybe other databases are supported.
After you choose Northwind database file, you'll have:
Double click to NORTHWND.MDF file, you'll get Server Explorer window. Drill down to Tables node to view tables.
4. Add new LINQ to SQL Classes
Right click to solution name and click Add New Item. Then at Add New Item dialog, choose LINQ to SQL Classes, name it Northwind.dbml, and click OK.
You'll be prompted to place the dbml file to App_Code, just click Yes. Now, you'll have Northwind.dbml file inside App_Code special folder. Double click to it and dbml designer will be opened.
5. Generate LINQ to SQL Classes from database tables
Back to tables list in Server Explorer window. Select all tables then drag them to dbml designer. After some moments to extract tables info, you'll get LINQ to SQL Classes generated for you, like following picture.
6. One last thing, you can optionally view and edit some tags in web.config.
Find following part:
<dynamicData dataContextType="" enableTemplates="false">
<mappings queryStringKeyPrefix="" pattern="~/{table}/{viewName}.aspx">
<add actions="list,details" viewName="ListDetails" templateFile="ListDetailsTemplate.aspx"/>
<!--
<add actions="list" viewName="List" templateFile="ListTemplate.aspx" />
<add actions="details" viewName="Details" templateFile="DetailsTemplate.aspx" />
-->
<!--
Special overriding cases
<add actions="list,details" tables="Products,Categories" viewName="SpecialName" templateFile="ListTemplate.aspx"/>
<add actions="list" tables="Products" templateFile="DetailsTemplate.aspx" path="~/customPath.aspx"/>
<add actions="list" tables="Orders" viewName="MyListViewName"/>
-->
</mappings>
</dynamicData>
Change enableTemplates attribute value to "true".
7. Now you're ready to view the website in browser. Right click to solution name and click View In Browser, or you can press ctrl+F5.
Eng...ing...eng...without create any ASP.NET pages, you'll get the default/home page like this.
As you might notice, this default page show the list of tables those you have added to dbml designer before.
Playing around
Click to one table name link, for example Products. You'll have this page:
As you see, the page display a GridView displaying paged records of Products table, complete with Filter controls (to filter displayed rows), column sorting, row editing/deletion/selection, paging controls, and even DetailView at the bottom. You might also notice that instead of rendering Category ID value for Category column, it renders the name value of Category. It also happens for Supplier and Order_Details. Discontinued column that has boolean type is rendered as checkbox. Such a amazing result considering not much we haven't do so far. Did I mention it is already AJAX-based? Yes it is. If you click, lets say sorting link of a column, the rows will be sorted without refreshing the whole page.
By clicking a Category link, such as Condiments, you'll get Category table page like this. Please notice at DetailView, Condiments category is automatically selected. Nice...
At the GridView, click View Products link for Dairy Products category, and you'll be back to Products page with Category filter automatically selected fro Dairy Products. So, displayed record will be filtered for Dairy Products category. Nice...
Now, click Edit button on a row, and you'll see columns are rendered as input fields. Lets say, you empty ProductName value and move to other field, you'll get:
That means some validations have been made for you. For above example, required validator has been applied to ProductName column since the column is mandatory (not null) in the Products table of Northwind database.
You can play more since many features those I can't explain all here.
Now, what about if I want to customize, lets say customize displayed columns in the GridView or add custom validation. Just wait for my next blog. Right now, I need to sleep :)
I've searched blogs about Virtual Earth in INDC Geeks blog, I couldn't find one. So, I think it's good idea to start very basic and brief one. This blog is intended to give you a glance about how to embed map into web page using Virtual Earth Map Control SDK.
Lets code a very basic one. This code below is a regular HTML page. Just start your Visual Studio, Add New Item and select HTML Page, and write this code.
Then View in Browser, and you'll get following display. I don't know why the default map is US :)
OK, I'll explain the code as clear as possible.
- First thing first, you must include the JS script that contain Map Control script. You can easily write this code:
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6"></script>
As you can see, we add reference to map control library version 6, the latest version. Off course you need connected to internet to get the script and the map loaded.
- Write simple JS function to get the map object.
var map = null;
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap();
}
I think the function code is self-explained. First, create map object that is instantiated from VEMap class with the ID of layer (where the map will be rendered) as constructor parameter. Then, call LoadMap method of map object.
- You need to call the above JS function when the body is loaded. So, in the body tag you should set onload attribute with GetMap() function.
- Then, make sure you have a layer (div tag) inside the body with specified id, "myMap" in this case.
That's it and you can embed map into your web page.
Ok, lets say now you want to display specified location as a default when the first time the map is loaded. You just specify a location as VELatLong object and use the object as LoadMap() method parameter. Change the JS function above to:
var map = null;
var dyCodeCoord = new VELatLong(-6.89186, 107.59987);
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap(dyCodeCoord);
}
And you'll get following map. The exact coordinate will be displayed as center by default.
As you can see at the code above, we create VELatLong object to be provided as LoadMap argument. VELatLong class requires two parameters: latitude and longitude point in decimal form. If you have the point in degree form, you need to convert to decimal form first. Use following page to convert it: http://robuck.net/geocaching/convert.htm
Now, you want to customize more when the map loading. First you need to know more about LoadMap parameters:
VEMap.LoadMap(VELatLong, zoom, style, fixed, mode, showSwitch, tileBuffer);
Parameters:
VELatLong
A VELatLong Class object that represents the center of the map. Optional.
zoom
The zoom level to display. Valid values range from 1 through 19. Optional. Default is 4.
Style
A VEMapStyle Enumeration value specifying the map style. Optional. Default is VEMapStyle.Road.
fixed
A Boolean value that specifies whether the map view is displayed as a fixed map that the user cannot change. Optional. Default is false.
mode
A VEMapMode Enumeration value that specifies whether to load the map in 2D or 3D mode. Optional. Default is VEMapMode.Mode2D.
showSwitch
A Boolean value that specifies whether to show the map mode switch on the dashboard control. Optional. Default is true (the switch is displayed).
tileBuffer
How much tile buffer to use when loading map. Default is 0 (do not load an extra boundary of tiles). This parameter is ignored in 3D mode.
Lets say you want to display aerial view with zoom level is 10 by default. Then change LoadMap method to:
map.LoadMap(dyCodeCoord, 10, VEMapStyle.Aerial);
And you'll get:
To emphasize to location, you can add pin and display detail information about the location. To do that, you need to use VEPushpin class. Change the GetMap() function to:
function GetMap()
{
map = new VEMap('myMap');
map.LoadMap(dyCodeCoord, 10, VEMapStyle.Aerial);
var pin = new VEPushpin(1, dyCodeCoord, null, 'DyCode', 'PT. Dycode Cominfotech Development');
map.AddPushpin(pin);
}
And you'll get:
Hover your mouse to the pin, and detail information of the pin will be displayed.
OK, that's it for now. I'll update this blog later. For now, I need to sleep because it's 5 am here.
For more information about Virtual Earth SDK, go to: http://msdn2.microsoft.com/en-us/library/aa905677.aspx
Thanks for reading this brief blog.
Jakarta, December 13, 2007
It's not really DyCode and Frida Lidwina being together at the event. The both attend the event for their own purpose. For example, Frida is a MC of the event while DyCode attends to receive award.
On Dec 13, 2007, Jakarta - more precisely Grand Ballroom-The Ritz-Carlton Jakarta Pacific Place - was full of ISVs, geeks, important people from Microsoft and other, etc, in celebrating "Indonesia Innovates" at Microsoft's Sinergi (Sarana Inovasi dan Kreasi Negeri) event. The event presents the launch of innovation framework, speeches, panel discussion, exhibition, and awarding. More details about the event can be found at http://www.microsoft.com/indonesia/events/sinergy.aspx. In this blog I'm gonna write more about awarding.
In the main session, there are four award categories. The award categories and winner are…eng ing eng…
There is another winner, PT. IAO, but I forget the category, sorry J Also sorry if there is false in above list
As you can see in the list, DyCode receives IT Startup 2007 award. Wow…it's an honor for us, DyCoders. If you refer to DyCode profile (can be found at our website), DyCode is established formally at May 2007, quite new (but we have been teamwork since 2005). During DyCode's life, this is the first time we receive an award from a credible institution, Microsoft in this case. We consider this award is an honor and a gift as well for our hard work all this time since being a startup is far away of easy, especially in Indonesia. Being a startup means you have to start all up by yourself since it's not easy to get support (especially financial support from government, VC, or angel investor) in Indonesia. Such supports from Microsoft Indonesia by giving award, technical & educational support, and marketing support mean a lot for Micro ISV like us. Hopefully, many such of events come ahead to encourage micro ISVs to do their best. DyCode is only one of many micro ISVs in Indonesia, and DyCode represents them to accept this award to encourage their movement. This award is for all of us.
OK, it's time for fun stuffs. I'd like to share with you the awarding moment by displaying photos we've taken.
This is when I'm waiting to receive the award, accompanied by Ms. Frida Lidwina beside me…Ehm..ehm..my heart is beating J
Here is the moment when I'm receiving the award, given by Mr. Lucas Tjahja Prawira of Microsoft (center) and Mr. Sandiaga Uno of HIPMI (left). The award is symbolized as Pinisi Boat. As you can see at the screen behind, the award is for IT Start Up 2007, so you know I'm not lying J
And as a bonus for y'all, this is the photo of my future wife…oops I mean…Frida Lidwina, the MC, that is successfully capture by Iman…Good job Man..The photo is little blur and dark but it's very sufficient to depict her cuteness J She's cute for married woman
This is the photo of all award winners. Mr. Ari Kunwidodo is handshaking to all winners.
Breakout Session 1: LSE – Indonesia Innovates Inovasi IT bagi Perekonomian Nasional
In a breakout session called "Inovasi IT bagi Perekonomian Nasional", DyCode also receives an award together with BataviaSoft, RTI Infokom, Intersoft, and IAO. The award is called Bintang Inovasi 2007 (Innovation Star 2007) and DyCode wins Micro ISV award. Here are some photos:
Pak Risman is explaining about Microsoft's Micro ISV program. As you can see, DyCode is one of Microsoft's managed micro ISV together with BataviaSoft, Sangkuring Studio, and PE College.
Eng ing eng (thrilled music)…The Innovation Start 2007 winners are:
I represent DyCode to receive Innovation Star 2007 award of Micro ISV category. The award is given by Todd Kepus, ISV Developer Evangelist, Asia Pacific Region. Btw, who is the girl next to me J?
And here are all of the Innovation Star 2007 winners together with Todd and pak Risman. From left to right: Amyati Kania Hakim (RTI), the handsome CEO of DyCode :P, Fajar Ramadhani (BataviaSoft), Intersoft representative, Todd Kepus, pak Risman, and IAO representative.
Wow…it's a big day for us, DyCoders. We receive two awards in one event, feel totally extraordinary. These awards won't make us bigheaded and forget who we are and what we're all about. In fact, these awards will make us to do more our best, keep dynamic, and like our motto says "keep moving forward".
Just in case you haven't know who are the DyCoders. Here they are taking photo together. From left to right: Iman (Mgr, Research), Dany (Spv, Adm), Andri (CEO), Reza (GM, Custom Development).
As a bonus J I'll give you the photo of two big guys (literally big not only the title J … peace mas Agung). The CEO of BataviaSoft and DyCode are taking photo together to depict our friendship, personally and business. We even share the same table and space for exhibition, as you can see in the back J
I'm personally very glad to be at this event. Besides receiving the prestigious award, I can meet a lot of people, important people, friends, and geeks.
Thank you very much to Microsoft Indonesia for the great event and for the awards.
For the similar story, please refer to mas Agung's blog at: http://geeks.netindonesia.net/blogs/agung/archive/2007/12/14/i-m-at-microsoft-national-innovation-day-2007.aspx
You can download the slide I and Reza presented in MSDN Day, Nov 30, 2007. Here's the link: http://dycode.com/files/folders/msdnday/entry18.aspx
Hopefully, our "loose" style presentation gives you a glance about Community Server. See you in another MSDN day, it will be more entertaining but still squeeze your brain J
OK, I know for quite long time I wasn't involved in .NET community by online. I have my reasons; someday I'll share with you.
For this first post, I'll share to you about How to get started with Community Server 2007 SDK using VS 2008 and IIS in Vista. This topic I and Reza presented in MSDN Day - Web Application Framework yesterday afternoon (Nov 30, 2007). Here we go...
- Download the SDK from: http://get.communityserver.org/download/cssdk
- Extract the downloaded file, e.g.: CS2007.1_3.1.20917.1142.sdk.zip
-
Database preparation:
- Open SQL Server Management Studio/Express, then create new database, for example: CS2007SDK
- Create a SQL Server login and grant login access to CS2007SDK database. At minimum, following db roles are required: db_securityadmin, db_ddladmin, db_datareader, db_datawriter
- Execute cs_3.1_CreateFullDatabase.sql against CS2007SDK database. You'll find that file in the SqlScripts directory in the SDK
-
Create a new community by running the cs_system_CreateCommunity stored procedure like this:
exec dbo.cs_system_CreateCommunity 'localhost/cs', 'dev', 'admin@example.org', 'admin', 'admin', 0, 0
Where:
localhost/cs = CS URL
dev = Application Name
admin@example.org = Admin email
admin = Admin username
admin = Admin password
0 = Password is stored as plain (0) or encrypted (1)
0 = Sample blog and gallery are not created (0) or created (1)
-
IIS Preparation:
- Create a virtual directory in IIS (e.g: cs2007sdk) pointing to the Source\Web directory, so you have a complete URL: http://localhost/cs2007sdk. It should have Read & Run Scripts permissions. Make sure IIS runs ASP.NET 2.
- If you use IIS 7 in Vista, you need to create Application instead of virtual directoy. And use Classic .NET AppPool as Application Pool, if not, you'll be told there're some invalid configs in web.config
-
Development preparation:
Some of those steps are found in several other blogs, but some are tricky b*st**d steps. So, please if you have more systematic steps, post a comment or post a blog and tell me the link, because it's quite painful J
Hopefully useful.