Monday, June 30, 2008

Make a change to an application that uses the Data Access Layer technique

I think I like this technique in general. I have to admit that the learning curve was high. But once you got used to, I think you would become liking it. Especially if you are a guy like me, who had an ASP doing everying. No “three tier”… but who on the other hand, like OO (object oriented) programming.

As always with a tool like this, a RAD, it is less complicated when you create a brand-new app. But today, I need to add some new fields to the DetailView, to the database table behind.

Of course, you first add the column to the database table.

Then with the TableAdapter representing the table, you should first adapt the main select query. You should not add the column to the DataTable yourself. VS does that for you.

When the change is saved, VS asks you whether you want the update command too adapted. You may find it useful, if you do not do anything special with the update statement, but if you do, ATTENTION, with this auto adaptation, your manual editing of the update statement will be all gone. By the way, it apapts the insert command too, when you say YES.

I had the following difficulty.
As said, I added some new columns to an existing table. One of them was a BOOLEAN field. A bit column in SQL.
I added a CheckBox to the DetailedView for it, and got error saying unable to convert DBNull to BOOLEAN.

OK. Understand. For all existing data it is NULL because I created the column to accept NULL... wait a minute… I could have set the default value…
Anyway, I made it work by setting it to FALSE in the DAL class. First get data in the DataTable calling a GET method of the TableAdapter, then set the field to FALSE if the original value is NULL.

Thursday, June 19, 2008

PointFire

Still, how to do a multi-ligual site.

My boss asked me to evaluate a package called PointFire. Although it turned out not really something we are looking for, it may be interesting for others who have a different set of requirements than ours. But it is not free. I myself find it a little expensive. Please ask directly the vendor about the price.

It does on-the-fly translation. It is a httpmodule, so the translation covers all output, regardless where it is produced; masterpage, layout and contents.

Its user guide reads that for all phrases that Sharepoint uses out-of-the-box like “My Site”, “Site Actions”, it has a built-in dictionary, so Sharepoint own navigation, configuration pages etc are translated.

What do you think happens if you have the sequence of words like “Site Actions” in the middle of your contents? Nothing, no traslation, except that you tag just that two words i.e. <span>Site Actions</span>.

You “register” your own words and phrases that you want the module to translate, into a List called Multilingual Translations created when the module is activated. There I registered the original English phrase “Hello, my name is”, together with its French translation “Bonjour, je m’appele”. And the key is the same. You need to tag a phrase, for it to be translated. I did not see it written anywhere in the userguide though.

Voila, mon rapport bref sur FirePoint. J’espère qu’il vous donne quelque aide…

Wednesday, June 18, 2008

Re: Sharepoint Variations: Not what I am looking for?

I posted this question to MSDN forum. And Below is the answer.

“Actually when the page is published it creates a new minor version in all sub variations. It's not overwriting any translated content, because it is a different version of that page.
It's then up to the owner of the content in that target variation to merge any changes into translated content. That's not something you can do by machine, so it's handled by versioning.”


Yes! You are absolutely right. There, you really sometimes find what you are looking for.

Then if the story is really like what I was telling you, just one typo in English, all you have to do at those target sites is to restore the previous version.
Actually, we should not be forced to do this though… There should be a way to correct English typo without affecting others… wait a minute… there may be a way…
I will have a look and report what I found here.

Tuesday, June 3, 2008

Sharepoint Variations: Not what I am looking for?

I think I am not going to use it… at least for the moment…. Disappointed very much…

Before, I quoted someone saying as:
“Changes you make to the source site will automatically appear in each target site.”

Ammm… yes, maybe… but in other words, it wipes out what existed previously in the target sites….

That is, OK when the page is first created, but when you then find a typo (one spelling mistake among a million of words), you correct it and re-publish.
The tanslator is emailed, opens the page in one of the target sites to find that… all translations he/she previously did, the million of words are all gone!!!