searching the cms content and external data sources
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
searching the cms content and external data sources

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
pamcms
Guest





Posted: Thu Oct 27, 2005 8:51 am    Post subject: searching the cms content and external data sources Reply with quote

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.
Back to top
Stefan [MSFT]
Guest





Posted: Thu Oct 27, 2005 8:51 am    Post subject: Re: searching the cms content and external data sources Reply with quote

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(typeof(HtmlPlaceholderDefinition))
]
public class ExtHtmlPhControl : HtmlPlaceholderControl
{
// - private TextBox htmlEditControl;
private LiteralControl htmlPresentationControl;

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

protected override void CreatePresentationChildControls(BaseModeContainer
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(PlaceholderControlEventArgs 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@localhost.talkaboutsoftware.com...
Quote:
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.


Back to top
pamcms
Guest





Posted: Thu Oct 27, 2005 12:51 pm    Post subject: Re: searching the cms content and external data sources Reply with quote

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,
Back to top
Stefan [MSFT]
Guest





Posted: Thu Oct 27, 2005 12:51 pm    Post subject: Re: searching the cms content and external data sources Reply with quote

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@localhost.talkaboutsoftware.com...
Quote:
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,



Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB