Microsoft Content Management Server - searching the cms content and external data sources

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > October 2005 > searching the cms content and external data sources





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author searching the cms content and external data sources
pamcms

2005-10-27, 2:47 am

For our MCMS site, we are planning to use google mini as a search tool. We
wish to index our CMS content and also some external data sources which
are basically WORD files, pdf etc.
Can anyone help me understand, how the search results (from the Word,pdf
files etc.) will be displayed in MCMS result posting/page? And when the
user clicks on the search result, how and where will the content of the
Word/pdf file be displayed ?

Also, Can MCMS placeholder have dynamic content like some variables placed
in between some static content? These variables will have data coming from
some external database.

Thanks in advance.



Stefan [MSFT]

2005-10-28, 4:58 pm

Hi Pam,

about the search question: that depends on the implementation of the search
result control. As I don't know Google mini its not clear to me if this will
be implemented by you or if it comes with Google mini.

About the question about dynamic content: yes that is possible using a
custom placeholder control.
See the sample below. This one uses content from external files but you can
replace this logic with database access easily.

using System;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Microsoft.ContentManagement.Publishing;
using Microsoft.ContentManagement.Publishing.Extensions.Placeholders;
using Microsoft.ContentManagement.WebControls.Design;
using Microsoft.ContentManagement.WebControls;

namespace CmsEnhancedHtmlPlaceholderControl
{
/// <summary>
/// Summary description for ExtHtmlPhControl.
/// </summary>
[
ToolboxData("<{0}:ExtHtmlPhControl runat=server></{0}:ExtHtmlPhControl>"),
SupportedPlaceholderDefinitionType(typeo
f(HtmlPlaceholderDefinition))
]
public class ExtHtmlPhControl : HtmlPlaceholderControl
{
// - private TextBox htmlEditControl;
private LiteralControl htmlPresentationControl;

private HtmlPlaceholder BoundHtmlPlaceholder
{
get
{
return (HtmlPlaceholder)this.BoundPlaceholder;
}
}

protected override void CreatePresentationChildControls(BaseMode
Container
presentationContainer)
{
this.htmlPresentationControl = new LiteralControl();
this.htmlPresentationControl.ID = "PresentationControl";
presentationContainer.Controls.Add(this.htmlPresentationControl);
}

public ExtHtmlPhControl()
{
//
// TODO: Add constructor logic here
//
}

protected override void
LoadPlaceholderContentForPresentation(Pl
aceholderControlEventArgs e)
{
EnsureChildControls();
try
{
String text = this.BoundHtmlPlaceholder.Html;
int startpos=text.IndexOf("{{");
int endpos=text.IndexOf("}}");

while ((startpos > 0) & (endpos > startpos))
{
// startpos = text.IndexOf("{{");
// endpos = text.IndexOf("}}");
String key = text.Substring(startpos,endpos-startpos+2);
String Filename = key.Substring(2,endpos-startpos-2).Trim();

FileInfo fi = new FileInfo(Filename);
StreamReader r = fi.OpenText();
string textLine = r.ReadLine();
r.Close();
text = text.Replace(key,textLine);

startpos=text.IndexOf("{{");
endpos=text.IndexOf("}}");
}

this.htmlPresentationControl.Text = text;
}
catch (Exception exp)
{
// show the error as placeholder content
this.htmlPresentationControl.Text = "<error>" + exp.Message +
"</error>";
}
}
}
}


Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"pamcms" <seemapop@yahoo.com> wrote in message
news:909b2f9b3c8f48239067bef7b7af2099@lo
calhost.talkaboutsoftware.com...
> For our MCMS site, we are planning to use google mini as a search tool. We
> wish to index our CMS content and also some external data sources which
> are basically WORD files, pdf etc.
> Can anyone help me understand, how the search results (from the Word,pdf
> files etc.) will be displayed in MCMS result posting/page? And when the
> user clicks on the search result, how and where will the content of the
> Word/pdf file be displayed ?
>
> Also, Can MCMS placeholder have dynamic content like some variables placed
> in between some static content? These variables will have data coming from
> some external database.
>
> Thanks in advance.
>
>
>



pamcms

2005-10-28, 4:58 pm

Hello Stefan,

Thanks for the quick reply and the code for dynamic content.

Can the data/content from the Word/pdf file be displayed on the web page
without publishing it as an MCMS posting??

Thanks,




Stefan [MSFT]

2005-10-28, 4:58 pm

Hi,

yes that is possible. Usually search result controls render a direct link to
the search result - so to the word doc or the PDF.

Most browsers will then start the application inline.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------


"pamcms" <seemapop@yahoo.com> wrote in message
news:7a872767b50d1f0c04fdc57a5cefd668@lo
calhost.talkaboutsoftware.com...
> Hello Stefan,
>
> Thanks for the quick reply and the code for dynamic content.
>
> Can the data/content from the Word/pdf file be displayed on the web page
> without publishing it as an MCMS posting??
>
> Thanks,
>
>
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com