Wednesday, May 2, 2012

Connect to multiple sub-sites in Data View Web Part 2010


Supporters of End User


Item is currently unrated. Press SHIFT+ENTER to rate this item.
Categories:SharePoint Designer; Data View Web Part; Site Manager/Power User; MOSS; WSS; 2010

You may also be interested in: Assigning SharePoint Column View Permissions by SharePointBoost


Editor's note: Contributor Kim Frehe is a SharePoint Solution Specialist at Rightpoint Consulting. Follow her @KimFrehe
In SharePoint 2007, the Data View Web part (DVWP) was all the rage. You could create complex views from multiple sites within in your site collection or other data sources and group, sort and format the data in a visually appealing and meaningful way.
SharePoint Designer 2007 made it easy for you to connect multiple lists on sub-sites with a handy little “Connect to another library…” link at the bottom of the data sources task pane. With all the improvements Microsoft has made with the Content Query Web Part, I was excited to use the DVWP as a sort of expanded version of information that I show in a CQWP. However, SharePoint Designer 2010 has gotten rid of the task pane and the handy little link that allows you to quickly connect data sources to display in the DVWP. Out of the box you can see your site’s document libraries and lists in the data sources.
So the question is, how do you combine data from multiple sub-sites to display in a consolidated list? For this example, I have 8 departments and each department has a sub-site. Each of these sub-sites has a “Goals” list that uses a global content type in a custom task list. I want to consolidate each department’s goals on the parent site to display a view the company-wide goals.
Inbar Cizar (@Cizi) does an excellent job of explaining how to add a sub-site’s list to your list of data sources in this post: http://blogs.microsoft.co.il/blogs/cizi/archive/2010/08/01/connect-to-another-library-in-sharepoint-designer-2010.aspx
Once you have added each of your department’s goals as a data source, you will need to create a “Linked Data Sources” and use this Linked Data Source in your Data View Web Part
2012-04-17-ConnectMutlipleSubsites-01.png
Then open an existing or create a new page (I used an .aspx page)
On the ribbon, click on the down arrow on the Data View button and select your Linked Data Source.
2012-04-17-ConnectMutlipleSubsites-02.png
From there you can add your columns, group, sort and modify the DVWP as needed.
NOTE:
Name your SOAP datasources carefully; you can use the name of the connection to group or sort a DVWP by the name of the sub-site, or whatever you call it. After the datasources have been connected as a Linked Source, any name changes are not reflected, so you will need to create a new Linked Source to reflect a name change.
Here are instructions to group the DVWP by the site name, which is what I named the SOAP Service datasource.
  1. Call your “SOAP Services” data source the name of your sub-site.
  2. Click on sort and Group
  3. Select “Add Sort Expression…”
  4. Select “agg:source”
2012-04-17-ConnectMutlipleSubsites-03.png

V5 Master Search Center


You may also be interested in: UserVersity lessons from Mindsharp


Editor's note: Contributor Matthew McDermott is a founder and director at Aptillon, Inc. Follow him @MatthewMcD
I am really enjoying learning about Responsive Web Design and happily applying this to my current client. There is a whole bunch of information available all over the web. Companies like Template Monster have begun to roll out some beautiful examples of templates focused on the concept. (They have some other cool free HTML5 designs too, they are not responsive though.)
In doing my research I found Kyle Schaeffer’s site and his V5 Responsive Master. I like the clean look, and as a starting page, it provides a good start. As a “search guy” the problem I find with most (if not all) Master Pages provided on the Web is that none that I have found address the Search Center. The authors stop short of a “complete branding solution” by simply rendering a home page and a few publishing pages. (Many I have found will not even render the other default publishing pages like Press Releases.) I don’t mean to be critical of Kyle’s work, I think he did a great job, I mean to call attention to the failure of designers in general who ignore (or just don’t know SharePoint well enough to pay attention to) the Search Center.

The Issue

It’s not their fault. The Search Center is a finicky site. Out of the box the Search Center uses “minimal.master”. Of course this causes the Search Center to have a different look and feel (and navigation) than the rest of the site. Since the Search Main page, Search Results page and People Search Results page all have different corresponding Page Layouts it becomes increasingly complicated to manage the branding for the site. These page layouts have some major flaws in their layout that have been present since the search center was initially introduced. For example the search box control is in the Breadcrumb placeholder control. This means that an unwitting designer who decides to remove the breadcrumb from the master page is inadvertently removing the search box from every search page.  My favorite evidence of this is if you apply “nightandday.master” to the search site the search box control vanishes. Click the breadcrumb folder in the menu and “Thar she blows!” See! This is even a challenge for the designers at Microsoft!
2012-04-20-v5MasterSearchCenter-01.png

The Solution

The resolution to the issue is actually quite simple. Have your designers plan to spend time designing the Search Center. Don’t create a unique master page for the Search Center. Create page layouts that work for the search center. That means either including the BreadCrumb placeholder or changing the Search Page Layouts (which is what I do because on a branding project we’re already creating a bunch of page layouts.) Here is what I do:
  1. Create a copy of the 3 Search Page Layouts: Search Main, Search Results and People Search Results (I prefixed them with “V5”.)
  2. For each page, check them it and add a comment to the top of the PlaceHolderMain content control like “<!– V5 Search Page –>”. Save the files.
  3. 2012-04-20-v5MasterSearchCenter-02.png
  4. Return to the Page Layouts folder and retitle each file so you can tell them apart from their out of the box counterpart. In SharePoint Designer I do this by clicking on the Title column for the file and prefixing it with “V5”.
  5. 2012-04-20-v5MasterSearchCenter-03.png
  6. Check all three files in and publish a major version.
  7. Now we just have to apply our new page layouts to the corresponding Search Center Pages. By default the Search Center only allows certain Page Layouts to be used. We have to add our Page Layouts to the approved list. Navigate to Site Settings | Page Layouts and Site Templates and locate the three new Page Layouts and move them to the “approved” side with the Add button.
  8. 2012-04-20-v5MasterSearchCenter-04.png
  9. Navigate to the search page, choose Edit and change the Page Layout to use your new V5 Page Layout. For the Search page choose “V5 Search Box”, for the results page “V5 Search Results” and the People Search Results page choose “V5 People search results”.
  10. 2012-04-20-v5MasterSearchCenter-05.png
  11. Save the changes to the page and Check it in.
  12. Nothing has changed, has it? View Source on each page and you should find your comment, if not you missed a step and there is no point in going further until you get this first part right. If you have the right changes for all three pages you are ready to proceed to actually making the changes necessary to “Respons-i-fy” your Search Center.
  13. 2012-04-20-v5MasterSearchCenter-06.png

Making the Search Center Responsive

The rest of the work is pure SharePoint Designer Page Layout work. At this point you can just create what is essentially a web part page and forget about all the rest of the markup. If you decide to reuse the base page layouts here are the high points (I’ll provide the files at the end):

Search Main

  1. Remove all of the UIVersion=”3” declarations. Were going to own this page. We don’t need version 3 (or 4 for that matter).
  2. Remove all the styling from PlaceHolderAdditionalPageHead and replace it with the necessary CSS to make the page work (see my files below).
  3. Remove the PlaceHolderPageTitleInTitleArea content (unless you like it…)
  4. Remove the Content control for SPNavigation. This is the cause of the doubled top navigation that you may be seeing. In the V5 master it contains a necessary publishing control.
  5. 2012-04-20-v5MasterSearchCenter-07.png
  6. Move the contents of the Content control PlaceHolderTitleBreadcrumb into the PlaceHolderMain content control. For the sake of this demo I just pasted it all in and did not change anything. In reality I would remove the tables in favor of divs and change the layout.
At this point I have whittled the page down to about 94 lines from the original 331. The end result is this:
2012-04-20-v5MasterSearchCenter-08.png
You will notice the duplicate Search Box. This is because the original V5 master page omitted the PlaceHolderSearchArea. If you add the Content Place Holder back to the master page you can achieve the effect of removing the top navigation search box while in the search center. Use code like this in the V5 Master Page:

1<div id="v5-search">
2  <!-- search -->
3  <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
4    <SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox" Version="4"/>
5  </asp:ContentPlaceHolder>
6</div>

Search Results

It’s pretty much the same process here. Start by getting the structure right then come back and style the web part XSL to work for the results if you need to.
  1. Remove the extra crud you don’t need. I remove all static web parts at this point. This significantly cuts down on the code for the page and enables me to focus on the page layout. I can always add them back later if I need to. (3696 lines whittled down to 89 lines.)
  2. Move the content from PlaceHolderTitleBreadcrumb to PlaceHolderMain.
  3. Remove everything from PlaceHolderAdditionalPageHead and replace it with the necessary CSS to override the styles.
At this point you should have a search center results page that looks like it belongs to your Web site.
2012-04-20-v5MasterSearchCenter-09.png

People Search

Of course we cannot forget about People search results! By now you should be able to recite the necessary changes. Repeat after me:
  1. Remove the extra crud you don’t need. (Including all of the static web parts and UIVersion=3 content.) I also clear the PlaceHolderPageTitleInTitleArea and other controls I know I won’t need. Your mileage may vary. My page is down to about 100 lines.
  2. Move the content from PlaceHolderTitleBreadcrumb to PlaceHolderMain.
  3. Remove everything from PlaceHolderAdditionalPageHead and replace it with the necessary CSS to override the styles. (Or link to a central CSS file.)
  4. Remove the SPNavigation content placeholder you don’t need the extra navigation.
Again, with a bit of work you should be able to get something that looks like it belongs on the site and is not an afterthought.
2012-04-20-v5MasterSearchCenter-10.png

Additional Tips

Keep in mind that the controls on the Search Pages are just Web Parts. So If you find that you are seeing double, you may have inadvertently created new instances of web parts on the page. Just edit the page and delete the extra web parts.
2012-04-20-v5MasterSearchCenter-11.png
You will spend most of your time troubleshooting the default SharePoint page rendering and styles. I hate this, but it’s the cost of playing in the SharePoint world. In these sample files I embedded all of the necessary CSS changes into the Page Layouts themselves, I would not do this in production. I would just create a new CSS file like “V5Search.css” and link each page layout to that file. I only used this technique here to show what overrides were necessary for each type of page. I rely heavily on Firebug and IE Developer Toolbar. If you have not used these tools now is the time to learn them.

Final Results

You have to design your site to suit your specific needs. I guarantee that the solution I present here will not work for 100% of you 100% of the time. This is just intended to show you that it is possible to include the Search Center in your plans for a responsive web site.

Desktop Layout

The desktop layouts are the images I presented above. The real magic is when you start using a smaller viewport like a tablet or smart phone.

Tablet Layout

For the tablet I chose to remove the right column. This removes the Post-query Suggestions and People.
2012-04-20-v5MasterSearchCenter-12.png
For the People Results I removed the refiners, you could choose to remove the About Me column and leave the refiners if you wish. The cool thing about this approach is the choice is yours.
2012-04-20-v5MasterSearchCenter-13.png

Smart Phone Layout

2012-04-20-v5MasterSearchCenter-14.png

Conclusion

While it is true that working with the out of the box pages can pose a steep learning curve, there is nothing preventing you from creating your own pages. In all of my projects I create all of my page layouts to go with my master pages and avoid using the out of the box pages. The only reason I did it here for this demo is to provide a starting point for your own exploration of the topic. Here are the pages that I used to create this demo.
I also have to mention that having the “right” resources is necessary in any SharePoint project. In my case the right, perfect, most excellent resource was Matt Schoen. Matt was able to take my jumble of CSS and make it make sense. He has the uncanny ability to take CSS that I have been looking at for an hour and spot the problem in seconds. I could not have finished this post without his assistance. Now if I could just get him to share his knowledge with the rest of y’all

SHAREPOINT LINK GUIDE

https://www.nothingbutsharepoint.com/sites/eusp/Pages/default.aspx?p=1629

SharePoint Designer 2010 Workflow Advanced Settings


You may also be interested in: Social Sites 2010 by NewsGator


Editor's note: Contributor Kim Frehe is a SharePoint Solution Specialist at Rightpoint Consulting. Follow her @KimFrehe
I’ve recently spent a lot of time on SharePoint 2010 workflows. I made a ton of errors and learned a lot about the new Task Process in 2010. It may look easy, but there are a lot of things that can go wrong.
I’m currently working on putting together a SharePoint Saturday session on the Task Process. I will be writing a few “Lessons Learned” articles to help me organize my thoughts to prepare for this session (not yet determined when or where). I will cover the following topics in more details in upcoming articles: Association and Initiation Forms, Change the behavior of a single task, Change the behavior of the overall task process, Change the completion conditions for this task process, the difference between assigning tasks and starting a task process.

This article is specifically about the Task Process “Advanced Properties”.

It is not immediately noticeable that a task process has advanced properties. If you click on the name of the task, you are taken to a Task Settings page that allows you to change certain settings. However, there are certain settings that you may not know to set since you do not see it anywhere except for in the task’s Advanced Properties. I will notate these as I go through each one below. Many of the issues I encountered were because these settings had changed or disappeared through the course of my iterations of the workflows.
These settings apply to the three Task Processes that can be added from “Action, Task Actions” and include the word “Process” – Start Approval Process, Start Custom Task Process, Start Feedback Process.
2012-04-23-SPD2010WorkflowAdvanceSettings-01.jpg
I highly recommend completely setting up your task process and reviewing these settings at the end. Many of these options will be blank when you first set up your task process and will be automatically populated in the course of customizing your workflow.
To view the advanced properties, click on the task process row and click on the drop down button that appears on the right. Then Select Properties, which will show you some settings and variables that are specific to that task process.
2012-04-23-SPD2010WorkflowAdvanceSettings-02.jpg
2012-04-23-SPD2010WorkflowAdvanceSettings-03.jpg
Here is a list of all the Properties available. These are the same for all three task processes.
Note: you will see that some items are “Variables” and some items are “Parameters”
  • Variables are hidden from end users, but the workflow needs to function
  • Parameters may be included on a form or setting for user input

General Property Variables:

  1. Content Type ID – this is a read only field, you cannot set the Task Content Type here. If you need to assign a custom content type to a task process, click here for instructions: Assign a Custom Content Type to Task Process in a SharePoint Designer 2010 workflow

  2. Allow Change Request –will prevent or allow the assigned user to request a change to the page or document being reviewed.
    • This option can be changed from the Task General Settings page (see print screen below)
    • This option will generate a button on the form and a corresponding outcome
    • Selecting this option will mark the current task as complete, assign a new task to the person a change is requested from. Once that task is marked as complete, a new task will be created to the person that requested the change to review the change and complete the task process.

  3. Allow Reassign – will allow the assigned user to reassign a new task to someone else. This will mark the current task as complete with an outcome of delegated to: new person.
    • This option can be changed from the Task General Settings page (see print screen below)
    • This option will generate a button on the form and a corresponding outcome
    • Selecting this option will mark the current task as complete and assign a new task you want to reassign the task to.
    2012-04-23-SPD2010WorkflowAdvanceSettings-04.jpg

  4. Delete Tasks on Complete – Setting this to “Yes” will delete the task once it has been completed or canceled.
    • You may want to consider this if you will be generating a large number of tasks with workflows.
    • If you are collecting data in the workflow task that you need to retain and you need to delete your tasks, you should include steps in your workflow to place that data somewhere else; in your page or document the process is acting on, for example.

  5. Expand Groups – This setting only applies if you are assigning tasks to SharePoint User Groups.
    • Yes means that each person in the group will get an individual task assigned
    • No means that one task will be created and a member of the group will have the option of claiming the task, which will reassign the task from the group to the individual.
    • This default can be set with the Initiation Form Parameters
    2012-04-23-SPD2010WorkflowAdvanceSettings-05.jpg
    • You can also leave this option on your workflow initiation form and allow the workflow initiator to select the appropriate option.

  6. Permission Set – This is asking if you want to use the permissions of the task list (default) or set permissions for these tasks so that only people that are assigned to a task, workflow initiators and admins can see tasks.
    • This is set to “Default” by default.
    • This can be set on the Task Settings page. If you check the box to “Only allow task recipients and process owners to read and edit workflow tasks SharePoint will set this variable to “AssignedTo”
    2012-04-23-SPD2010WorkflowAdvanceSettings-06.jpg
  7. Task Deleted Outcome – This is asking what the task outcome should be logged as if someone deleted a task. By default this is blank. You can enter “Deleted” or “Cancelled” or something that will let someone reviewing the workflow history know what happened to the task.

  8. Task Process Owner – Lists who owns this task process. If you change the permissions of the task “PermissionSet” then this user or group will have access to all the tasks as the owner.
    • This can be an individual or a SharePoint group.
    • You can set this in the Task Information section of the task general settings page.
    2012-04-23-SPD2010WorkflowAdvanceSettings-07.jpg
  9. Send Default Task Notifications – pay attention to this one. If you are sending a custom task notification to a user as part of the process, mark this as “No”. Otherwise it will change the default setting of your task list no notify users when a task is assigned.
    • Personally, I prefer to customize the task notification message, so I mark this as “no”
    • If this is set to “Yes” it will send the automated message below from the Task List this task resides in (the variables in <> below will be populated by the task or item)
    2012-04-23-SPD2010WorkflowAdvanceSettings-08.jpg

    Parameters for “[Task Process]”

  10. Task Process Name – This is the name of the Task Process, which may be included in notifications, depending on how yours are set up. You can also change this setting in the Task General Settings Page under Task Information.
  11. 2012-04-23-SPD2010WorkflowAdvanceSettings-09.jpg

  12. Overdue Repeat – Set this parameter if you want to send a notification to a user when the task is overdue. Your options are Off, Daily, Weekly or Monthly.
    • You have the option of customizing the email that is sent in the Task Process. That will be covered in another post.
    2012-04-23-SPD2010WorkflowAdvanceSettings-10.jpg
    • The default setting is weekly.
  13. Overdue Repeat Times – How many reminders do you want to send to the person or group a task is assigned to? You can enter a set number, or enter -1 for infinity. This means SharePoint will keep sending a reminder on the schedule that you listed in the previous parameter until the task is marked as complete, the task process is cancelled or the task is deleted.
  14. 2012-04-23-SPD2010WorkflowAdvanceSettings-11.jpg
    • The default setting is infinity

    Parameters for “[this item]”

  15. Item ID – Do not change this option. It is defaulted to the Item ID that the workflow is running on.

  16. Parameters for “[these users]”

    These variables can also be set in the workflow task using the “Set Workflow Variable” action or when you click on the link to start the task process with “these users”
    2012-04-23-SPD2010WorkflowAdvanceSettings-12.jpg
    2012-04-23-SPD2010WorkflowAdvanceSettings-13.jpg
  17. CC: - This variable is asking if an individual or group should be copied on emails regarding this task process.
    • Unless you are setting your workflow so that every workflow copies a certain person or group, I would leave this as “Parameter: CC”.
      • You can include this parameter on the initiation form for a person starting the workflow to complete or you can set with workflow actions if the workflow will be started automatically.

  18. Comments – Important: if “Parameter: Comments” is not listed here, then if your workflow can be manually started and you allow a workflow initiator to enter comments when manually starting the workflow, they will be lost. They will not be included in the emails or on the “Task Process Consolidated Comments”
    • The alternative is to enter static text here or to enter static text when you are adding a workflow to the list, library or content type

  19. Subject – Default subject of task notifications.
    • I personally do not complete this one because I make each task notification subject different depending on how complex the workflow is.
      • For example, a reassigned or change request task gets a different subject that an original task. Or a task assigned to a group will have a different subject than a task assigned to an individual.

  20. Duration – the number of days, weeks or months that a person has to complete a task
    • You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.
    • Make sure this is as least set as “Parameter: Duration” in the advanced.

  21. Duration Unit – days weeks or months
    • You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.
    • Make sure this is as least set as “Parameter: Duration Unit” in the advanced settings.

  22. Due Date – If you’d rather set an overall due date for the entire task process you can set it here.
    • You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.
    • Make sure this is as least set as “Parameter: Due Date” in the advanced settings.
An example of the screen when you are assigning a workflow to a list, library or content type is below.
  • Note the parameters that you can set here or in the Task Process’s advanced settings.
  • You can make these fields available to a workflow initiator or hide them.
2012-04-23-SPD2010WorkflowAdvanceSettings-14.jpg

InfoPath Currency Converter - Part 2


You may also be interested in: the Outlook sidebar by harmon.ie


Editor's note: Contributor Chris Grist is a Senior Technical Consultant for Loftus IT. Follow him @gristdog
In Part 1, we created a new form that has the components required for us to create a currency conversion component. We have a working calculation working from a button located on the form, however this is using a static rate.
At the end of Part 1 we ended up with a form that looked a little like this:
2012-04-24-InfoPathCurrencyConverter-Part02-01.png
We now are going to continue and achieve the following:
  • Connect to a Currency Conversion Web Service.
  • Provide drop down lists of available currencies.
  • Set the Exchange Rate relevant to our selected values.
After a bit of hunting I found a web service that would suit the needs of this project. It can be accessed using the following URL: http://www.webservicex.net/CurrencyConvertor.asmx
2012-04-24-InfoPathCurrencyConverter-Part02-02.png
From the description this does exactly what we need it to. Adding this in to InfoPath couldn’t be simpler. But as this web service is out on the web we need to change our form in to full trust mode. To do this click File -> Form Options and from the left select Security and Trust, from here you can uncheck Automatically determine security level and select Full Trust.
2012-04-24-InfoPathCurrencyConverter-Part02-03.png
Now we are ready to add our web service. On the Fields pane click Manage Data Connections. Click on Add and then follow the wizard as illustrated.
2012-04-24-InfoPathCurrencyConverter-Part02-04.png
Leave the defaults and click Next.
2012-04-24-InfoPathCurrencyConverter-Part02-05.png
Leave SOAP Web Service selected and click Next.
2012-04-24-InfoPathCurrencyConverter-Part02-06.png
Enter the URL of the web service into the location box and click Next.
2012-04-24-InfoPathCurrencyConverter-Part02-07.png
The web service, has only a single method ConversionRate select it and click Next.
2012-04-24-InfoPathCurrencyConverter-Part02-08.png
On this screen you are able to set default values, notice that when you do you get a great drop down list of valid items that will come in handy later. I’m from Australia so have set both values to AUD to begin with. Click Next, Next and finally Finish.
You have now successfully added the web service in to InfoPath. The next step will be to add those useful drop downs we just saw in to the form for the end user to utilise in selecting valid currencies.
In the Fields pane select the drop down that currently has Main selected; select the secondary data source of ConversionRate. Expand the structure, and inside queryFields you can see the two values we set earlier, FromCurrency and ToCurrency.
Simply drag and drop these on to the form, a menu will appear and you will want to select drop down box as the type of field to utilise. If you preview the form now your drop down lists should be functional.
2012-04-24-InfoPathCurrencyConverter-Part02-09.png
Brilliant, we have all the values the web service support so we should be safe from errors. Next open the properties of the exchangeRate field, set the default value to the ConversionRateResult as shown below. Ensure that Refresh value when formula is recalculated is checked.
2012-04-24-InfoPathCurrencyConverter-Part02-10.png
Finally we just need to edit the rules on our Convert button, select the Convert button and then select Manage Rules select the rule we created earlier, most likely with its default name Rule 1. Add a new action of type Query for Data. We only have one web service currently so by default the data connection selected is ConversionRate click OK. We need to ensure that we query for data before setting the outputAmount there for highlight the action that we just added and select Move Up.
2012-04-24-InfoPathCurrencyConverter-Part02-11.png
You should end up with the two actions like this.
2012-04-24-InfoPathCurrencyConverter-Part02-12.png
That’s It! Preview your form, enter a value and select your from and to currency and hit the convert button. We now have the value coming back that we expect.
2012-04-24-InfoPathCurrencyConverter-Part02-13.png
To recap, we created a new InfoPath form, laid out some controls with a couple of rules, connected a conversion rate web service and hooked it up all together to make a InfoPath currency conversion form. These components can now be used various ways in many other forms that would require currency conversion. If you got stuck I have provided the .xsn file below for you to use.
InfoPath Currency Conversion: InfoPath Currency Conversion (2)