When trying to generate a key in order to add an esternal data store to my Sharepoint 2010 farm, I came across the following error:

An error occurred during the “Generate Key” process. Please try again or contact your administrator.

Searching on the web I found that this can be caused by a few different issues.

  1. The account you’re logged in as is not in the Farm Administrators group.
  2. Your Sharepoint Foundation Web Application is stopped on your front ends.

In my case however, it was neither of these issues. I finally ran across a blog post for a different error that suggested you open the Properties window for the Secure Store Service Application (Go to Central Admin -> Application Management -> Manage Service Applications -> Secure Store Service, then click the properties button in the ribbon), and simply click OK without making any changes. What this does is “rebuild” the service account. Once I did that, I ran into the permissions error (#1 above), but I just logged into my app server as the sharepoint service account and all was good. I was then able to generate my key.

 

Had  weird problem using the Cutesoft AjaxUploader this week. Everything was working fine on my development box but when moving it to my server, everything fell apart. What happened was that every time I would upload a file, I’d get a dialog box that contained the HTML of the page!

Weird. Here’s how I solved it.

I must say before I get to the real solution that I found a CRAPLOAD of stuff about having to make entries in the Web.Config for AJAX to work on IIS7. This is all crap, at least for my issue. So you might not want to waste a bunch of time messing with that. The real problem had two layers.

First, AjaxUploader does not work when running in the default page on the site. So if you are using a Default.aspx page, make sure the URL redirects to http://example.com/Default.aspx and DOES NOT simply use http://example.com. Without that page name at the end of the URL, it will not work.

Secondly, when compiling the app and using the publishing feature of VS2010 to publish the server, the ajaxuploader.lic file does not get copied up to the bin folder. To fix this, click the file in VS2010, then set the Build Actdion in Properties to Content. Then it will get copied to the server.

That’s all it took to fix this. Unfortunately it took me the better part of 2 days to find the solution.

 

We’re in the process of upgrading our SP2007 farm to a sp2010 installation. We’ve had a TON of problems getting there, one of them being the sad performance of running our front end in a VM. In order to ferret out some problems I decided to install a new front end on a physical box to compare performance with the VM.

When trying to install, I had several problems, and didn’t find any good answers online. Here’s some solutions to the problems I ran into:

My first problem was simply getting the same software on the new front end. It has to be exact to any other front ends before the configuration wizard will work. I had an issue where the software was complaining about some missing language packs on my local box. Turns out I used the installer that had SP2010 SP1 included. Well, this installer is a piece of crap. The solution is to uninstall SP2010, then use the standard SP2010 installer, THEN install SP1 separately, and finally install the latest CU hot fix.

The other problem I had was really obvious, but by searching the net, I found that a lot of us are being tripped up by obvious problems. The problem was that I could not connect to my database when running the configuration wizard. I checked all sorts of networking stuff, firewall, account permissions, etc before realizing that I was only entering the server name, when I should have been entering servername\instancename. Aye!

 

I ran up against a unique issue this week. I have an EntityDataSource control bound to a DataView control. I also have a search form with about 10 fields the user can populate to search for data, which is then shown in the DataView.

the problem I had was that I needed the Where statement on the EntityDataSource to be set programmatically. The reason is because when you use multiple controls to populate the Where statement, the EntityDataSource control automatically uses “OR” between the various search fields. So you get a eSQL statement like this:


WHERE name = 'jim' OR phone = '5551212'

So what if you need to do an AND? Or worse, what if you need to do some logic where you use OR or AND depending on how some other field is set? Well, then you have to set the Where statement in your code behind. The problem is, the only place I found it would work is if I set it in the EntityDataSource.Load event.

OK, so why is that a problem? Well, if you set it in the Load event, the control gets refreshed on every single page refresh. Normally, ViewState is used, but you are now overwriting that with every page load. This presents a huge problem when doing Deletes.

When doing a Delete, the EntityDataSource will normally dip into the ViewState, retrieve the previously retrieved Entity, then delete it. However, since we’re doing a new query on every page load, that ViewState is trashed. So when you delete, you now have a new set of data, and the EntityDataSource doesn’t know which record to delete and will throw an error.

So what do do? Well, I discovered after MUCH playing around that the easiest way to delete my record was to simply catch the RowCommand event on the DataGrid. Do that by making your delete button a template, bind your record id to the CommandArgument of the control, then catch the RowCommand event of the grid.

Then in the RowCommand event in hyour code behind, you can use the id stored in the CommandArguments to grab the correct record from the Entity Framework, and delete it.

There’s one more thing you need to do though. You’ll need to set EnableDelet on your EntityDataSource to FALSE. Then, catch the  RowDeleting event of the GridView and set the GridViewDeleteEventArgs.Cancel parameter to TRUE. That will keep your EntityDataSource from trying to delete the record you just deleted.

Yes, that seems like quite a round about way to get what I needed, but I didn’t see any other way around it. This is one of the problems with these canned data controls. They are very powerful, but all have limitations.

Hope this helps.

Windows Software Sucks

 Comments Off
Jan 072012
 

I know that’s harsh, but honestly, it’s true. Windows software sucks.

I’ve been 100% Mac for a few years now and have gotten spoiled by so many super sleek, fantastic pieces of software. Most of them free because the open source community on the Mac is thriving and the ones I have paid for are really cheap. But lately I’ve been using Windows 7 a lot for work and for some web projects I have going on and while I think Windows 7 is a pretty good OS, the options for software just suck.

The open source stuff is much more rare, with most free software being riddled with ads and nag screens.  And most of it is hideous looking. Try and find some decent optons for mail programs or RSS readers, etc and you’re just faced with clunky complex garbage that looks at least 10 years old. And then I go to download Paint.NET which is supposed to be really good and I come face to face with this piece of trash of a website (right).

See all those download buttons? None of them download Paint.NET. For some reason they download Gimp and some PDF creator. WHY?? OK, this is a web site and not a Windows program, but it’s the same design mindset I see in Windows software as well. It’s clunky, it’s cluttered, and it’s confusing.

So I have to wonder why Windows software sucks so bad? I think a lot of it has to do with the fact that there are probably 10 times more developers, and 10 times less designers working with Windows. I think also that Microsoft has done an awful job of setting the standards for thier software.  It’s really hard to make ugly Mac software because the controls are so great looking to begin with. Micrsosoft Win forms controls on the other hand are just horrid. I’m not sure what it would take to make really good looking, animated controls for Windows, but I think that’s going to be my next pet project.

There are exceptions though. I think Office is a pretty good set of software. Adobe products look relatively good and when I used to write my music on Windows I always liked the Cakewalk products like Sonar. But by and large, there just aren’t many really slick looking pieces of software out there to be had.

It’s a shame.

 

It’s been a weird week for technology in my house. I bought a new Vizio 47″ LCD the other day to replace my 15 year old Sony tube TV. Right after hooking it up, I noticed the remote on my Roku box became very unreliable. I switched the batteries, etc, with no luck.

After much fiddling and finally scouring the web for answers, it turns out that my Vizio could be emitting infra-red light that is interfering with the remote signals. The fix: turn off adaptive backlighting on the Vizio. Now honestly, I’m not even sure what adaptive backlighting is or does. To me the picture looks exactly the same. But now my Roku works again.

 

Discovered something odd today. I’m home sick so I was just going around updating my machines and stuff and I decided to update the firmware in my Cisco wireless router since it had not been updated since I bought the unit. Normally I won’t touch a firmware unless it specifically addresses a problem I’m having, but like I said, I’m home sick and was bored so I decided to update it.

Well, right after I did the update I noticed that my internet speeds had slowed to a crawl. I normally get 25Mbps easy and now I was getting around 1Mpsc. Yes, ONE. I was super pissed off and cursing Comcast when I decided to do some deeper troubleshooting before calling them and sitting on hold for hours. I pulled the router off of my network and plugged straight into my cable modem and my speed was restored!

After messing with various configurations I found that the firmware had somehow affected wi-fi performance. Performance while wired to the router via ethernet was fine. A quick search on the net returned a bunch of discussion threads about this problem.

The fix is to simply disable the WMM feature of the router. Now, that’s a sucky fix, especially if you use devices that take advantage of WMM, but it’s the only fix available right now. Hopefully Cisco will repatch the firmware and correct this soon.

Jul 192011
 

Our new site went live last week and though everyone likes it, immediate I started getting requests for changes. Such is the life of a web developer. One of the requests was to change our Find a Physician link. When you click on that link, it takes you to a search page which has three tabs. These three tabs correspond to our three main hospitals and you can search for physicians who practice at each facility. Originally we envisioned one search and then a filter on facility, but since our data is stored in very different backend databases, we felt it was best to provide a tabbed interface to three searches to make the experience more uniform and not feel like we are three different companies. (though sometimes we act like it).

The complaint from our marketing folks was that when you click the Find a Physician button, you are taken to the search page, but our Clovis facility search is always the default selection. This is because the tabs are ordered alphabetically. This becomes a problem though because if a user is on the Fresno Heart page, and they click Find a Physician, they are by default searching for Clovis and not Heart physicians. If they don’t notice the tab has changed, they will be looking for doctors from the wrong facility. What we want is for somebody browsing Fresno Heart’s section to automatically be taken to the Heart physician search.

So how do we accomodate this? I determined there were two solutions. One way would be to write some server side code to examine the menu trail and determine where the user is browsing from and then dynamically update the Find a Physician link. This would work just fine, but it’s kind of complex and would require writing a custom module. The second way would be to change the link dynamically on the client side. This was the easier and quicker solution and this is how I accomplished it.

First, we use the Context module extensively. Context lets you do all sorts of things to Drupal based on various parameters. When I planned the site I already had three contexts set up, one for each facility. What my Contexts do is examine the current location of the user and then apply a class to the BODY tag that denotes which facility section the user is in. Since that was already done, I turned to jQuery for the rest.

I wrote three short lines of javascript, one for each facility, that simply look for a menu with a certain id. In this case, that’s my Find a Physician link. I then change the url that link points to based on the class Context places into my page. Here’s the jQuery code.

1 2 3 4
// Dynamic Physician Search button
$('.crmc a#find_a_physician').attr ('href','/crmc-physicians');
$('.ccmc a#find_a_physician').attr('href','/physicians');
$('.fhsh a#find_a_physician').attr('href','/fhsh-physicians');
view raw gistfile1.js This Gist brought to you by GitHub.

And that’s it. 10 minutes of code/testing and I was able to accomodate the request.

 

New site is LIVE!

 Comments Off
Jul 142011
 

Well, after a year of work, our new Drupal powered site is live. It’s been an incredible learning experience and I feel that compared to our old site, this thing ROCKS. The exciting thing is now that we have a great platform to build on, there’s no limits to what we can make the site do. Check it out at the link below.

http://communitymedical.org

Jul 072011
 

We own a wilcard cert for our servers at work. However, the server that issued the cert request was an IIS server. So I needed to figure out how to convert that cert to work with Apache. Here’s what I found. The following examples are on an Ubuntu 10.4 server running Apache 2.x.

The first step is to export your cert from the IIS box. This is the most ridiculous process so I’ll cover it in detail.

  1. Login to the server
  2. Click START->Run, type in mmc and hit enter
  3. When the MMC opens, click the Console menu and then Add/Remove Snap-In
  4. Click the Add button, and then select Certificates from the dialog and click Add.
  5. in the next dialog, select Computer Account and click Next
  6. Select Local Computer and click Finish. Close out the remaining dialogs.
  7. Now, in the tree click down to Certificates->Personal->Certificates
  8. Select the certificate on the right you wish to export. Right click and select All Tasks->Export
  9. Select Yes Export the Private Key, click Next
  10. Do not include the certificates in the certification path
  11. Disable Strong Protection. I honestly don’t know if this is necessary, but it sounds like it’s a Microsoft thing. Click Next.
  12. Type a password that you won’t forget. Click Next.
  13. Choose a place to save the file. Click Next.
  14. Click Finish

Now, copy that sucker over to your unix box. We need to convert this file into a useful format. So, from a Unix command line, execute the following command obviously substituting the name of your pfx file:

1
openssl pkcs12 -in mypkcs12.pfx -out pfxoutput.txt -nodes

Now we need to split this file into seperate key and crt files. So grab your favorite text editor and open that sucker up. You should see two major blocks of garbage text. Select the section of the file that contains the private key and paste it into another file that ends with .key. The section will look something like this:

1 2 3
-----BEGIN RSA PRIVATE KEY-----
<<< bunch of garbage text here >>>
-----END RSA PRIVATE KEY-----
view raw gistfile1.txt This Gist brought to you by GitHub.

Then do the same thing for the certficate text and name it with a .crt extension. It will look like this:

1 2 3
-----BEGIN CERTIFICATE-----
<<< bunch of garbage text here >>>
-----END CERTIFICATE-----
view raw gistfile1.txt This Gist brought to you by GitHub.

We’ll need one more file and that is a bundle file that contains intermediate certificates provided by your certificate authority. If you have no idea what I’m talking about head on over to the website of your certificate authority and see if they have one you can download. We use Comodo and they had a bundle all set up for download. Copy that up to your server along with the other files. We’ll move them into place next.

So now we need to place the certs where Apache can find them. They can go anywhere but I installed them into two directories:

  • I put the bundle and my .crt file in /etc/ssl/ssl.crt
  • I put the .key file in /etc/ssl/ssl.key

Next we will configure apache. The first step is to configure the ports.conf file. This file is probably located in /etc/apache2. Add the following line to this file. If you have a block that checks for mod_ssl, put it in there like so:

1 2 3 4
<IfModule mod_ssl.c>
NameVirtualHost 172.16.0.1:443
Listen 443
</IfModule>
view raw gistfile1.txt This Gist brought to you by GitHub.

Now head over to your site configuration file. Mine is located in /etc/apache2/sites-available. Duplicate the entire VirtualHost block and then edit the new block as follows:

  • Change the port from :80 to :443
  • Add the SSL parameters (there are four of them all starting with SSL in this example), making sure to substitute the correct paths and filenames for the files we created at the start of this tutorial. In this example you will see my complete config file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<VirtualHost 172.16.0.1:80>
ServerAdmin webmaster@mydomain.org
ServerName mydomain.org
ServerAlias www.mydomain.org
DocumentRoot /srv/www/mydomain.org/public_html/
ErrorLog /srv/www/mydomain.org/logs/error.log
CustomLog /srv/www/mydomain.org/logs/access.log combined
Options -Indexes
</VirtualHost>
<VirtualHost 172.16.0.1:443>
SSLEngine On
SSLCertificateFile /etc/ssl/ssl.crt/mydomain.org.crt
SSLCertificateKeyFile /etc/ssl/ssl.key/mydomain.org.key
SSLCertificateChainFile /etc/ssl/ssl.crt/mydomain.org.ca-bundle
ServerAdmin webmaster@mydomain.org
ServerName mydomain.org
ServerAlias www.mydomain.org
DocumentRoot /srv/www/mydomain.org/public_html/
ErrorLog /srv/www/mydomain.org/logs/error.log
CustomLog /srv/www/mydomain.org/logs/access.log combined
Options -Indexes
</VirtualHost>
view raw gistfile1.txt This Gist brought to you by GitHub.

OK, so the last thing you need to do is enable the mod_ssl module in Apache or all of this work was done for nothing. Excecute the following commands.

1 2
sudo a2enmod ssl
sudo service apache2 restart

And that should do it! You should now be able to browse your site using HTTPS://. If you have any corrections or additional hints, please leave a comment.

 

 

© 2012 64 Square Feet Suffusion theme by Sayontan Sinha