Get out of here
I think this is by design in technical approach, bug in business approach
. But there is a workaround. You have to set the content type of the page layout you're trying yo create a page from, as the default content type on the needed pages library. Then, when you create a page from a page layout that is bound to the default content type of the pages library on the site ( yeah I know, there are so many dependencies : P ), you see the default values of the fields on the bound controls. But, as you can guess, this can not be a workaround for two different content types living on the same site, at the same time
Since, there can only be ONE default content type in a document library or list.
Filed under: Uncategorized
When querying a list with DateTime filter values in CAML, it does not use the time portion of the datetime paramater values, and the returned resultset is wrong. If you add IncludeTimeValue property with the value of “True” on the “Value” node of the CAML query like below:
<Value Type=”DateTime” IncludeTimeValue=”TRUE”><Today /></Value>
your CAML query works just fine
Filed under: Uncategorized
Let's say you created a web application with a host header on SharePoint which is installed on Windows Server 2008, and your credentials can not be authenticated if you try to log in to the web application on the server itself. Check the “Security” category on the event logs, if you see some entry like the one below, then go on reading
An account failed to log on.
Subject:
Security ID: NULL SID
Account Name: –
Account Domain: –
Logon ID: 0×0
Logon Type: 3
Account For Which Logon Failed:
Security ID: NULL SID
Account Name: username
Account Domain: domainname
Failure Information:
Failure Reason: An Error occured during Logon.
Status: 0xc000006d
Sub Status: 0×0
Process Information:
Caller Process ID: 0×0
Caller Process Name: –
Network Information:
Workstation Name: clientname
Source Network Address: clientip
Source Port: portnumber
Detailed Authentication Information:
Logon Process:
Authentication Package: NTLM
Transited Services: –
Package Name (NTLM only): –
Key Length: 0
This problem has occured with the recent patches ( I do not know which one caused this ). The main reason for this issue is, the system blocks the authentication procedure while resolving the host header given to the web application. To resolve this issue, a modification must be done to the server's registry. You can read the article here.
Filed under: Uncategorized
. you can check out the KB article here.
Filed under: Uncategorized
If you get the error in the title at the crawl logs of the MOSS 2007 farm and googled some, you'll see some solutions like restarting the search services on the farm, detaching the search database of the shared services providers, and things like that. Before trying these solutions, just be sure about this: Do you have "I" ( "aye", the upper case "i" ) character in the URL of the error generating site? If your answer is "Yes", go ahead and change the "I" character to "i" ( the lower-case "I" ) and re-crawl the content source, your problem may have been solved
Filed under: Uncategorized
… do not forget to give a host header to the web application. For the web applications that has a port but not a host header as the initial configuration, the portal will not function as it has to. You will not be able to reach the standart configuration pages below /_layouts/ folder and you'll get "File not found" exceptions; if you have mutli language support on the SharePoint farm, some parts of the portal will be served on a different language than the original portal language; and stuff. As I know, there are no hotfixes or patches to solve this situation, so just give a host header name while creating a web application, and get rid of these issues
Filed under: Uncategorized
To access a user's profile within an anonymous accessable portal, you can use the code snippet below:
SPSecurity.RunWithElevatedPrivileges(delegate(){ SPSite sc = new SPSite(SPContext.Current.Site.ID); ServerContext context = ServerContext.GetContext(sc); HttpContext currentContext = HttpContext.Current; HttpContext.Current = null; UserProfileManager profileManager = new UserProfileManager(context); UserProfile user = profileManager.GetUserProfile("DOMAIN\userName"); writer.Write(user.PersonalUrl); HttpContext.Current = currentContext;});
The important part of this code snippet is setting null as value to the current HTTP context while reading from the user profile store. Without this action, you'll get access errors and not be able to reach the profile store.
Filed under: Uncategorized
Let's say, you have a portal that can be accessed with anonymous access and the anonymous users will reach a data on SharePoint that anonymous users can not reach. You can use the code below to accomplish this:
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPSite sc = new SPSite(SPContext.Current.Site.ID);
foreach (SPUser user in sc.RootWeb.Groups["Portal Owners"].Users)
{
Response.Write(user.Name + "<br />");
}
});
The RunWithElevatedPrivileges method makes the code run with the account which is the application pool identity of the web application the code runs in.
Filed under: Uncategorized
… you can use the code below:
SPSite sc = new SPSite("http://portal");
SPWeb rootWeb = sc.RootWeb;
SPField state = rootWeb.Fields["State"];
XmlDocument doc = new XmlDocument();
doc.LoadXml(durum.SchemaXml);
foreach (XmlNode choice in doc.SelectNodes("//CHOICE"))
Console.WriteLine(choice.InnerText);
sc.Close();
Filed under: Uncategorized
If you try to open an Office document on a SharePoint document library and the document only opens in read-only mode or if you get a "The document could not be opened for editing. A Windows SharePoint Services compatible application could not be found to edit the document." error when you click on the "Edit in …" item on the documents menu, it means that the hotfix at
http://support.microsoft.com/kb/938888 is missing on the client machine. To download and install the hotfix or getting the latest updates from Microsoft Update will resolve the issue.
Filed under: Uncategorized