Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Microsoft Content Management Server : Adding a Search Page to the MCMS Site (part 1) - Searching with the MCMS SharePoint Connector

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
2/8/2012 3:30:43 PM
We have two options available to implement a search capability for our Tropical Green site:
  • Leverage the ASP.NET Server Controls included in the MCMS Connector for SharePoint Technologies that allow search queries to be executed.

  • Create our own solution.

The MCMS Connector includes the following three controls that assist you in implementing search functionality for an MCMS site by leveraging SharePoint search scopes:

  • SearchInputControl: Used to create the search form input for a search to be submitted.

  • SearchResultControl: Takes search criteria entered in the SearchInputControl, executes the search against the SPS search Web Service, and displays the results in list form.

  • SearchMetaTagGenerator: Creates HTML META tags based on the PropertyType setting. META tags generated can include standard page properties as well as custom properties.

You can use these three controls on the same page or separate pages. This is very convenient as you may wish to include a small search keyword input box on all pages in your site that submits the search to a separate results page, but you might want to provide the search input on the search results page as well.

Once we have created a working search page using the MCMS Connector controls, we’ll create a custom solution that won’t include anything provided in the MCMS Connector. Our solution will include an advanced search, specific to our site, and a customized search result listing.

Both options have distinct advantages and disadvantages. Which one you’ll implement on your MCMS site will depend entirely upon your requirements, customization needs, and available development time. The following table outlines a few of the more prominent advantages and disadvantages of using the MCMS Connector controls as well as rolling your own solution:

Implementing search leveraging MCMS Connector controls:

AdvantagesDisadvantages
Fast install and integration into pages & templatesNo customization of search input controls
Will work out of the box with minimal configurationNo customization of search result list

Implementing search with a custom solution:

AdvantagesDisadvantages
Complete control over layout of search input formRequires extra development time and testing
Complete control over search result list 
Create special advanced search based on specific site requirements 

Searching with the MCMS SharePoint Connector

The first thing we’ll do for this is to create a new search page in our Tropical Green project. This page will not be a new MCMS template, but a regular ASP.NET page. You could make this a template, but there’s no real advantage in doing so because there will only be a single search page on our site with no extra content.

1.
In Visual Studio .NET, right-click on the Tropical Green project and select Add Web Form.

2.
Name the new ASPX page Search.aspx and click Open.

3.
If the page doesn’t load in Design mode, click Design in the lower left corner.

4.
Change the page layout to FlowLayout.

5.
Drag the /Styles/styles.css, /UserControls/TopMenu.ascx, and /UserControls/RightMenu.ascx files from Solution Explorer onto the designer.

6.
Switch to HTML mode and modify the body tag as follows: <body topmargin="0" leftmargin="0" rightmargin="0">

7.
Add the following code between the <form> and </form> tags, replacing the two user controls that were just added:

<form id="Form1" method="post" runat="server">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" colspan="2" valign="top" bgcolor="#ffcc00">
<img src="/tropicalgreen/images/Logo.gif">
</td>
<td vAlign="top" rowSpan="10">&nbsp;</td>
</tr>
<tr bgColor="#66cc33">
<td colSpan="2"><uc1:TopMenu id="TopMenu1"
runat="server"></uc1:TopMenu></td>
</tr>
<tr>
<td vAlign="top" style="PADDING-RIGHT:30px; PADDING-LEFT:30px;
PADDING-BOTTOM:30px;">
<p>&nbsp;</p>
<table cellspacing="0" cellpadding="10" border="1"
bordercolor="#669900">
<tr vAlign="top">
<td>Tropical Green Search:</td>
</tr>
<tr>
<td vAlign="top">
</td>
</tr>
</table>
</td>
<td class="RightMenuBar" width="20%" valign="top" height="100%"
align="center" rowspan="2" bgcolor="#669900">
<uc1:RightMenu id="RightMenu1" runat="server"></uc1:RightMenu>
</td>
</tr>
</table>
</form>


Why did we drag the user controls onto the page and then replace the resulting HTML?

Dragging the user controls onto the page adds the <%@ Register %> lines to the ASPX for us as well as adding the user control ASP.NET tags to the HTML. We then only need to modify the HTML to make it more presentable.


You should now have a page that looks like the following when viewed in Design mode:

Let’s save our new search page, build the Tropical Green project, and navigate to it in a browser to make sure everything is in order before we go about adding the search input and results controls.

1.
Save all changes to the search.aspx page.

2.
Right-click the TropicalGreen project and select Build.

3.
If there are no errors in the build, open a browser and navigate to: http://www.tropicalgreen.net/TropicalGreen/Search.aspx.

4.
If there are any issues, retrace the steps we’ve taken to this point, address the errors, and retry the URL.

Now that we have a working search page, we need to add some functionality to it. We’ll add the two MCMS Connector server controls, make some configuration changes, build the solution, and test our search page.

1.
Open the search.aspx page in Visual Studio .NET if it’s not already open, and switch to Design view.

2.
Open the Visual Studio .NET Toolbox and drag the SearchInputControl and SearchResultsControl into the table cell below the Tropical Green Search cell. Refer to the following image for placement:

3.
Select the SearchInputControl we added to search.aspx and set the following properties in the Visual Studio .NET property window:

PropertyValue
SearchModeSimple
SearchResultPage/TropicalGreen/Search.aspx

4.
Select the SearchResultControl we added to the search.aspx page and set the following properties using the Visual Studio .NET property window:

PropertyValue
PortalUrlhttp://portal.tropicalgreen.net/
SearchResultPageSize10


Let’s see if our search is working. Save all changes to search.aspx, build the Tropical Green project, and go to http://www.tropicalgreen.net/TropicalGreen/Search.aspx in a browser. You should see a page similar to the one below:

Enter a word you know will be found on the site, such as ficus. You will see the same list of search results that were returned when searching for the same string in the portal containing the content index.

If you receive an error message stating “There was a problem loading the input control. The error returned by the system is: Could not find part of the path c:\inetpub\wwwroot\tropicalgreen\cms\wssintegration\searchpropertycollection.xml”, double-check that you added the CMS virtual directory in your TropicalGreen web application.


At this point, we have got search capabilities on our site thanks to the MCMS Connector controls and SPS’s search features. But this solution is very limited, for instance there is no way to change the look and feel of these controls and there is also no way to configure which properties are displayed in the result page, for instance to show a short description for the returned documents.

To address this, we will now build our own search controls.

Other -----------------
- Sharepoint 2007 : Managing Security - Configure Access Requests for Lists and Libraries
- Sharepoint 2007 : Managing Security - See Who Is a Member of a SharePoint Group
- Sharepoint 2007 : Managing Security - Assign Permissions on a List or Library
- InfoPath with Sharepoint 2010 : Expose Form Fields as Web Part Connection Parameters & Create a Form to Send Data to Web Parts
- Windows Server 2003 : Creating Virtual Machines (part 2) - Configuring Virtual Machines
- Windows Server 2003 : Creating Virtual Machines (part 1) - Initial Configuration of a Virtual Machine
- Windows Home Server 2011 : Sharing Videos
- Microsoft Dynamics AX 2009 : Processing Business Tasks - Creating company-specific document layout
- Microsoft Dynamics AX 2009 : Processing Business Tasks - Posting sales orders
- Active Directory Domain Services 2008 : Add a Computer to a Group
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server