Thursday, February 25, 2010

XAML Naming Issues

Recently I have encountered issue with XAML application not displaying. It appears the XML control name that I have which is "AdministerAccess" for some reason this name is causing the XML to cease to render. Perhaps there is conflict with the naming of XAML application.

Tuesday, February 23, 2010

DB not updating

By Default Sitecore cache application data. That means if we have 2 developers sharing the same DB, and 1 developer made an update to Sitecore DB, the other developer will not see the DB changes unless he/she restart his/her application pool.

This generally does not cause much problem, because when we developing, we often build our solution which in turn restarting the application pool at the back.

Wednesday, February 17, 2010

Get Sitecore User creation date

Sitecore User creation date value isnt available readily from Sitecore User object. However, I know it is possible to get the creation date, since in "Edit User" XAML in Sitecore has this field populated.

To find out how Sitecore get the creation date, I have dissected Sitecore.Client.dll. In this dll, I believe (correct me if i am wrong) most if not all of the code behind for Sitecore Application reside in this dll. After tracing through the "Edit User" xml, I found out that the Sitecore.Shell.Applications.Security.EditUser is the code behind for the xml that I am after.

Below is the code to get User creation date.

MembershipUser user2 = Membership.GetUser(user.Name);
if (user2 != null)
{
CultureInfo culture = User.Current.Profile.Culture;
this.LastLoginDate.Text = DateUtil.FormatLongDateTime(user2.LastLoginDate, culture);
this.CreationDate.Text = DateUtil.FormatLongDateTime(user2.CreationDate, culture);

this.LastActivityDate.Text = DateUtil.FormatLongDateTime(user2.LastActivityDate, culture);

this.LastPasswordChangedDate.Text = DateUtil.FormatLongDateTime(user2.LastPasswordChangedDate, culture);
this.LastLockoutDate.Text = FormatDate(user2.LastLockoutDate, culture);
}

Wednesday, February 10, 2010

Moving Search Indexes up to datafolder

Unlike Sitecore 6.2, search indexes for Sitecore prior to 6.2 does not store the search indexes at Data Folder. Due to some glitches or issues for having indexes at webroot folder, it is a better approach to move the indexes at Data Folder. Following is the steps to do just that.

In web.config,

Locate <!-- Simple Settings --> and add the settings in red

<Settings>
<!-- Index folder change for stability -->
<setting name="IndexFolder" value="$(dataFolder)\indexes" />
...
</Settings>

Tuesday, February 2, 2010

RTE Output escaping html sepcial character (e.g. & < >)

Ages ago (last year), I have an issue with RTE inside Sitecore, whereby it tries to escape html special character. E.g. for this is
Solution:

It is proper behavior. Imagine that you will output this RTE text on the frontend. Then ">" and "&" could be read as parts of tags or reserved symbols, so such characters are always escaped.
But you can try to add your handler to save HTML in different way. This could be done by the next steps:
If you make such changes, be sure that you handle double meaning situations properly.