luni, septembrie 11, 2006

Blog with SharePoint

Brain dump:

Today I got an idea that I can create a blog using the SharePoint Issues list.

When the main user creates a blog entry, they are creating another record into the issues list. When other users comment on the blog, then they are revising the head-user's blog entry, substituting their own values for the comments field. The original post remains in the description field.

You can muck about with it using some javascript capturing of the edit form and the submit button event.

Then, create the main view similar to the history view you are so fond of. Oh, historical view, I have no historical view post here? I will have to make one.

I will experiment with this idea and post my results here as soon as I can.


Wow, I guess it is at this point that I am a blogger. Wow.

HomeSite+ Color Coding

You can back up your color coding schemes or save them to transfer the settings to another computer. All color coding customizations are stored in the registry. Found here: HKEY_CURRENT_USER\Software\Allaire\HomeSite45\CustomParserSettings or HKEY_CURRENT_USER\Software\Macromedia\HomeSite5\CustomParserSettings

  1. Start Run type in "regedit"
  2. Browse to HKEY_CURRENT_USER\Software\Macromedia\HomeSite5\CustomParserSettings
  3. Select the CustomParserSettings folder
  4. Then select from the top menu bar Registry Export Registry Key
  5. Name it and save it to a place you will remember (DeskTop) as a .reg file.
  6. If you are copying these settings to a different computer, then copy that file over to that computer.
  7. Install HomeSite if it was not already installed.
  8. After installation, double click on the reg file, it will automatically update your registry and restore your color coloring customizations.
(These instructions were written by Dan Zarella, Allaire Customer Support, in this thread.)

sâmbătă, septembrie 09, 2006

BlogStickr

Oh, cool little things.

http://www.blogstickr.com

luni, august 21, 2006

HomeSite + Crashes + Frozen + not responding

You use HomeSite sometimes, eh? HomeSite has a little problem that is really annoying. Don't get me wrong, I love HomeSite. I use it all the time. But sometimes when I am working on files in my dev environment, using HomeSite's FTP and RDS features, I press Save and ZAP! Frozen.

More annoying than that is whatever file you were trying to save has been overwritten on the server by a BLANK FILE! Shutting down HomeSite using Task Manager is pretty much your only option. But then you lose the file forever, and it may be a file that you have been debugging all day or for the last n hours, and you need this file and it's completely GONE. 0kb, the server tells you. What now?

Luckily, HomeSite keeps a backup of your work. Well, kind of. When you notice that HomeSite is frozen, DO NOT end the program using Task Manager. Let it sit frozen while you do this:

1. Search for a file called 'filename000.ext', substituting your file name instead, so if you were working on index.php or default.asp, you will search your computer for a file called 'index000.php' or 'default000.asp'. [Those are ZEROs, not letter Os.]

2. Open that file, and save it to your desktop or somewhere safe.

3. Use TaskManager and close HomeSite.

4. Re-open HomeSite.

5. Re-Open the file on the server that is now shockingly 0kb. [zero kb]

6. Open the safe copy of the file, and copy all of the code over.

7. Save again. Rinse, repeat (and you may have to repeat!).

That is all.

marți, iunie 13, 2006

Ophogus Quote Nuggets

"Everything is so important that it has to be done now now now, but not important enough to spend money to pay for resources to accomplish the least important of the most important tasks."

-Ophogus

Distinct Items from SharePoint List

I have recently had a need to display a list of distinct items. Perhaps you have the same need, and so I will share with you how to do it.

  • Open your view in FrontPage.
  • From the Data menu, select Insert Web Part.
  • Right-Click the web-part and select Convert to XSLT Data View.
  • If the Manage View Settings is not displayed, right-click your webpart and select Data View Properties.
  • Click Sort & Group.
  • Remove all fields from the sort order column, and add the field you want to display the distinct list of. I have an issues list, and I want 'Status'.
  • Select Show Group Header and Hide Group Details, then click OK.
  • Now, you have a (very ugly) distinct item list.
Edit it and make it beautiful.

You can mix and match items to make very powerful solutions. Mix this Distinct Item technique with the Conditional Formatting Woes Solved technique and the QueryString Parameter technique, you will do something that very few people have done in SharePoint (that I know of anyway):

  1. Display the distinct items list on your page.
  2. On the same page, place a web part that has a view which is filtered using a QueryString parameter.
  3. Use Conditional Formatting, and instead of formatting list values as images, format them as URLs to pass to the view.
Using my Issues list, I now have an issues list, with a list of distinct statuses, formatted as links to filter the view by each status.

If I get enought comments on this idea, I will post step by step, because formatting the distinct values as an href is kinda tricky.

Conditional Formatting FrontPage Memory Woes Solved

My previous post was complaining that memory was taxed to the max when the page you are editing in FrontPage has lots of conditional formatting. And by 'lots' I mean, about 40 or so (doesn't sound like much, does it?).

Anyway, I have abandoned the use of conditional formatting when I have to display an image, as exampled in my previous post. (Can't find it? Search for 'Nuclear' on my blog to get to it.)

This is how to avoid it:

For each status, have an image. One image for each status, each image the same size (otherwise the layout of your page might jump around a bit, I dunno, maybe that is what you want).

For me, I am using the issues list, and if we go by defaults (who does THAT anyway?), we see that there are 'Active', 'Resolved', and 'Closed' statuses for issues, and I have one image for each status:

  • CFActivebig.gif
  • CFResolvedbig.gif
  • CFClosedbig.gif
Note that the status name MUST appear in the image name, and the image names must conform to some standard naming convention that you can just make up. For me, I am using CF[status]big.gif as my naming convention because CF means that this is a conditional formatting image, and big means that it is the big image. (I plan on creating another view with tiny images representing each status as well, so I put the size into the naming convention.) My active image is a 100px wide by 20px high red image, Resolved is yellow, and closed is green. The images are just colored 100px by 20px rectangles.
  1. Open your view in FrontPage.
  2. Convert the view to XSLT Data View.
  3. Place the 'status' field where you want to display the image.
  4. Right-click one of the status names and choose 'Format Item As...', then choose 'Picture'.
  5. You will get a broken image, that's ok.
  6. Type 'ddd' next to the image (so that you can find the code that renders it).
  7. Go into code view.
  8. Type [ctrl]+F and search for 'ddd'.
  9. Change src="{@Status}" to src="CF{@Status}big.gif".
  10. Delete 'ddd' appearing just after the img tag.
  11. Upload your images to the list directory (or put them into the images directory, and map like this - Change src="{@Status}" to src="../../images/CF{@Status}big.gif".
You can now use this new-found knowledge to create your own, very complex conditional formatting projects without crashing your computer. And, on top of that, it is much easier to maintain. Think about things like what would happen if later in your project you wanted to put pictures of people who are users of the site, or picture of the person that the issue was assigned to, or all of the above in the same view.

vineri, iunie 09, 2006

Frontpage vs CPU vs Conditional Formatting

Oh, man this is really tough. Anyone else out there have this problem?

I have a view that has 42 conditional formatting possibilities, based on the web part data. When I load the page in FrontPage, in design view, FrontPage starts eating up all my memory and page file resources. Craps out my system entirely.

Most of the conditional formatting takes the status or category of some item and displaying an image based on the data in the item. For example, I have an issue list that has a status field with five or six different statuses, and using conditional formatting to display an icon (picture) on the screen indicating the status of the item.

I am displaying a big green button for 'On Plan' status, big yellow button for 'Caution' status, a big orange button for 'Concern' status, and a big red button for 'Worry' status, and of course, the obligatory nuclear explosion animated gif for 'OMG' status.

Each button has a different look based on the priority or severity of the issue.

Sounds like fun, eh? Not really.

And I have a solution - I shall post it sometime in the near future.

Filter List View with URL Parameter

Ok so I have tons of lists where I am tired of making a new view for every little John Doe and Jane Whatsherface that wants a new filtered view based upon the same list. There are a couple of references out there, but they are listed under some other search terms and hard to find using Google. Sharepoint would be completely useless to me if I didn't have google there, every step of the way bringing SharePoint hackers tips and tricks my way.

Anyway, on to the meat of this post:

  1. Open the page for the view you want to filter in FrontPage
  2. In design view convert the list view to XSLT (right-click, select Convert to XSLT Data View)
  3. Go into Code View (or use the Split view).
  4. Find ([CTRL-F]) the code: ParameterBinding Name="filterParam"
  5. Note that it says "Postback;Connection;" in the 'Location' field.
  6. Change the location to "Postback;Connection;QueryString(ID)" (This is case sensitive!)
  7. Note that you put "ID" as the QueryString variable. You could have just as easily put "Category" or "Subject".
  8. Go back into design view.
  9. Right-click the web part and select Data View Properties.
  10. In the 'Manage View Settings' window, click Filter.
  11. Under 'Field Name', choose the field in your web-part that you want to filter. As far as I know, it must match exactly with the name of the QueryString variable.
  12. Under 'Comparison', choose the method you want to filter by.
  13. Under 'Value', you must choose [Input Parameter].
Now, you can formulate URLs to pass a parameter to your view and filter that view based upon that parameter. Fun stuff.

Sample URL to pass the ID parameter: http://mysiteURL/subsite/lists/viewname.aspx?ID=4

Sample URL to pass a Category parameter: http://mysiteURL/subsite/lists/viewname.aspx?Category=Monkeys%20On%20Crack

Remember that once you apply the filter in Frontpage (steps 10 through 13), FrontPage will no longer display any of your data because FrontPage does not simulate any QueryString Variables. So, you need to make all your design/cosmetic changes in FrontPage prior to doing steps 10 through 13 above.

(Hint hint - Microsoft - you need to make it so that the FrontPage design view can simulate form inupt or QueryString Input so that we can see the data we would be working with if we had those filters in place!)

I have not tested passing two variables using this method. Maybe someday, although I have heard that passing two QueryString variables to a web-part is not possible. We'll see about that.

-------------------------
UPDATE: 01/31/2007:

I have passed multiple parameters!

Postback;Connection;QueryString(ID);QueryString(FirstName);QueryString(Lastname)

Note: to filter people, SP2003 likes FirstName^LastName (where ^ is a space), not ID or username.

I have a view that uses this method to filtering in all peoples who are on a project. I have a project list where people1, people2, people3 are assigned as people working on it. I have a link from the contact page like this:

http://teams.example.com/sites/QA/Lists/Regression/productivity.aspx?QATestera={@FirstName}%20{@Title}&QATesterb={@FirstName}%20{@Title}&QATesterc={@FirstName}%20{@Title}&QATesterd={@FirstName}%20{@Title}&Assigned%20To={@FirstName}%20{@Title}&ProjectManager={@FirstName}%20{@Title}

Well, I listed @Title as their last name, stupid, but oh well 'Dog with three legs doesn't make a good tripod' as we say.

Use these to filter like this:
Current = YES
Status NOT EQ COMPLETE

Then, group these user-lookup fields together:
QATestera = [Input Parameter] or
QATesterb = [Input Parameter] or
QATesterc = [Input Parameter] or
QATesterd = [Input Parameter] or
Assigned To = [Input Parameter] or

This will give you a list of projects that that user has anything to do with, not matter what the role. Just make sure to pass the role through the URL and pass it to the filter and parameterbinding.

miercuri, iunie 07, 2006

Export To Spreadsheet Woes

As you know, I have personalized my SharPoint site so dramatically, It no longer contains any original 'Out Of The Box' design elelments. As such, I would have liked to place a link somewhere on my page to export the list to a spreadsheet. This functionality is contained in the code:

%3Csharepoint%3Arelatedtasks+runat%3D%22server%22%3E

which provides all of the related taks, including exporting the list to a spreadsheet.

I do not want all of the other actions at this time, although, I am sure I will be needing to provide links to these items someday as well:

  • Add to My Links
  • View Reports
  • Alert Me
  • Export to spreadsheet
  • Modify Settings and Columns
Anyway, the primary focus of this article is how to get the export to spreadsheet function to do what I want it to do without having all that other stuff around.

The first thing I tried (don't laugh, it might have worked if it weren't for those meddling kids), was:
  1. Using the 'Out of The Box' AllItems.aspx template and clicked on the 'Export to spreadsheet' link
  2. Opening the list in Excel and saving a local copy.
  3. Upload my local copy to a document library
  4. Providing a link to the Excel file that I just uploaded into the document library and hoping for the best.
Needless to say, this didn't work because the list was not linked to the Excel file (hey - it was worth a go). So right-clicking the excel data did not provide the needed 'Synchronize with Sharepoint' option that I so desparately needed.

Then, I tried modifying the code as such:

%3Csharepoint%3Arelatedtasks+runat%3D%22server%22+list%3D%22JFHG837T%2D7629%2D438A%2DB7F3%2D92784GFH784G%22%3E

Which seemed to work, however, once the list was opened in Excel, only the ID field was displayed.

So, I opened the 'Out of The Box' AllItems.aspx template in ie and viewed the source.

This looked promising:

%3Ca+accesskey%3D%22P%22+id%3D%22diidIOExportToSpreadsheet%22+href%3D%22javascript%3A%22+onclick%3D%22%22+cs%3D%22109%26Using%3D%22+iqy%3D%22%22+list%3D%22%7B%3C%2Fspan%22%3E%3Cspan+style%3D%22font%2Dfamily%3Acourier+new%3B%22%3EJFHG837T%2D7629%2D438A%2DB7F3%2D92784GFH784G%3C%2Fspan%3E%3C%2Fa%3E%3C%2Fspan%3E%3Cspan+style%3D%22font%2Dsize%3A85%25%3B%22%3E%3Cspan+style%3D%22font%2Dfamily%3Acourier+new%3B%22%3E%3Ca+accesskey%3D%22P%22+id%3D%22diidIOExportToSpreadsheet%22+href%3D%22javascript%3A%22+onclick%3D%22%22+cs%3D%22109%26amp%3BUsing%3D%22+iqy%3D%22%22+list%3D%22%7B%3C%2Fspan%22%3E%7D+%26View%3D%7BH8UG5T6E%2D7625%2DJ92S%2DH7J8%2DMDXMQU8YT7UL%7D+%26amp%3Bamp%3Bamp%3BRootFolder%3D%26CacheControl%3D1%27%29%3Bjavascript%3Areturn+false%3B%22%3EExport+to+spreadsheet%3C%2Fa%3E

However, using that code only provided the ID field from my list, not all fields from my list, again. Removing the View Querystring was the answer, so now I have:

%3Ca+accesskey%3D%22P%22+id%3D%22diidIOExportToSpreadsheet%22+href%3D%22javascript%3A%22+onclick%3D%22%22+cs%3D%22109%26Using%3D%22+iqy%3D%22%22+list%3D%22%7B%3C%2Fspan%22%3E%3Cspan+style%3D%22font%2Dfamily%3Acourier+new%3B%22%3EJFHG837T%2D7629%2D438A%2DB7F3%2D92784GFH784G%3C%2Fspan%3E%3C%2Fa%3E%3C%2Fspan%3E%3Cspan+style%3D%22font%2Dsize%3A85%25%3B%22%3E%3Cspan+style%3D%22font%2Dfamily%3Acourier+new%3B%22%3E%3Ca+accesskey%3D%22P%22+id%3D%22diidIOExportToSpreadsheet%22+href%3D%22javascript%3A%22+onclick%3D%22%22+cs%3D%22109%26amp%3BUsing%3D%22+iqy%3D%22%22+list%3D%22%7B%3C%2Fspan%22%3E%7D+%26View%3D%26amp%3Bamp%3Bamp%3BRootFolder%3D%26CacheControl%3D1%27%29%3Bjavascript%3Areturn+false%3B%22%3EExport+to+spreadsheet%3C%2Fa%3E

Which works!

luni, iunie 05, 2006

Sharepoint - DispForm.aspx, EditForm.aspx, NewForm.aspx

Ok, so here I am working along on my SharePoint list. I have this project list that I am using a SP 'Issue' type list for, because it keeps the historical information about what changes were made.

So, I decide that I am going to modify most of the views using FrontPage so that it no longer looks anything like a Sharepoint list. As you get to know me, you will realize that I absolutely dislike the SharePoint themes, and FrontPage themes. I need to make it look like what I want it to look like. ows.css is out too, or modified beyond all recognition.

Don't you love it when you right-click the list and "Customize SharePoint List Form" only to find that it has changed into what looks like a pool of question marks.

Anyway, my point is that I now know what it means to have worked on a list for so long, only to have lost it because you did something stupid and saved changes to 'DispForm.aspx', only to find out that it broke your whole list! How can one recorver DispForm.aspx? How can we restore DispForm.aspx?

Hopefully, you did not modify EditForm.aspx. If you did, you are almost SOL, but not quite. You can almost do the same thing using AddForm.aspx, however, you will not get the issue history like you can with EditForm.aspx.

Ok, so here is the solution:

  • Open EditForm.aspx
  • Right-click the list, (in design view), and select 'List Form Properties'
  • Enable 'Display item form (used to view list items)'
  • Save the file as 'DispForm.aspx' (or something else, if you like)

    This should recover your list.

Despre mine

Timi-Ostravia, Republic of Czedvia, Bulgaria
I make web applications. The tools I use are many and far between. I have been maining to learn Ruby and Python, and Perl. These tools are all like Lego to me. They can all be make to build things and have their strengths and weakest.