Friday, 5 December 2014

Recaptcha timeout issue solved

  protected bool GetCaptchaResponse()
        {
            bool isValidResponse = false;
            // Getting Proxy for Recaptcha
            if (Settings.GetSetting("webProxy") != null)
            {
                string proxyAdress = Settings.GetSetting("webProxy");
                if (!string.IsNullOrEmpty(proxyAdress))
                {
                    WebProxy webproxy = new WebProxy(proxyAdress);
                    recaptcha.Proxy = webproxy;
                }
            }

            Page.Validate();
            var IsValid = recaptcha.IsValid;
            var valid = Page.IsValid;

            if (IsValid && valid)
            {
                isValidResponse = true;
            }
            else
            {
                isValidResponse = false;
                lblResult.ForeColor = System.Drawing.Color.Red;
                lblResult.Text = "Verification words are incorrect.";
            }
            return isValidResponse;
        }

Thursday, 16 October 2014

Alias in Sitecore

We can create alias in sitecore.. The same can be found also in /sitecore/system/Aliases Please make sure to publish the alias.

 Without publishing it will not work. Alias are used for SEO and they are langauge independent 

Sitecore package installation options explained

The correct description of what each option does should be something like this:

Overwrite Items with the same ID (along with it's descendants) will be removed and replaced by items from the package.

Skip Items with the same ID from the target database will remain unchanged; the item from the package will be skipped.

Merge - Clear all existing versions for a language of the item being installed are removed prior to adding new versions. This options 'clears out' the versions of the language and creates one new version.

Merge - Append item versions from the package are added 'on-top' of the existing versions of the item. This preserves history, but numbers the package versions with numbers higher than the existing version numbers. A user can merge information between versions afterwards.


Merge - Merge if there is a version with the same number in the item, the Installation Wizard will overwrite it, otherwise a new version with the specific number is added. This makes it possible to replace specific versions of items. As you can see, the Merge-options doesn't remove items, but instead, merges versions of an item.

Monday, 22 September 2014

Monday, 15 September 2014

Error : Microsoft Visual Studio is unable to load this document: To design Integration Services packages in SQL Server Data Tools (SSDT). SSDT has to be installed by one of these editions of SQL Server 2012: Standard. Enterprise. Developer, or Evaluation. To install SSDT, run SQL Server Setup and select SQL Server Data Tools.

I was trying to open SSIS package but was getting error :

Microsoft Visual Studio is unable to load this document: To design Integration Services packages in SQL Server Data Tools (SSDT). SSDT has to be installed by one of these editions of SQL Server 2012: Standard. Enterprise. Developer, or Evaluation. To install SSDT, run SQL Server Setup and select SQL Server Data Tools.



Resolution:

I was able to fix this issue by installing a fresh instant  of ..

Microsoft SQL Server Data Tools - Business Intelligence for Visual Studio 2012


http://www.microsoft.com/en-us/download/details.aspx?id=36843

Friday, 29 August 2014

Copy file(s) from one project to another using post build event…VS2012

When we want to copy one project to another after post Build.

Select the project --> Properties --> Build Events

xcopy $(TargetDir)\*.* C:\inetpub\wwwroot\sitecorelearning\Website\bin\ /r /f /y

Here are some commonly used switches with xcopy:
/I - treat as a directory if copying multiple files
/Q - Do not display the files being copied.
/S - Copy subdirectories unless empty.
/E - Copy empty subdirectories.
/Y - Do not prompt for overwrite of existing files.
/R - Overwrite read only files.

More details can be found 
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

Recapcha Implementaions

Step1 : Download the Recapcah DLL From

https://code.google.com/p/recaptcha/downloads/list?q=label:aspnetlib-Latest

Add Reference to your solution..

Register assembly on your page

<%@ Register TagPrefix="recaptcha" Namespace="Recaptcha" Assembly="Recaptcha" %>

Add Basic Code

 <div>
            <asp:TextBox runat="server" ID="txtname" ValidationGroup="myGroup" />


            <asp:RequiredFieldValidator ID="rfvtxtname" ValidationGroup="myGroup" ControlToValidate="txtname" ErrorMessage="enter data"
                Display="Dynamic" runat="server" />

            <recaptcha:RecaptchaControl
                ID="recaptcha"
                runat="server"
                PublicKey="your key"
                PrivateKey="your key" />


            <asp:Button runat="server" ID="clickMe" Text="Click Me" ValidationGroup="myGroup" OnClick="clickMe_Click" />

            <asp:Label Visible="False" ID="lblResult" runat="server" />

        </div>


The code behind changes are like this


      const string CHALLENGE_FIELD_KEY = "recaptcha_challenge_field";
        const string RESPONSE_FIELD_KEY = "recaptcha_response_field";

        // Getting Proxy for Recaptcha
        if (ConfigurationManager.AppSettings["webProxy"] != null)
        {
            string proxyAdress = ConfigurationManager.AppSettings["webProxy"].ToString();
            if (!string.IsNullOrEmpty(proxyAdress))
            {
                WebProxy webproxy = new WebProxy(proxyAdress);
                recaptcha.Proxy = webproxy;
            }
        }


        var captchaChallengeValue = HttpContext.Current.Request.Form[CHALLENGE_FIELD_KEY];
        var captchaResponseValue = HttpContext.Current.Request.Form[RESPONSE_FIELD_KEY];

        var captchaValidtor = new Recaptcha.RecaptchaValidator
                                  {
                                      PrivateKey = "mykey",
                                      RemoteIP = HttpContext.Current.Request.UserHostAddress,
                                      Challenge = captchaChallengeValue,
                                      Response = captchaResponseValue
                                  };

        var recaptchaResponse = captchaValidtor.Validate();


        var IsValid = recaptchaResponse.IsValid;
        if (!IsValid)
        {
            lblResult.Text = recaptchaResponse.ErrorMessage;
        }

        Page.Validate("myGroup");

        if (Page.IsValid && IsValid)
        {
            lblResult.Text = "You Got It!";
            lblResult.ForeColor = System.Drawing.Color.Green;
        }
        else
        {    
            lblResult.ForeColor = System.Drawing.Color.Red;
        }







Thursday, 28 August 2014

Getting Started With Claim Based Authetication

he realm is the unique identifier of the application -- the identity that's sent to the STS when logging in. However, the audienceUris element is used to limit from what applications the token will be accepted.


Federation metadata

Federation metadata is an XML document that describes the STS: WS-Federation endpoint, which certificate is used to sign the token etc. Most STSs support this document format. The Identity and Access Tool specifies this document in the web.config as follows:







Very Basic Points for Pipeline & Processors


  • Pipelines define a sequence of processors that implement a function
  • Each processor in a pipeline contains a method named Process() that accepts a single argument and returns void.
  • A processor can abort the pipeline, preventing Sitecore from invoking subsequent processors.
  • The type of the argument to the Process() method may be of a type specific to the pipeline or the default Sitecore.Pipelines.PipelineArgs. 
  •  To create a pipeline processor, create a class that implements a method named Process() with the same signature as the other processors in the pipeline.
  •   Your processor can inherit from an existing processor, and you can add, remove, replace and rearrange processors in the pipelines to suit your requirements.
  •   

Thursday, 21 August 2014

Useful Code in order to Remove the Form based authentication Cookie..


       
        private static void ClearFormCookies()
        {
            var context = HttpContext.Current;
            if (context == null || context.Request.Browser == null)
                return;
            var strB = string.Empty;
            if (context.Request.Browser["supportsEmptyStringInCookieValue"] == "false")
                strB = "NoCookie";
            if (context.Request.Cookies[FormsAuthentication.FormsCookieName] != null && string.Compare(context.Request.Cookies[FormsAuthentication.FormsCookieName].Value, strB, System.StringComparison.OrdinalIgnoreCase) != 0)
                context.Request.Cookies[FormsAuthentication.FormsCookieName].Value = strB;
        }

Sitecore Admin Pages Explained

http://firebreaksice.com/sitecore-admin-pages-explained/

/sitecore/admin/cache.aspx

Database Browser

/sitecore/admin/dbbrowser.aspx 

Serialization

/sitecore/admin/serialization.aspx 

Show Config

/sitecore/admin/showconfig.aspx 

Size Status

/sitecore/admin/sizestatus.aspx

Stats


/sitecore/admin/stats.aspx


Unlock Admin

 /sitecore/admin/unlock_admin.aspx

Update Installation Wizard


/sitecore/admin/UpdateInstallationWizard.aspx 

Wednesday, 13 August 2014

Getting Object Null Reference Error while doing Login to Sitecore Sitecore.Web.Authentication.<>c__DisplayClass5.b__2(Ticket ticket) +52



http://briancaos.wordpress.com/2014/06/30/sitecore-web-authentication-c__displayclass5-b__2ticket-ticket-52/

This can happen if you:
  • Run update scripts (it happened for me when updating from Sitecore 7.1 to 7.2)
  • Have 2 Sitecore installations accessing the same database in:
    • Different .NET versions
    • Different Sitecore versions
To solve it, delete any SC_TICKET properties from the CORE database:
1
2
delete from [YourSitecore_Core].[dbo].[Properties]
where [key] = 'SC_TICKET';
Then restart your .NET application, and you should be fine again.

Monday, 11 August 2014

Getting Started With SOLR

Getting Started with Solr


·         Features

o   Hit highlighting
o   Auto correction
o   Faceted Search
o   Multi language support
o   Given Ranked Search Results aka Ranked Retrieval


·         Is
o   No Sql Technology
o   Provide fault tolerance using Solr cloud .
o   Built on Apache Lucene
o   Java Based
o   Open source
o   Need Java Servlet Engine like jetty tomcat jboss
o   Scalable
§  We can distribute indexing and query processing on separate server.
o   Ready to Deploy
o   Optimized          
§  Can handle millions of results
o   Stable
§  Many org still continues with old solr version
§   
o   Text Centric
o   Document Oriented
o   Given Ranked Search Results
o   Provide NRT
o   Read dominant
§  Created once but read multiple times
o   Can be access via http
o   Provides Admin console for Admins
o   Has Huge community of Users
o   rich document (e.g., Word, PDF) handling
o   Created
§  @ CNET Networks
§  When in 2004
§  By Yonik Seeley


·         Is not

o   Data storage or Data processing mechanism
o   Not like web search engine.
o   An alternative or replacement of Relational Sql
o   Provide parent child relation but does not support complex relation
o   Has nothing to deal with SEO
o   Solr can not provide authorization on Search Results
o   Does not provide UI Components for Search output.

·         Keywords

o   NoSQl : Not only Sql
o   NRT : Near Real time
o   SPOF: Single point of failure












Wednesday, 30 July 2014

How to Remove a sitecore instant

worth to read this artcile @
http://www.cmsbestpractices.com/sitecore-corrupted-instance-manual-uninstall/

Tuesday, 29 July 2014

How to Track active items in solution explorer

 Tools -> Options -> Projects and Solutions –> General 

Check the track active item in solution.


Configure the Visual studio in order to get the detailed Error Message

Go to
Tools -> Options -> Projects and Solutions -> Build and Run -> MS Build project build output verbosity

Screen Shot 2013-12-08 at 11.17.48 AM


http://jockstothecore.com/setting-up-a-sitecore-solution-part-1-visual-studio-and-projects/

Friday, 25 July 2014

AN ERROR CAUSED THE SITECORE INSTALLATION WIZARD TO END PREMATURELY”

Error1:  “an error caused the sitecore installation wizard to end prematurely”

While installing sitecore 7.2 in windows 8 along with IIS8 server I was getting the error “an error caused the sitecore installation wizard to end prematurely” while investigating further I found that the error comes while sitecore perform the following “enabling asp.net in iis”

When Google further

  1. On the Start page, click the Control Panel tile.
  2. In Control Panel, click Programs, and then click Turn Windows features on or off.
  3. In the Windows Features dialog box, click Internet Information Services to install the default features.
  4. Expand the Application Development Features node and click ASP.NET 4.5 to add the features that support ASP.NET. (If you installed .NET 3.5, select ASP.NET 3.5 also.)
The following additional features are automatically selected:
    • .NET Extensibility 4.5 
    • ISAPI Extensions 
    • ISAPI Filters 
    • .NET Extensibility 3.5 (If ASP.NET 3.5 was selected)
  1. Click OK to close the Windows Features dialog box.
  2. To verify that IIS installed successfully, type the following into a web browser:
http://localhost
The default IIS Welcome page is displayed.