puneet's profileAchilles WatchesPhotosBlogListsMore ![]() | Help |
|
|
SharePoint + This might also be because an indexer move is in progressI got this exception while developing on the SharePoint enterprise search.
"Microsoft.Office.Server.Search.Query.SearchServiceNotFoundException: The search request was unable to connect to the Search Service. at Microsoft.Office.Server.Search.Query.FullTextSqlQuery.Execute()" And i could not access the search settings in the shared service provider. I was getting the following message: "The search service is currently offline. Visit the Services on Server page in SharePoint Central Administration to verify whether the service is enabled. This might also be because an indexer move is in progress"
The way to get start back again is to restart the Office Search service. This can be accessed via the "services.msc" in the command prompt.
Thanks,
Puneet.H SharePoint: Web User Control in master pagesI was using the SharePoint designer and instantiated the User Control (placed in CONTROL TEMPLATES) I created for the top navigation bar in the master page.
Since i was working with the split mode. I didnt see any HTML of the user control in the page. So this is the tricky part, i had not given the id for the instance on the page.
Enjai,
Puneet.H
SharePoint: Caml Query- Time being ignoredHey All, Caml query not using the time part in datetime. If your are doing a caml query and you see that your time is being ignored in datetime try this:
<Value Type=”DateTime” IncludeTimeValue=”TRUE”><Today /></Value>
You have to use IncludeTimeValue=”TRUE”.
Found this blog which explained it, and works like a dream.
Enjai,
Puneet.H "Some or all identity references could not be translated" in SharePoint
I was configuring my WSS 3.0 installation and was getting this exception logged in the eventviewer on every page refresh and getting a message "Some or all identity references could not be translated". The solution to this problem was "stsadm.exe -o updatefarmcredentials -userlogin -password". Yippee, the central administration came up.
Description: Failed to register SharePoint services. An exception of type System.Security.Principal.IdentityNotMappedException was thrown. Additional exception information: Some or all identity references could not be translated. System.Security.Principal.IdentityNotMappedException: Some or all identity references could not be translated. at System.Security.Principal.NTAccount.Translate(IdentityReferenceCollection sourceAccounts, Type targetType, Boolean forceSuccess) at System.Security.Principal.NTAccount.Translate(Type targetType) at Microsoft.SharePoint.Administration.SPFarm.CurrentUserIsAdministrator() at Microsoft.SharePoint.Administration.SPPersistedObject.Update() at Microsoft.SharePoint.Administration.SPService.Update() at Microsoft.SharePoint.Administration.SPDiagnosticsService.Update() at Microsoft.SharePoint.Administration.SPPersistedObject.Update(Boolean ensure) at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServiceInConfigDB(Boolean provisionTheServiceToo, String serviceRegistryKeyName) at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServices(Boolean provisionTheServicesToo) at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.Run() at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()
Enjai, Puneet.H MOSS: Configure icons for PDF documents in search resultsTo configure the icons for PDF documents to show up in search results (read more about configuring MOSS search to index PDF documents) or in the default view of the document library, follow the steps below:
1. Copy the .gif file to
SharePoint Server 2007- Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Images
2. Edit the Docicon.xml file to include the .pdf extension. To do this, follow these steps:
3. Restart the server. Enjai Maadi, Puneet.H MOSS and Searching PDF DocumentsI was trying to configure MOSS search to index PDF documents present in the document libraries. Here are the steps:
1. Download Adobe Reader 8.x from here and install it on the server.
2. Add the filter extension to the File Types crawled:
3. Modify the following registry default values with the new CLSID for the Adobe IFilter:
{E8978DA6-047F-4E3D-9C78-CDBE46041603} (run regedit in the command prompt
4. Add the Installation directory of the Adobe Reader v.8 to the System Path. For example, if the Reader is installed on "D:\Program Files\Adobe", then add "D:\Program Files\Adobe\Reader 8.0\Reader" to the system path by:
Right Click on My Computer -> Properties -> Advanced -> Environment Variables -> Path (Under System Variables) -> Edit -> (Add "D:\Program Files\Adobe\Reader 8.0\Reader").
5. Restart the search service by running the following commands in the prompt:
Enjai Maadi,
Puneet.H MOSS 2007 - Create a survey, add question and choices programmaticallyI was trying to create an out of the box survey programmatically and wanted to add the question and choices to it too. Below is the sample implementation in C#.
SPWeb web = SPControl.GetContextWeb(HttpContext.Current);
// create the out of the box survey using the list template
Guid surveyId = web.Lists.Add("Name of the Title", "Description of the survey", SPListTemplateType.Survey);
SPList survey = web.Lists[surveyId];
string Question = "what?";
StringCollection choices = new StringCollection();
choices.Add("choice1");
choices.Add("choice2");
choices.Add("choice3");
// Set the question and choices for the survey
survey.Fields.Add(Question, SPFieldType.Choice, true, false, choices); // save the changes back to the list
survey.Update();
// save the changes made in the site
web.Update(); Enjai Maadi,
Puneet.H Chart Web part in MOSSFound this link which lets you download a chart web part. You can use it as a bar chart or as a pie chart.
Check it out at ListCharts - new web part.
Enjai Maadi,
Puneet.H Media player in MOSS 2007I needed to stream a video file to the client.. say as in streaming a webcast. So we needed to embed a video player in a SharePoint site. I found this link where he has explained the same. It worked for me like a dream.
Add a Content Editor Web Part onto your page, and click on the Source Editor where you could input the following HTML, and update the URL value accordingly. Parameters could be added or removed according to your needs, refer to w3schools for the parameters available.
<OBJECT id="VIDEO" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
<PARAM NAME="URL" VALUE="/Docs/[Your Document Library]/[folder]/[your file.wmv]"> <PARAM NAME="animationatStart" VALUE="true"> <PARAM NAME="transparentatStart" VALUE="true"> <PARAM NAME="SendPlayStateChangeEvents" VALUE="True"> <PARAM NAME="AutoStart" VALUE="false"> <PARAM name="uiMode" value="full"> </OBJECT> Enjai,
Puneet.H SharePoint - Business Data Catalog walkthroughI was looking out for some BDC related stuff and for some walkthroughs and tutorials.
Here is the MS Virtual Lab link to the walkthrough which i found really helpful. You have to be a MSDN subscriber and a MSN passport account helps.
Also editing the application definition file by hand is a pain. Using BDC MetaMan is advised. You can find it here.
Enjai,
Puneet.H Using SPSecurity.RunWithElevatedPrivileges: Get a FileWell, i had a SharePoint site running Forms Authentication and i had to get a file from the document library for editing. So i decided to give Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges method a try. This takes a void function which will be run in elevated priveleges. So creating/deleting MySite for users while adding them from a legacy system can be done without the application running in System Account.
Heres the sample code:
SPFile rFile;
SPWeb web;
using (SPSite site = new SPSite(serverurl))
{
web = site.OpenWeb();
// get the file
SPSecurity.RunWithElevatedPrivileges(GetSPFile);
// read the file
StreamReader streamReader = new StreamReader(rFile.OpenBinaryStream());
filecontent = streamReader.ReadToEnd();
// do some file manipulation
/*
.......
*/
web.AllowUnsafeUpdates = false;
}
private void GetSPFile()
{
web.AllowUnsafeUpdates = true;
rFile = web.GetFile(strFileURL);
}
Enjai,
Puneet.H SharePoint 2007 + Blocked File TypesIn order to add or remove a file type being added to your SharePoint portal you will have to add/remove the extension of the file from blocked file types. To find out the blocked file types you will have to goto Central Administration -> Operations -> Manage Blocked File Types. You will see a list of extensions. In order to remove a file type, delete the file type and click OK. In order to block a file type, just add it to the list in a new line and click OK. For more information go HERE. SharePoint + HTML EditorWell, if you wanted a HTML editor in your SharePoint application then read on...
SharePoint uses a HTML editor present in http://Server:portno/_layouts/htmledit.aspx for its own purposes.
I have put forth the JavaScript code required to popup the HTML editor. I also have to warn that for some reason you are presented with messy JavaScript errors when you try to highlight the text background or change the color of the text.
<script language="javascript">
function jsPopupEditor() { var rc = new Array(0,0); rc = window.showModalDialog('http://Server:portno/_layouts/htmledit.aspx?Target=hdnTxt',document.getElementById("hdnTxt"),'dialogHeight:450px;dialogWidth:450px;'); if (rc != null){ document.getElementById("hdnTxt").innerHTML= rc; document.getElementById("hdnTxt").value = rc;} } </script> Here hdnTxt is a hidden multiline textbox containing the HTML to be edited.
Enjai,
-Puneet.H SharePoint + Open documents(links) in a new windowWell to force open the documents(links) in a new window. Get the webpart from here and add it to the document libary page.
Enjai
-P.H |
|
|