Sitecore ECM Opened emails not registered on Azure CD server

November 24, 2013 at 11:22 AMVicent Galiana
Sitecore Azure module 2.0 has an error on the default transformation code of Content delivery farms. In fact, Sitecore Azure module 3.0 inherited the same error in the Global web config patch. When you combine this error with ECM, the result is that you don't get opened emails information when you set up your base url to your CD servers. Why? Becaouse the functionality to register this "event" uses your "Content database", and it is not available. If we have a look at the transformation fields (or patch fields), we´ll find this section: <xsl:template match="sitecore/sites/site[@content='master']/@content"> <xsl:attribute name="value">web</xsl:attribute> </xsl:template> Looks fine right? This changes the content database of any site from master to web, exactly what we need. Are you sure? The result of this transformation is site name="xxx" value="web" So, how can we fix the problem? <xsl:template match="sitecore/sites/site[@content='master']/@content"> <xsl:attribute name="content">web</xsl:attribute> </xsl:template> As easy as that. replace "value" by "content", save, upgrade files and problem fixed, now you can see who opened your emails. This error is not only related to ECM, as this will break any site using the Content Database.

Posted in: SiteCore | SiteCore ECM - Email Campaign manager

Tags: , , , , ,

Big Sitecore Links table / IDs in targetitempath

November 24, 2013 at 11:07 AMVicent Galiana
Do you have these symptoms in your site? The link table (Usually in the core database) is too big, even bigger than your master or web databases There are not paths for target item in the link database for your multilist fields, only IDs Then you´re affected by this problem: Due to a bug in sitecore, it was storing the value of the property in the (table) field targetitempath, instead of the actual path. Here you have different solutions: Contact support and reference ticket 398330 or fix 309475 Wait until sitecore release a new version including the fix Fix it yourself. To fix it yourself Truncate your link table Download this zip file and copy files to your solution. This file contains a new fieldtypes.config, based on a default version, so if you have done any modification to your fieldtypes.config, you´ll have to modify it manually. Rebuild the link tabase. If you are curious and want to have a look to the code and changes, I’ve created a small solution with the original code from Sitecore and the code introduced by support. You can get it from here My History with this problem We´re hosting our application in Azure with Azure SQL. By default I limited the databases to 10GB. One day I found the site was down, due to “reached quota” of the database. I found my core database was 10gb (and maybe bigger if I wouldn’t have it limited). After contacting support and sending them our database, they found the problem and provide us the usual hotfix to solve the problem. The fix worked like a charm. Here you have some number to show how “big the bug is” Data before applying the hotfix: 552.894 items = 1.55GB Data after applying the hotfix: 411.627 items = 0.26GB

Posted in: SiteCore

Tags:

Find out why your sitecore azure upgrade is failing with errors

October 3, 2013 at 2:15 PMVicent Galiana
Is your upgrade failing? You don't know why? This could be your answer... [More]

Posted in: Azure | SiteCore

Tags: , , ,

Enable security during the dispatchnewsletter Pipeline of Sitecore ECM

October 3, 2013 at 12:48 PMVicent Galiana
Are you struggling to verify security during the Dispatch newsletter pipeline? Are you using the securityswitcher, but security is not applied? Find out why! [More]

Posted in: SiteCore | SiteCore ECM - Email Campaign manager

Tags: , ,

Using real sizes (px) in the rich text editor (RTE) of sitecore

September 19, 2013 at 10:34 PMVicent Galiana
Hot to change the default drop down for font size, for another with "real" pixels [More]

Posted in: SiteCore

Tags: , , , ,

Enable Ifilters on a Sitecore farm on Azure

April 25, 2013 at 3:18 PMVicent Galiana
learn how to enable Ifilters on Sitecore Azure [More]

Posted in: Azure | SiteCore

Tags:

Enabling Sitecore log files on Azure PaaS

April 24, 2013 at 5:00 PMVicent Galiana
As we commented on previous post the default configuration of the Sitecore Azure module 2.0 moves the log files to table storage. We agree with this solution, as it's the best practice for Azure, but sometimes, it's easier to catch your bug, if you've the usual log files, even if you installed our ClearPeople Azure log viewer, by example is sitecore wants the logs of the last two days (Our ClearPeople Azure log Viewer will support this functionality shortly), so... what about sending the logs to table storage, but saving them to log files at same time? It's easy, open your deplument item in the content tree and edit the field "WebConfigPatch" find the text. Find the log4net section and add this text under the Azure appender: <appender name="LogFileAppender" type="log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging">      <file value="$(dataFolder)/logs/log.{{date}}.txt"/>      <appendToFile value="true"/>      <layout type="log4net.Layout.PatternLayout">        <conversionPattern value="%4t %d{{ABSOLUTE}} %-5p %m%n"/>      </layout>    </appender> This is the standard appender, nothing new. Now, find the text "<appender-ref ref="AzureAppender" />" and add the next line under it: <appender-ref ref="LogFileAppender" /> That's it, you just configured the appender and told the engine to us both, so it will write to table storare and log file. In order to apply these changes properly, you need to "upgrade files" on your farm.

Posted in: Azure | SiteCore

Tags:

Enabling remote desktop on Sitecore farms on Azure PaaS

April 23, 2013 at 11:21 PMVicent Galiana
The first thing you need is to set up the service configuration file to load the "Remote desktop service". Doing it with the sitecore azure module 2.0 is easy; navigate to the item /sitecore/system/Settings/Azure/Environments/Your environment/your farm Edit the field service definition. Under the imports sections of the webrole, add these lines: <Import moduleName="RemoteAccess" /> <Import moduleName="RemoteForwarder" /> Now your service is able to execute the remote desktop, but now you need to configure how to run it. The first thing you need is a certificate, if you don't have a proper certificate, you can create one with IIS, following these steps Next, export the certificate using the Export option of IIS. Create and write down your password. Once you have the certificate, upload it to your cloud service following this guide. Yes, you're right, you need to deploy first without remote desktop to create the Cloud service and then, upgrade files in order to enable remote desktop. Once the certificate is uploaded, the certificate manager will show you a thumbprint. Copy it to some temp file, you'll need it. Now it's time to update the field "Service configuration: Under the configurationsettings of the role, add these three lines: <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" /> <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="yourusername" /> Don't forget to change the username!The next line is used to specify the password of your remote desktop user, but this password must be encrypted first. You'll find how to do it here. Remember to use the thumbprint saved before.So, now, you can add the next line under the settings: <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value=youreallylongencryptedpassword" />And the last line you've to add to your settings is, the expiry date for your user: <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2029-12-31T23:59:59.0000000-08:00" />We're almost there... Time to tell your service to use the certificate previously uploaded:Under the <instances> section, add the next line:<Certificates> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="yourthumbprint" thumbprintAlgorithm="sha1" /></Certificates> So this is it, now, "upgrade files" on your farm, and after the transitioning, you'll be able to connect to your VM. How?Connect to the azure manager, select your cloud service, go to instances tab, select one, and check the bottom of the page, you'll see a "Connect" button. Click it and it will download an rdp file to connect to your VM.Keep in mind you're not an administrator with full rights, and things are not always we're you expect...      

Posted in: Azure | SiteCore

Tags:

Reviewing Sitecore logs on Azure. ClearPeople Azure Log Viewer Module

April 23, 2013 at 4:14 PMVicent Galiana
When you use the Module Sitecore Azure 2.0 to move your Sitecore web site to Azure, you lose the log files and the old log viewer become useless. This module bring the logs back to Sitecore backend. [More]

Posted in: Azure | SiteCore

Tags: , ,

Filtering and analyzing sitecore logs

April 9, 2013 at 11:59 PMVicent Galiana
How to filter sitecore 6.6 logs including the full date with log parser lizard [More]

Posted in: SiteCore

Tags: ,

SiteCore Reports

June 5, 2012 at 8:34 PMVicent Galiana
We can find a good, free and Open Source reporting framework, ready to install on the SiteCore Shared Source Modules, called Advanced System Reporter. Project website: http://trac.sitecore.net/AdvancedSystemReporter Download link: http://trac.sitecore.net/AdvancedSystemReporter/browser/Trunk/data/packages/Advanced%20System%20Reporter-1.4.2.zip?format=raw Copying from the project documentation, ASR is a little framework which allows creating many types of reports in very short time. This module provides this framework together with many useful example reports (23): Get the Alias of an Item Audit users Actions Find broken links Find broken link in publishable items Expired media items Item History Items with invalid names Items with security for an account Links Locked Items Login errors Logged In users Multiple Versions My owned Items Not recently modified Orphaned media assets Owners of items Workflow history Items recently modified Search with regular Expression (regex) Renderings Stale workflow items (Items in a workflow status for a long time) Validation Errors Let's explain how this module work, configuring a scheduled task, to send one email with the modified items during last week: Install the module You'll find a SiteCore ready to use module at the download link, so you just need to run the installation Wizard (SiteCore Desktop), upload the zip, and follow the wizard to the end. Keep in mind, that according to the project documentation, this module needs Sitecore CMS V6.0, v.6.4.1, v.6.5 Setup and test By default, you'll find a link to the application under main menu à All Applications à Reporter. This tool, let us configure, run, export and save previously generated reports. We're going to use the report "Recently modified", so we click on the Open button (Upper left corner), and select the appropriated item. We've to choose the root item, usually "content\home", and since we want to get the modified items. That's all. Now just press "Run" on the window top menu bar, and "voilà", we get our list of modified items. If you're and admin, it is possible to export all that valuable information as csv, xls (an html file, but with Excel extension), or xml, clicking on the button "Export". If you want to allow to all users to export the reports, you must install this package. Once our report is ready, we only have to save it, so it can be run, with our selecting the parameter values manually. But what happened behind the scene? By default, all the preconfigured items are stored under "/sitecore/system/Modules/ASR/Reports". Now, the application have saved our "report" as a child of the "/sitecore/system/Modules/ASR/Reports/Recently Modified", using the template "/sitecore/templates/System/ASR/Saved Report". So, what we've saved is not a report, are a "report parameter set", associated to a report. Set up the task to be done by the scheduler Now, we need a specific item to be executed by the scheduler. The ASR, come with a template to simplify this task, under "/sitecore/templates/System/ASR/Report Email Task". So, let's select the commands foder under "/sitecore/system/Tasks", right click and "Insert à Insert from template", on the next windows, we've to choose the mentioned item "/sitecore/templates/System/ASR/Report Email Task". We must fill the fields under the "report Email section". Active: If the report must be executed To, Subject and text: The properties of the email to be send. Send if empty. By default, the application won't send the email, if after running the report, it return 0 items. If you want to send the email anyway, mark this option. Report. Here we can choose all the reports we need on the same email. Notice, here will only opera "Saved Reports". It make sense, because you can't run reports without parameters. Save, and the task is ready. Schedule the task The specific ASR steps are done, now, we only need to set up and default SiteCore Schedule Item. Select the "Schedules" folder under "/sitecore/system/Tasks/Schedules", right click à Insert à Insert Schedule. On the Command field, choose the command created in the prior step. On the Schedule field, we set up when to run the command. This field is a bit estrange: Let's explain it with an example: the value: ||127|23:59:59 Each "|", is a separator; the first value, blank in this case, is the first day to run the task in yyyyMMdd format. The second is the last day. Again blank in this case, it means, the task will be executed undefinitively. The third one is the day of the week, 127 means every day. Why? 1=Sunday, 2=Monday, 4=Tuesday, 8=Wednesday, 16=Thursday, 32=Friday, and 64=Saturday, so everyday =1+2+4+8+16+32+64=127, and fourth parameter is the minimum interval between invocations. 23:59:59, means one a day. Obvisuly, the report will not be executed at exactly the same time every day, but is the best approach we've. If we try to user 24:00:00, the system will translate it 00:00:00, so the task will be executed every second. You can read more about scheduled task on SiteCore here That's all, SiteCore will run the report and send the result via email, once a day. Advanced configuration At this point, you could have realized that our report will send us the mail with the modified items since some specific day, we select in the 3, but what if we want the items modified "yesterday" or last week? Well, it is possible too. We've to modify the "Saved report", so let's go to "/sitecore/system/Modules/ASR/Reports/Recently Modified", and click on the item created on step 3. There's only on field, with all the parameters of the report separated by the character "^". Find the parameter AgeISO and replace the value for one of these variables: •$sc_lastyear •$sc_lastweek •$sc_lastmonth •$sc_yesterday •$sc_today •$sc_now A framework, Why? The application come with 23 preconfigured reports, but we can create as many records as we want, adding filters, parameters, scanners, viewers, etc., so we have the tools to create, easly our own custom report. How to do this? well, maybe on the next post. Some reports are not working, why?! First, check your logs, and look for something like "WARN ASR: cannot assign value to property…". If you find this error, you're lucky. These errors are easy to solve. The module is using SiteCore utilities to set the attributes of the different configuration items as filters, scanners, etc. Those elements have the assembly, class and attributes, configured on SiteCore fields for this purpose. If you open the filter /sitecore/system/Modules/ASR/Configuration/Filters/Audit, you'll see the field "Attributes", with this value: "verb={Verb}|user={User}" This means that the code is going to try to set the attribute "verb" and the attribute "user", of one object of type "AuditFilter" (namespace: ASR.Reports.Logs), but if you check the code (Downloading the code, or with some Decompiler as "Telerik just decompile"), you'll see that this type, have two properties: "Verb" and "User". So, as you can expect, the method "Sitecore.Reflection.ReflectionUtil.SetProperty", is not able to find the property "verb" and "user". The solution: edit the attributes field in the sitecore item, change the first letter of the parameters to uppercase and save. You'll report will run properly now.

Posted in: SiteCore

Tags: , ,

Windows PowerShell and SiteCore PowerShell Console

June 5, 2012 at 8:28 PMVicent Galiana
The Windows PowerShell The Windows PowerShell is as task-based command-line shell and scripting language (We'll, not everybody agree: Windows power shell is not a scripting language). There are two main differences with common "shells": Is built on the top of the .Net framework. The use of the framework is not limited to internal use only, in fact, as a developer, (or as a "scripter" you can manipulate real .net objects, and the results, parameters, etc. are objects too, when usually others shell use strings. It is based on providers to access different data stores. A data store can be the file system, windows registry, databases, WMI, etc... It means you can access and manipulate them using the same cmdlets (pronounced command-lets) There are lots of blogs and documents about Windows PowerShell on the need, but here you have some useful links for newbies: Wikipedia: Better than expected The Microsoft documentation So, what's this module? This module gives us two main things: The SiteCore powershell provider. That let us access sitecore items, using standard powershell cmdlets (commands) A Sitecore application simulating a PowerShell system console, to run our scripts inside Sitecore Desktop. Installing the module The module can be downloaded from the sitecore trac as an installable package, so you only need to follow the usual SiteCore steps to install it. If you don't know how, you can find them here. Once the package is installed you'll fin a link to the console in the Desktop menu. Security Issues As we could expect, this tool will do some low level operations that our application pool's user may don't have access to. This tool use two files allocated in "AppDomainAppPath\Console\Assets" to set up the default view of some SiteCore types, but by default, the power shell environment is configured to don't allow the access to this file, so will see some security warning on your console. Reading "PowerShell's Security Guiding Principles" you'll learn it deeply, but, fur our porpoise, you must know that the default execution policy is "restricted", it means only typed commands can be executed or in other words, any script file can be executed. So we need to change it, to allow the load of these two files. The process is easy, as you can read here, you just need to change the Execution policy to "RemoteSigned" (Run all local script and Signed external scripts) with the command "–setexecutionpolicy remotesigned". But if you execute this command you'll see that your application pool user doesn't have enough rights to do this (You are not running your application as an admin, isn't?). My first option was to run this command as an administrator on the default Windows powershell console, but after executing successfully the command, and checking the "get-executionpolicy" command, I keep having the same warnings, so I had to change the identity of the application pool, run the script on the Sitecore PowerShell console" and undo the changes on the app pool. I don't like this solution, due to for a short time, you're running your website with full access to the computer, so any idea is welcome. Executing scripts We have to option to run scripts: Executing scripts on the console This is the easiest way, just open the console, and type or paste you cmdlets on the bottom of the screen and press CTRL+INTRO. The result will be displayed above. Executing script as scheduled tasks This's a great feature, that let you scheduled that great script you've generated and tested on the console. I could explain how to do it, but it won't be better than the module's author. But as a resume, you only have to create a script item under "core:/sitecore/content/Applications/PowerShell Console/Scripts", and create a schedule item, using the command "/sitecore/system/Tasks/Commands/PowerShellScriptCommand" created during the installation, and your Script item. Really easy! Generating scripts Now is time to begin playing with it. Maybe the first thing you should do is have a quick reading of some tutorial. I've found some good tutortials at http://www.powershellpro.com like: How to us cmdlets Managing variables. Conditional logic. Loops. Another good idea could be try Power GUI, o good, free IDE for Power shell scripts, with syntax highlight, "intellisense", and a large etc. Modifications On my first tests, I was not able to use the get-item command, finally decided to download the code and debug the module and I found a null object reference. So I modified the code to check the object, before using it. On the file Trunk\Shell\Provider\PsSitecoreItemProvider.cs Line 296: Before: if (dic["Language"].IsSet After: if (dic!= null && dic["Language"].IsSet) Line 302: Before: if (dic["Version"].IsSet) After: if (dic != null && dic["Version"].IsSet) I made another modification to get some messages: On the file Trunk\Shell\Host\ScriptingHostUserInterface.cs, line 38: Before: var lastline = Output[Output.Count - 1]; After: var lastline = Output[Output.Count > 0 ? Output.Count - 1 : 0]; Sample scripts Most of the samples, have been taken from the module author's website: http://blog.najmanowicz.com/ Get item from master database get-item master:\content\home Get item from web database get-item web:\content\home Get children of an item get-childitem web:\content\home Get all the children of an item (recursive) get-childitem–recurse web:\content\home Choose with properties display of an item Get-Item master:\content\Home | Select-Object DisplayName, TemplateName See: http://technet.microsoft.com/en-us/library/dd315291.aspx Show output as a table get-childitem-recurse master:\\content | format-table Name, "__Updated By", TemplateName See: http://technet.microsoft.com/en-us/library/dd315255.aspx Order items Get-ChildItem master:\content\home-recurse | Sort-ObjectId-Descending | select-object name, TemplateName See: http://technet.microsoft.com/en-us/library/dd347688.aspx Find all the properties and methods of and item Get-Item master:\content\home | Get-Member See: http://technet.microsoft.com/en-us/library/ee176854.aspx Set the current item cd master:\content\home Remember the scope of this command is the execution of the current script Get the current item Get-item . Get the list of Sitecore caches and status Get-cache Get a list of archives on every database Get-archive Get a list of databases Get-database (database name) Get a user specific user get-user sitecore\admin get a list of indexes get-index (index name) get a list on search indexes get-searchindex Publish an item get-item master:\content\home | publish-item Optional parameters of publis-item Path Id -recurse Targets Languages Publishmode Currentpathinfo Restart the current application Restart-application Set the PowerShell window properties Options -persist ForegroundColor BackgroundColor HostWidth Posible colors: System.ConsoleColor( Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White   set-hostproperty -BackgroundColor "blue"; set-hostproperty -ForegroundColor "red"; get-item master:\content\home; Using .net Objects [Sitecore.DateUtil]::FormatIsoDate($_.__Updated) Show calculated properties get-childitem-recurse master:\\content | format-table Name, "__Updated By" , @{Label="Modified"; Expression={ [Sitecore.DateUtil]::FormatIsoDate($_.__Updated) } } Filter items get-childitem-recurse master:\\content | where-object {[DateTime]::Now.Subtract([Sitecore.DateUtil]::IsoDateToDateTime($_."__Updated")).Days-lt 5} | format-table Name, "__Updated By" , @{Label="Modified"; Expression={ [Sitecore.DateUtil]::FormatIsoDate($_.__Updated) } } Create a new item new-item-path"master:\content\home\testscript2" -Type "master:\templates\Sample\Sample Item"; Modify a filtered list of items foreach ($iinget-childitem-recurse master:\\content | where-object {[DateTime]::Now.Subtract([Sitecore.DateUtil]::IsoDateToDateTime($_."__Updated")).Days-lt 5}) {     $i.BeginEdit();     $i.Name =$i.Name +" "+"test";     $i.EndEdit(); } Change the template of an item I've try lots of combinations, but didn't find the way of make it work One sample is this: http://www.techphoria414.com/Blog/Change-Item-Templates-With-Sitecore-PowerShell.aspx My problem is always the same, I'm not able to get the template item, it is always null.

Posted in: SiteCore

Tags: , ,