Monday, October 16, 2006
Annoying KB918899 issue resolved
Sneaky, sneaky..
Wednesday, October 11, 2006
Sitecore 5.3 & Vista RC2
- Make sure Vista is configured to recognize IIS6 actions/scripts etc. This can be done by checking the appropriate boxes under the IIS part of the "Turn Windows features on or off".
- Install .NET Framework 1.1 (and updates).
- Turn the UAP off (not sure if this really is needed, but that's what I did).
- Run the installer as administrator (right click the installer, "Run as Administrator").
For me it still crashes in the beginning with that InstallDriver Module error, but after that the installer runs (read "is now running" since i'm installing right now) smoothly..
UPDATE 2:
Well, the happiness of the first update was not kept alive for long. After the installation finished (which it did and that was nice) I'm now stuck at the next obstacle - When trying to access localhost all I got at first was an error message saying it couldn't read the config file and a wierd "Could not load all ISAPI filters for site". So, like every other time something goes wrong, I added Network Service and the other system roles to the website and it's content, allowing full access for ease of use. Voila, time to see the next error, and this one is regarding changes made to the handling of the actual web.config file itself. This part was a little more tricky since it's not at all that well documented..
Below is what i've done so far (and as of right now I'm not at all sure about this solution, maybe there's a best-practice way to go about all this, but since I haven't seen one yet I'll keep on trying).
- Create a system.webServer node
- Move HttpModules and HttpHandlers from system.web to system.webServer
- Rename HttpModules to modules
- Rename HttpHandlers to handlers
So far all I get is that it's missing a http handler and nothing will load, but perhaps I'll have it fixed soon..
UPDATE 3:
Well, this is a situation with IIS7 having two options to run the site in: "Classic .NET Mode" or "Integrated .NET mode", the later of the two is what they recommend for IIS7 and future versions. Fine, they want us to move up, that's alright. But right now I don't care, I just want it to run. So, if you want to try and load it into the Integrated .NET mode (which I'm trying to), keep thinking and comment, otherwise you can run a command in the command promt to switch it to Classic .NET mode.
%systemroot%\system32\inetsrv\appcmd.exe set app "SITENAMEHERE/" /applicationPool:"Classic .NET AppPool"
FINAL UPDATE:
When all else fails, admit you've probably done something stupid and save yourself the worry by simply scrapping the old installation and do a new one. Lesson learned.
Hope this will help you install it on Vista if you run across these problems as well.
Take care, P.Wednesday, September 27, 2006
Atlas Example
Right, down to business then: Sitecore and "Atlas".
"Atlas" is pretty much microsofts approach to AJAX and the hype surrounding it, so it's quite obvious that it was not going to go away but instead turn into a new part of the framework (see Scott Guthrie's blog on the matter at http://weblogs.asp.net/scottgu/archive/2006/09/11/_2200_Atlas_2200_-1.0-Naming-and-Roadmap.aspx)
Downloads:
- "Atlas": http://go.microsoft.com/fwlink/?LinkId=52384
- "Atlas" Control Toolkit: http://atlas.asp.net/atlastoolkit
- Install "Atlas" (make sure the checkboxes are ticked to also install Visual Studio project template and to register the .asbx extension in IIS).
- Copy the "Atlas" run-time assembly (Microsoft.Web.Atlas.dll) from its installation folder to your site's Bin folder.
- Open the Web.config file
- Add these elements as children to the <configuration> element <configSections> <sectionGroup name="microsoft.web" type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup"> <section name="converters" type="Microsoft.Web.Configuration.ConvertersSection"/> </sectionGroup> </configSections> <microsoft.web> <converters> <add type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/> <add type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/> <add type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/> </converters> </microsoft.web>
- Add/Integrate these elements as children to the <system.web> element <pages> <controls> <add namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/> <add namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/> </controls> </pages> <!-- ASMX is mapped to a new handler so that proxy javascripts can also be served. --> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/> </httpModules>
- Save the Web.config file.
- Add a reference to the "Atlas" run-time assembly (Microsoft.Web.Atlas.dll).
- (Optional) You can now also add "Atlas" to the Toolbox in Visual Studio. Right click the Toolbox, chose "add tab", name it, then right click, "choose items..", and browse to the "Atlas" run-time assembly (Microsoft.Web.Atlas.dll).
Phew! Ok, that's about it for the installation and messing with a already existing site, now on to the fun stuff.
If you've never tried it before you're going to have fun, "Atlas" is neat and easy to use (note tho that it's still not a full release, so if it for whatever reason does crash, well, sorry, not much to do then but to re-install it).
1: Adding a ScriptManager
Add this to the page you want to enable "Atlas" on.
<atlas:ScriptManager ID="MyScriptManager" runat="server" EnablePartialRendering="true"> <ErrorTemplate> <div style="width: 450px; height: 300px; padding: 10px; border: solid 1px black; background: gray; text-align: left;"> <h1>Site error detected</h1> <p>An unhandled exception with the following message has occured on the server:</p> <p><span id="Span1" runat="server"></span></p> <p>We're sorry for any trouble this has caused you and will fix the problem as soon as possible.</p> <p><input id="Button1" type="button" value="OK" runat="server"/></p> </div> </ErrorTemplate> </atlas:ScriptManager>
Play around with it, you'll find more things to use i'm sure.
2: Adding a UpdatePanel
An UpdatePanel is pretty much a content-wrapper that will allow you to reload parts of the page (AJAX styled content refreshing instead of reloading an entire page) so let's look at that one. First up, we need to wrap our area with the tags.
<atlas:UpdatePanel ID="UpdateExample" runat="server" Mode="Always"> <ContentTemplate> <div id="Div1"> </div> </ContentTemplate> </atlas:UpdatePanel> Now, let's add a nice looking UpdateProgress as well to show that something's going on when it loads
<atlas:UpdatePanel ID="UpdateExample" runat="server" Mode="Always"> <ContentTemplate> <div id="Div1"> <atlas:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <div id="Div2"> <asp:Image ID="Image2" runat="server" ImageUrl="/images/loading2.gif" GenerateEmptyAlternateText="True" AlternateText="Loading.." /> </div> </ProgressTemplate> </atlas:UpdateProgress> </div> </ContentTemplate> </atlas:UpdatePanel> 3: Refreshing the content
It's nice to have the possibility to update content on the page, but unless we actually activate it there's no point, so let's add an automated update of the content using a TimerControl.
<atlas:TimerControl ID="tcExample" runat="server" Interval="10000" Enabled="true" OnTick="tcExample_Tick"> </atlas:TimerControl> Next we need to add the tick event to the UpdatePanel so that it knows when to update itself. This is done using a Trigger that we'll connect to the Tick event of the newly created TimerControl. Add the following code within the UpdatePanel section:
<Triggers> <atlas:ControlEventTrigger ControlID="tcExample" EventName="Tick" /> </Triggers> 4: Defining what to refresh/update
Well, now that we have automated updating partially set up, let's add something to actually refresh/update. For this example we'll use an image (simple, i know, but it's just for example purposes). Add the following image tag within the <ContentTemplate> section of the UpdatePanel
<asp:Image id="ExampleImage" runat="server"/> 5: The code so far
Now, if you've followed the steps above somewhat down each line your page should look something like this:
<atlas:ScriptManager ID="MyScriptManager" runat="server" EnablePartialRendering="true"> <ErrorTemplate> <div style="width: 450px; height: 300px; padding: 10px; border: solid 1px black; background: gray; text-align: left;"> <h1>Site error detected</h1> <p>An unhandled exception with the following message has occured on the server:</p> <p><span id="errorMessageLabel" runat="server"></span></p> <p>We're sorry for any trouble this has caused you and will fix the problem as soon as possible.</p> <p><input id="okButton" type="button" value="OK" runat="server"/></p> </div> </ErrorTemplate> </atlas:ScriptManager> <atlas:UpdatePanel ID="UpdateExample" runat="server" Mode="Always"> <ContentTemplate> <atlas:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="/images/loading2.gif" GenerateEmptyAlternateText="True" AlternateText="Loading.." /> </ProgressTemplate> </atlas:UpdateProgress> <asp:Image id="ExampleImage" runat="server"/> </ContentTemplate> <Triggers> <atlas:ControlEventTrigger ControlID="tcExample" EventName="Tick" /> </Triggers> </atlas:UpdatePanel> <atlas:TimerControl ID="tcExample" runat="server" Interval="10000" Enabled="true" OnTick="tcExample_Tick"> </atlas:TimerControl> 6: Adding the final code
Almost done now, just one thing left, and that's to add the actual code we use behind the scenes. For this example i've used a simple sitecore structure to attach images to an existing item Sitecore - Content -- Home --- AtlasExample ---- Image 1 ---- Image 2 ---- Image Whatever ---- ...
The template that holds the images simply holds a Image field named "image", nothing more. The reason for having them located under one item is just for easy access through sitecore.
In the code we're gonna be using a ItemCollection and IEnumerator to move through the items and get the content.
protected static System.Collections.IEnumerator images; protected static ItemCollection imageItems;
First up, load the content into the collection when the page is first loaded:
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { InitColl(); } } protected void InitColl() { if (Sitecore.Context.Item.HasChildren) { imageItems = new ItemCollection(); Item imageFolder = Sitecore.Context.Item.Children["AtlasExample"]; if (imageFolder!=null) { foreach (Item itm in imageFolder.Children) { imageItems.Add(itm); } images = imageItems.GetEnumerator(); SelectNextImage(); } else { this.ExampleImage.Visible = false; Sitecore.Context.ClientPage.ClientResponse.Refresh(this.ExampleImage); } } } protected void SelectNextImage() { if (imageItems!=null) { if (imageItems.Count>0) { if (images != null) { if (!images.MoveNext()) { images.Reset(); images.MoveNext(); } Item next = (Item)images.Current; Sitecore.Data.Fields.ImageField image = (Sitecore.Data.Fields.ImageField)next.Fields["image"]; this.ExampleImage.ImageUrl = "~/media library/Images/" + image.Src; this.ExampleImage.AlternateText = "AtlasExample"; } } } } Next, add the tick event that we stated in the TimerControl earlier.
protected void tcExample_Tick(object sender, EventArgs e) { SelectNextImage(); }
Now go ahead and build it and watch the results on your site.
8: Moving on
As you can see extending a site, even a sitecore powered one, with "Atlas" is really a piece of cake and is there for everyone's taking. Check out the Atlas control toolkit and the samples there for more details on how to extend with "Atlas" using custom extenders.
Further reading:
- Roadmap to ASP.NET "Atlas" Documentation and Resources: http://atlas.asp.net/docs/Default.aspx
- "Atlas" Control Toolkit: http://atlas.asp.net/default.aspx?tabid=47&subtabid=477
- Scott Guthrie's blog: http://weblogs.asp.net/scottgu/default.aspx
Take care, and have fun!
P.
Tuesday, September 19, 2006
Atlas loves Sitecore
Friday, September 15, 2006
Bugs?
- Create a template
- Add a Link field
- Save
- Create an Item based on the newly created template
- Try to add a external link using the link field
Notice that the dialog that opens up is in fact the dialog for Internal Link?
Hopefully this'll get fixed, or is already fixed perhaps?
UPDATE:
Keeping an eye open proves to be priceless at times, and this time i'm soooo proven wrong (the dropdown to the right, on the side of "insert link" includes the option to add a external link). Well, you live and learn. There's no bug what-so-ever, i'm the bug :)
P.
Wednesday, September 13, 2006
Sitecore 5.3
For those of you with access to sdn5 and curiosity to satisfy, run on over there and download it..UPDATE: Well, the installer works better than before, but i still hope they will add the option to specify the prefix when installing on SQL, 'cause if they don't it'll be a pain to install on a server with existing solutions.. That's it for now, P.