Tuesday, 31 May 2011

Cookies Law and how it affects you

Taken from a Waterstons press release:
----

Cookies Law and how it affects you


The laws governing privacy and the use of cookies are changing. So what's changing and how do you ensure your website is compliant with the changes?


In 2003, the Privacy and Electronic Communications Regulations required that websites using cookies for storing information, informed people of how the website uses cookies and advised them how to 'opt out' if they objected to the uses defined. The most common method to satisfy these requirements was to add detailed information to a site’s Privacy Policy and give people information on how to disable cookies within their browser.


From 26th May 2011 the Privacy and Electronic Communications Regulations will require websites that use cookies to ask users to ‘opt in’ to allow the storage of cookies on their pc, mobile device, tablet etc. This is instead of simply providing information in a website’s Privacy Policy about the use of cookies and how to disable them in common browsers.


What actions you can take


The Information Commissioner’s Office has advised that website owners should make a list of all cookies and similar technologies being used on your website and how they are used. For each one, determine how intrusive that method is, i.e. does the information track people’s habits on your site, and is the information used by third parties?


You will then need to decide which method of obtaining consent will give people the best experience on your site and fulfil your requirements. Methods include pop-up windows or requiring users to accept Terms and Conditions before they use your website.


Exceptions to the rule


This rule applies to all cookies in use on a website unless the cookie is "strictly necessary" for a service requested by a user, for example, a cookie used to maintain the contents of a Shopping Basket; however the details of these cookies and their use should still be detailed in a website’s privacy policy. An example of a cookie which would not qualify under these criteria would be those created if your website uses an analytics service.


The main message within these changes is to be transparent about how your website functions. The challenge is gaining consent from all those who visit your site, be they registered members of your services or general visitors. As website owners you will not want to alienate people from using your website and services, but instead empower them to make the correct decisions.


More Information


For more information, please refer to the Information Commissioner’s Office guide





For a bit of commentary on the situation, I'd highly recommend taking a look at Andrew Westgarth's "Cookies Law: Ah the Irony!

Tuesday, 15 February 2011

Lookups in InfoPath when you don't want the dropdown value

Sometimes you want to get a value based on a dropdown, but not actually the value in the ID column. For example, I have a list of project roles as below













RoleIdNameValue
1Consultant15
2Senior Consultant20


Here I want a dropdown listing "Consultant" and "Senior Consultant". I need the. I then want to retrieve the corresponding value for use in a calculation. If you try this straight off, you will find that you always get the value first item from the list. This is because the context of which node you want is confused. To provide the "correct" context, you probably want an XPath query like below



../../../my:Roles/my:Role/my:RoleSaleValue[../my:RoleID = current()/../my:TaskRole]


More information can be found in this rather nice article. http://blogs.msdn.com/b/infopath/archive/2004/09/13/228881.aspx

Wednesday, 26 January 2011

Visual Studio Achievements

Visual Studio Achievements....I think I'm going to have to implement this one...

http://blog.whiletrue.com/2011/01/what-if-visual-studio-had-achievements/

Tuesday, 1 September 2009

Using Trusted Connections in Web Applications under SharePoint Server

Microsoft really try to hammer home the concept of using trusted connections in web.config files, such as



<connectionStrings>
<add name="MyDbConn1"
connectionString="Server=MyServer;Database=MyDb;Trusted_Connection=Yes;"/>
<add name="MyDbConn2"
connectionString="Initial Catalog=MyDb;Data Source=MyServer;Integrated Security=SSPI;"/>
</connectionStrings>


They will also mention that you do not need impersonation on for this to work, only that the identity account for the application pool has the required access to the SQL server (normally making this account a managed domain service account). This is despite many inccorrect postings on news groups saying you must have impersonation on (people never read the scenario)

However, there is one gotcha when playing your web application underneath a currently existing .NET application. If your top level website has



<identity impersonate="true">


then you will need to put



<identity impersonate="false">


into your own web.config to override (or override in another way, this worked best for me). This is the scenario you will face with WSS or MOSS, as all the sites attempt to impersonate the current user.

Friday, 1 May 2009

SSRS 2008 SharePoint Integrated Mode Issues -

I've finally found time to look at SSRS 2008 and how it improves the integration mode for SharePoint. As usual, I had a new pain setting it up.

My setup:

  • MOSS 2007 and SSRS 2008 installed on vmsp-01
  • SQL Server 2008 installed on vmsql-01



There are several reasons for getting the following message:


An unexpected error occurred while connecting to the report server. Verify
that the report server is available and configured for SharePoint integrated
mode

The main reason for getting this error will be that you have configured Reporting Services in Central Administration to point at a localhost URL. However you might have checked all your settings (as I had) and been fairly sure they were right. Mine were as below





Now, as this was testing, the url is not in DNS (and to be honest, I've no intention of cluttering DNS with another record). I'd modified the hosts file to point at this.

What you might find at this point is that you can access the URL from external machines (with the right host headers in the hosts file), but you cannot access the url from the server itself. You've fallen foul of "as designed. If you cannot connect to any *windows authenticated* URL hosted on the server from the server itself, and you are receiving the error message above, then it is the loopback adapter that is at fault. As the SharePoint server makes the second request to retrieve data from the reporting server it makes no difference if you can access the reporting server url correctly from a client machine


Disabling the loopback adapter solves the problem. I think that having a DNS record probably fixes this issue too, but I've not checked for sure.


Installing SSRS for SharePoint Integrated Mode
Disabling Loopback Adapter in Windows Server 2003 R2 and Windows Server 2008/Vista

Wednesday, 31 December 2008

Deploying multiple SSIS Packages from Development to Live Environments

This is as much a reminder for myself as a reference for others ;)

There are several ways of deploying SSIS dtsx packages under SQL 2005, but I like this one the best. It allows almost "one touch" style deployment of an entire project of packages. It makes use of package configurations. You may find you need to make several changes to every package in your solution, but you'll only need to do it once.

Once it's done you can copy your packages from DEV to LIVE without having to worry about different locations and connection strings in your live environment


Setting up your DEV and LIVE environments

  1. Create a new database on your database server, I've called mine SSISConfig. Don't add anything to it, BI Studio will do that for us.


  2. Create a new environment variable on each machine. I've called mine DW_CONFIG.

    Start -> (right click) My Computer -> Properties -> Advanced -> Environment variables -> New

    give this variable a value that points to what will become your configuration database (where all other csv file locations, excel connection strings etc will be stored). For Example, my database is called SSISConfig:

    Provider=SQLNCLI.1;Data Source=dur-vmdevolap-01;Integrated Security=SSPI;Initial Catalog=SSISConfig

    Note that your changes won't take effect until you restart. You can see what is in effect by opening a cmd window and typing

    SET

    You can make temporary changes that will be immediately effective by using

    SET DW_Config=SQLNCLI.1;Data Source=dur-vmdevolap-01;Integrated Security=SSPI;Initial Catalog=SSISConfig

Setting up your SSIS Packages

  1. Open your DTSX project using BI Studio / VS 2005
    Go to project Properties -> Deployment Utility -> Create deployment Utility

    Set the value to true


  2. In the "Data Sources" folder of your project, create a datasource pointing at your SSISConfig database as it is found on DEV. It's also a good opportunity to create a Data Source object for each database system your packages might connect to.

  3. Open each package in turn and:

  4. Create a new connection under Connection Managers. Select the "New connection from data source" option, select your SSISConfig data source

  5. Right click on the design surface and select "Package Configurations" (you may have to enable them first)

  6. Add a new package configuration, select "Environment Variable", and provide the value "DW_Config"
  7. Now add another package configuration, select "SQL Server", choose the connection "SSISConfig", press the "new" option beside Configuration table and use the defaults. For "Configuration Filter" use a name that uniquely identifies this configuration parameter (eq "DataWarehouse Connection String"). Press next, then select the property you wish add to the configuration (normally "Connection String")


When making these changes to further packages, be sure to reuse the same "Configuration Filter" value when you conceptually mean the same thing. It will ask if you wish to "reuse" or "overwrite". Choose reuse.

Once you are finished, inspect the results of your work by running

USE SSISConfig
SELECT * FROM SSIS Configurations


You should see your configuration entries. Backup and restore this database to your live server, then change the data in the "ConfiguredValue" column to represent the locations/connections that exist on the live system.

Deploying Changes to LIVE

Build your package, copy the resultant .bin/Deployment folder to your live SQL Server (with SSIS on). Double click the file with the ".SSISDeploymentManifest" extension. The SSIS Wizard will load the files and validate them for you. It will also warn you if it can't find the files/environment variables listed in package configuration. Once this is complete you can execute your new SSIS packages.

Friday, 16 May 2008

BDC - I just wanna connect!

Using the Business Data Catalogue (BDC to the cool) is still quite painful, and all the articles I've seen cut straight to clever "best practice" methods such as Single Sign On and Passthrough authentication. Sometimes though you just want to connect to the BDC using standard SQL Server credentials. The key is the ridiculously named "RevertToSelf" authentication mode. Below is a snippet you can use, simply replace the connection details with valid ones. This should allow you to test everything out much more simply, and allow you to diagnose your problems with SSO etc in good time.


- <LobSystemInstance Name="TestInstance">
- <Properties>
<Property Name="DatabaseAccessProvider" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider">SqlServer</Property>
<Property Name="AuthenticationMode" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAuthenticationMode">RevertToSelf</Property>
<Property Name="RdbConnection Data Source" Type="System.String">w2k3moss</Property>
<Property Name="RdbConnection Initial Catalog" Type="System.String">QTest</Property>
<Property Name="RdbConnection Integrated Security" Type="System.String">false</Property>
<Property Name="RdbConnection Pooling" Type="System.String">false</Property>
<Property Name="RdbConnection User ID" Type="System.String">myaccount</Property>
<Property Name="RdbConnection Password" Type="System.String">mypassword</Property>
</Properties>
</LobSystemInstance>