blog.pagesd.info

Aller au contenu | Aller au menu | Aller à la recherche

mercredi 24 septembre 2008

Je me souviens...

Il y a près de quatre ans, je démarrais un nouveau projet sans trop savoir ce que j'allais en faire et petit à petit c'est devenu Quick-Content puis Altrr-Press aujourd'hui.

Pour me motiver et garder une trace des différents essais que je faisais, j'avais démarré un blog en anglais sur WDevs, un hébergeur de blogs dédiés au .NET. Malheureusement, WDevs avait fermé ses portes et disparu courant 2007, ce qui faisait que j'avais perdu toutes mes notes.

Et aujourd'hui, après des tonnes de fois à me dire qu'il fallait que j'aille faire un tour du côté des archives de l'internet , je me suis enfin décidé (merci le bruit) et miracle, on dirait que tout est encore là : http://blogs.wdevs.com/qc, en attendant le backup complet ici même : http://blog.pagesd.info/tag/wdevs.

Ca parle pas mal de QC (enfin quand je m'astreignais à bloguer), mais pas que (y'a notamment mon "célèbre" billet sur l'utilisation du SMTP de GMail avec System.Web.Mail. Les liens sont un peu cassés, parce que 4 ans pour internet c'est vieux, mais c'est quand même agréable de retrouver et relire tout ça.

Edit: ça pourrait être l'occasion de terminer la mise à jour du site à partir des différents essais sous Wordpress et Blogger.

mercredi 26 juillet 2006

(Wdevs) Free Download: MSDN Library May 2006 Edition

For the first time, we're making the MSDN Library freely available for download from Microsoft Downloads. Previously, the Library was only available for download to MSDN subscribers. The current download is the May 2006 Edition and future editions will also be available when we release them.

=> http://www.microsoft.com/downloads/... !!!

From http://blogs.msdn.com/robcaron/arch...

mardi 30 mai 2006

(Wdevs) One can count only on oneself

After the publication of the site for Arsac Voyages, I could note that it was not so easy to reference a website.

It's not a problem with the major search engine like Google, Msn Search or Yahoo. And it's ok with Dmoz too.

No, that becomes a deal when you want your site to appear on more local directories. In my case, I naturally wished to record it on directories about Ardèche.

And there, it's not very brilliant compared to search engine :

  • many directories imperatively requires a back link
  • a majority make only a redirection to your site (like goto.php?id=12345) and not a good old true real hard link
  • there are also all those directories where you have to pay

What has also surprised me, it's the little number of links which these directories contain :

  • some are really ridiculous with less than one about fifty links which display only after a long travel in an infernal tree structure
  • in the best cases, most serious directories posts between 200 and 300 links, which seemed to me very poor : Ardeche is a "small" department, but not at this point :)

And to crown the whole, the process to submit a new site is not always very simple but on the other hand it's generally take several weeks to be recorded!

What has to arrive arrived. And I said to myself : I am not so stupid! I can make with QC a better directory than all these things.

Et voila, after a little programming and much input, there is not one but two new sites built with QC :

And once again, thanks to the magic of QC (and CSS :), its possible to obtain two different layout with tyhe same code base.

Edit : and 74 - Haute-Savoie - l'annuaire de la Haute-Savoie : Philippe's directory for Haute-Savoie websites.

lundi 10 avril 2006

(Wdevs) An academic case for QC

It's done! I finally put on line the site of the company of autocars in Ardèche (near Aubenas) where my sister works. I'm very proud of it because I entirely build the layout template rather than to re-use a free one. I start with the Skidoo Too layout and by feeding my inspiration from several sources, I imagined a clean and modern design. For me, it proves that QC (with the help of Skidoo Too) is really effective for versatile CSS design. That also shows that the use of the CSS brings a true added value since the site displays perfectly with all browsers.

I worked so that the update of the contents is the easiest possible, without sacrificing too much to the design. For example, there are blocks for the conditions of each travel. The display is pretty sophisticated, but they are very simple to edit. All that the writer have to do, it's to use the wysiwyg editor to set an «h3» tag for the travel title and an «h4» tag for the price. You can see the result on the page for the travels in one day.

One of my other reasons for satisfaction, it is that all the pages of the site are Valid XHTML 1.0 Transitional! and that all CSS are almost OK, with the exception of a hack in Skidoo Too which "keeps IE from breaking horribly under narrow viewports".

From today, I can consider that a new stage is reached for QC.

lundi 20 février 2006

(Wdevs) Inventory

I must admit that I didn't really succeed in holding my starting objective which was to track my work as I develop another IBuySpy clone.

On the other hand, I succeeded in holding my development objectives :

  • QC provide standard xhtml code and use CSS compliant templates,
  • a Private Assembly architecture with qc.Engine.dll and qc.Classics.dll (with 32 boxes !!!),
  • the data layer works with Access, Sql Server, Oracle, MySQL and PostgreSQL (although that made a few months that I didn't test with MySQL and PostgreSQL).

And I have also the excuse to have more or less writed the main step of development on my French weblog.

Today, we use QC as a framework to build web applications in the company where I work. So it's OK as an intranet/portal engine. On the "CMS" side, it's not really deployed. We still doing in-house testing (eating our own dog food).

  • Frederic was the first to use it build a site for his village of Condrieu, famous for his "Côtes du Rhône" wines.
  • Since this weekend, Philippe has followed him to put on line a site for la Compagnie Peretti, which realize theater spectacles and puppet show intended to the children.

Normally, this list should increase in the weeks to come (at least of 1 site :).

mardi 2 août 2005

(Wdevs) A C# Client to the blogmarks.net Atom API

Blogmarks.net is a free & open bookmarks manager based on keywords (aka Tags) and sharing. With Blogmarks.net you'll be able to store and share with other users your favorite websites trough a "blog-like" technology. Your bookmarks will now be available from any internet connection and accessible from a variety of others services trough our API.

I just upload a c# client in the developper wiki. It was a great exercise to make REST with c#.

vendredi 1 juillet 2005

(Wdevs) Office Web Components: Object Model and Terminology

While cleaning out som junk, Milan Negovan from ASP.NET Resources rediscovered the diagram of Office XP Web Components.

jeudi 23 juin 2005

(Wdevs) Another MySQL manager

EMS offers a free lite version of MySQL Manager. And they distribute PostgreSQL Manager Lite, MS SQL Manager Lite and Firebird Manager Lite for free too.

jeudi 24 mars 2005

(Wdevs) Gestion des erreurs d'une application Web

Comment gérer de manière globale les exceptions non traitées dans un site web. Ainsi qu'automatiser l'envoie de mail et l'écriture dans le journal des événements Windows lorsqu'une erreur est levée.

Article sur Tech Head Brothers.

lundi 21 mars 2005

(Wdevs) Oracle, auto-increment column and pre-defined values

This week-end, I looked for a way to have auto-increment column in Oracle while having the possibility to set a given value in some inserts.

Several years ago, I used a trigger where the pseudo auto-incremented column was initialized with a sequence only when its value is empty.

CREATE OR REPLACE TRIGGER TRG_BI_all_Increments
   BEFORE INSERT
   ON all_Increments
   FOR EACH ROW
BEGIN
   IF (:NEW.ID IS NULL) THEN
      SELECT SEQ_all_Increments.NEXTVAL INTO :NEW.ID FROM DUAL;
   END IF;
END;

That enabled me to initialize parameters tables with default values from an sql script. The drawback was that once the data are loaded, the start value for the sequence had to be manually reset to the maxim value inserted in order to avoid duplicate errors.

I rewrote it so that when an INSERT statement define the ID value, the triggeer checks if this value is greather than the current sequence value and in this case automatically reset the sequence to the inserted value.

/* create table */
CREATE TABLE all_Increments (
    id   INT NOT NULL ,
    test VARCHAR2(100) ,
    CONSTRAINT PK_all_Increments
    PRIMARY KEY ( id )
);

/* create sequence */
CREATE SEQUENCE SEQ_all_Increments
    START WITH 1
    MAXVALUE 1.0E28
    MINVALUE 1
    NOCYCLE
    NOCACHE
    ORDER;

/* create trigger */
CREATE OR REPLACE TRIGGER TRG_BI_all_Increments
    BEFORE INSERT
    ON all_Increments
    FOR EACH ROW
DECLARE
    last_Sequence NUMBER;
    last_InsertID NUMBER;
BEGIN
    IF (:NEW.id IS NULL) THEN
         SELECT SEQ_all_Increments.NEXTVAL INTO :NEW.id FROM DUAL;
    ELSE
         SELECT NVL(Last_Number, 0) INTO last_Sequence
           FROM User_Sequences
          WHERE UPPER(Sequence_Name) = UPPER('SEQ_all_Increments');
         SELECT :NEW.id INTO last_InsertID FROM DUAL;
         WHILE (last_InsertID > last_Sequence) LOOP
              SELECT SEQ_all_Increments.NEXTVAL INTO last_Sequence FROM DUAL;
         END LOOP;
    END IF;
END;

/* test values */
INSERT INTO all_Increments (id, test) values (1, 'one');
INSERT INTO all_Increments (id, test) values (2, 'two');
INSERT INTO all_Increments (id, test) values (3, 'three');
INSERT INTO all_Increments (id, test) values (10, 'ten');
INSERT INTO all_Increments (test) values ('eleven?');
INSERT INTO all_Increments (id, test) values (5, 'five?');
INSERT INTO all_Increments (test) values ('twelve?');

vendredi 18 mars 2005

(Wdevs) IBuySpy Roles are not enough

ContentXML utilizes groups and roles to manage content within the system. There are four primary roles: contributor, approver, publisher, and administrator. Each of these roles has certain rights that enable users to complete content updates. Groups are set to organize what content is accessible by users within certain groups in the company. An example would be a business analyst who would be in the marketing group with access to marketing collateral and a contributor role, which requires updates to be approved. This business analyst would not have access to the financial group’s files unless the analyst was also a member of the finance group.

Primary takeaways:

  • Roles modeled after organizational duties
  • Groups modeled after organizational structure
  • Content updated and added according to group and role

jeudi 17 mars 2005

(Wdevs) Wysiwyg and popups

I made some new tests for the wysiwyg editor of the Htmltext boxes. This time, I used widgEditor, which suits better to my needs. Like The Man in Blue explains it, I think that other editors are over complicated, but I didn't want to write a new one editor.

I still have to add some dialog boxes to allow users to:

  • define internal links,
  • create a link to download a file from the webserver,
  • insert an image.

I started to program a dialog box for internal link where users can select one of the screens of the site. I used DestroyDrop to represent the tree structure of the site, since I already employed it for my SitreTree box. With this dialog box, administrator can quickly navigate to another the screen. And when I would use it with widgEditor, it will allow author to create links inside the site. I also plan to call it from Links and Redirect boxes to easily manage the internal links and redirections from these modules.

Concerning the file dialog box, I already write a minimal one from my FileDir box, where I can browse the server file system. I have to add an upload functionality and later try to use thumbnails for image inserting. But it’s ok for a first attempt and it will be sufficient for this time. I preferred to vaste my time to make modifications to call it from boxes where user can give an url to a local file, like Image, FlashFile, SvgFile, XmlFile…

Popups are really not easy to code. I wanted modal dialog at least in Internet Explorer and normal popup with Firefox. Except that links in a window opened by a showModalDialog are a nightmare. Fortunately, I found an article for an ASP.NET Pop-up Date Picker Control where Mark Lubischer explains how he solved this problem with IFrame. Et "cerise sur le gateau", thanks to him I discovered the "modal=yes" attributes which tell to Firefox to open a modal window.

jeudi 10 mars 2005

(Wdevs) Screens and boxes authorizations

Finally, I decided to use specific tables rather than fields to manage authorizations for screens and boxes. So I created two tables:

CREATE TABLE qc_ScreenRoles (
    idScreen TEXT(20) NOT NULL,
    aktion TEXT(10) NOT NULL,
    idRole TEXT(20) NOT NULL
);

CREATE TABLE qc_BoxRoles (
    idBox TEXT(20) NOT NULL,
    aktion TEXT(10) NOT NULL,
    idRole TEXT(20) NOT NULL
);

Where aktion field is filled with constants like "view", "edit" or "admin". I had to write "aktion" because Access don't accept "action" as a field name.

A generic AktionRoles class handles these two tables and the qc_UserRoles for user's roles.

The main difficulty was to find how to propose the user to set rights. I looked for a layout that don't rely on a CheckBoxList like IBuySpy because it's not easy as soon as you got more than 10 roles. I really like the layout adopted in DotNetNuke 3 where actions are displayed on the first line as column headers and with a row by role even if it's heavily rest on table tags. Personally, I determine to write a specific UserControl that use a cleaner html code with three properties :

* actionsTitles for headers ("View", "Edit" or "Admin"),
* actionsId for field constants ("view", "edit" and "admin"),
* actionsRoles for authorization assignments.

(missing image)

The last step will be to check all this authorizations when displaying screens and boxes. Currently, I can configure rights but they are not used.

mardi 8 mars 2005

(Wdevs) Next time on this blog

After that, I will have to post something...

lundi 31 janvier 2005

(Wdevs) User management

After inserting some new fields to my users table, I almost accomplish all my primary requirements concerning functionalities for user management.

Firstly, my Admin toolbox has a Roles box where administrators can list roles and manage them. As my roles table is extremely basic, this box is rather straightforward to use.

The Admin toolbox also includes a Users box. Administrators can place this box on a screen in order to display registered users. In addition, this box gives access to users' management where authorized users can create new user, change account information and assign them to roles.

My Users box is an enhanced version of the IBuySpy one. First, it can generate random user id and password when administrator let one of them empty. Second, it allows filtering of users according to selected roles. This way, an administrator can easily visualize users and roles association. In addition, this box contains a DropDownList control filled by users that quickly assigns a user to selected roles. Third, another DropDownList operates as a filter for users according to their last login date. This discriminates users that did not access since more than 3 or 6 months and gives a method to remove them in one click.

For final user, I have a Login box, where each registered user can give his user id and his password when he needs to access to protected screens. This Login box also provides a reminder password box. Here one can give his email address and whether he is a registered user, he will receive an email with a new random generated password. As passwords are stored as a MD5 non-reversible encrypted string, I cannot send original password.

When authenticated users would like to change their password, I build a Password box with the standard three fields (old password, new password and confirm password) and a "Save" button to apply their new password.

There is an auto-registration box where one can give his email address and his name. If his email domain belongs to an authorized domain, a new account will be created with default roles and the new user will receive an email with his account information. This kind of registration will be useful for intranets.

Later, I will complete my LDAP integration tests. In a first time, my intention is to check authentication according to my users table and then control it against a LDAP server.

  • Authentication is ok with database and ko with LDAP => it's a "local/private/temp/multipurpose..." user account,
  • Authentication is ko with database and ok with LDAP => create a new account in users table according to LDAP data and with default roles,
  • Authentication is ok with database and ok with LDAP => update account according to LDAP data.

Of course, when a user will exist in LDAP, I will not store his password in database. Therefore, an empty password will denote a LDAP user. Presently, I will associate users to roles in database. Utilization of LDAP groups to generate roles will come in a far far away time.

But now, I have to revise my SQL scripts and to update my monoforge demonstration. Next, I need to make some tests before updating the Access version.

lundi 17 janvier 2005

(Wdevs) TOAD for MySQL

Quest Software has released TOAD for MySQL. That would be great if they succeeded to make it as good as TOAD for Oracle. Currently, I was using trying to use MySQL-Front, but it drives me crazy.

They offer TOAD for MySQL as a freeware release. The only drawback is that every 60 days it's necessary to download and install it again. And as there is a TOAD for SQL Server too I will have to work again at the MSDE version of my portal.

vendredi 14 janvier 2005

(Wdevs) System.Web.Mail and smtp.gmail.com

Important update: there is another snippet to use smtp.gmail.com with System.Net.Mail for .NET 2.

Since I had difficulties to find examples on Google, I publish my code that uses smtp.gmail.com as smtp server to send emails.

public string sendMail (string from, string to, string cc, string bcc, string subject, string body) {

  // Mail initialization
  MailMessage mail = new MailMessage();
  mail.From = from;
  mail.To = to;
  mail.Cc = cc;
  mail.Bcc = bcc;
  mail.Subject = subject;
  mail.BodyFormat = MailFormat.Text;
  mail.Body = body;

  // Smtp configuration
  SmtpMail.SmtpServer = "smtp.gmail.com";
  // - smtp.gmail.com use smtp authentication
  mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
  mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "myemail@gmail.com");
  mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypassword");
  // - smtp.gmail.com use port 465 or 587
  mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
  // - smtp.gmail.com use STARTTLS (some clients call this SSL)
  mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");

  // Mail sending
  try {
    SmtpMail.Send(mail);
    return "";
  } catch (Exception ex) {
    return ex.Message;
} 

In addition, two useful links:

Unfortunately this code doesn't function under mono:

Server reponse: '530 5.7.0 Must issue a STARTTLS command first';Status code: '530';Expected status code: '250';Last command: 'MAIL FROM: '

jeudi 13 janvier 2005

(Wdevs) Roles dilemma

With IBuySpy, roles that are allowed to view or edit a module are stored in one string field AuthorizedEditRoles as a semicolon separated list. It's very straightforward to do but not especially relational. When I will delete a role, it won't be removed from the AuthorizedEditRoles by a cascading delete.

At this time, DotNetNuke 3 makes use of a permissions table with one record for each couple module/role. Although it's a little harder to program, it also becomes easier to maintain data integrity. And in this case, I can retrieve all roles allowed to edit a given module or all modules updatable by a role.

Therefore, I need to decide which method I will exploit:

  • keep the easy way of IBuySpy with a semicolon separated list,
  • build a more relational model by adding BoxRoles and ScreenRoles tables.

In addition, if I choose to stay with a semicolon separated list, why not generalize this concept and replace the UserRoles table by a simple AffectedRoles in the Users table?

mardi 11 janvier 2005

(Wdevs) Login and toolbar

I worked a little more on the admin part. First, I created tables to manage users and roles and made a sql script to initialize an "Admins" role and two users ("admin" and "guest"). After that I wrote a login box then I updated my code according to the fact that the visitor is authenticated or not. I will handle roles later.

(missing image)

Second, I set up a way to hide or show all admin and configuration buttons. By default, once you are logged on, I display a toolbar for screen management at the top of the screen and for each box there are an edit or configuration button before its title and an admin button after it.

(missing image)

Whereas I use cute buttons, it's not practical to have all them on the screen. So I added another icon to my toolbar, which hide all other buttons when clicked. With this feature, you have the same look as normal visitors, but you're still logged as site administrator.

(missing image)

And another click on the hide/show icon and all buttons come back.

jeudi 6 janvier 2005

(Wdevs) Time passes

and I don't succeed to update this weblog regularly. Concerning my portal tests, that doesn't go either as quickly as I wish it. But let's be positive, I made some progress and from now I have a score of boxes in my 3 toolboxes.

  • Classic : which contains boxes like those in IBuySpy,
  • Extra : with boxes for Flash, Svg, feedback, faq, iframes, file exploration, Google search and ads,
  • Navigation : where I group all boxes dedicated to site navigation (menu, map, breadcrumbs, tree...).

Also I begin to work at the admin part of the site: create a new screen, a sub-screen, admin a screen and insert or admin a box. And practically all my boxes now have a configuration form. I left the document back-end for later and I still look after FreeTextBox, FCKEditor or Cross-Browser RTE although I used htmlArea for wysiwyg in the htmltext box. In fact, I need to add "generic" dialogs in order to select images, internal links or files. First, I could use them in any wysiwyg editor, and later I will add them in the configuration fomr for some boxes (lists, Image, Flash...).

Now I have to make real tests to check that everything is ok on Mono or with an Access database. Next I have to start the security part, with users and roles tables and at least a login box (and a way to select roles in screen or box admin form).

But my current problem is url rewriting. I just write a very simple implementation directly in global.asax.cs and it doesn't handle sub-screens with Mono (test site on monoForge) whereas it's ok with IIS (same code on WDevs). I need to resolve this before updating my demo site.

- page 1 de 2