2009年4月21日星期二

原来是目录权限的问题

在Sharepoint中,使用Generic Handler来读取Image并显示出来,使用的是transmitfile函数。当发布在Sharepoint中,出现403 FORBIDDEN错误。图像所在路径是一个共享目录,如\\ibadev\8080\images这样的目录。

经查明,问题在于,共享目录是否填加了“Everyone”权限。我发现images这个目录,只有qfang有访问权限,所以才会现只有qfang登录sharepoint时,才会显示图像的情况。后来,给images目录添加了everyone可访问的权限,一切就都正常了。

2009年4月9日星期四

SharePoint Theme

SharePoint Theme

Represents a collection of graphics and cascading style sheets that can modify how a Web site looks.

Real World Example

A business group wants to create a common high-level graphical look and feel for a set of Web sites. They hire a graphics designer to create a new theme that can be installed on Windows SharePoint Services 3.0 or Microsoft Office SharePoint Server 2007, and then applied to any Web site to provide the intended graphical scheme.

Technical Details

Themes in SharePoint Products and Technologies are installed on the front-end Web server file system and can be referenced by any Web site in the SharePoint environment. If a Web site refers to a theme that is not available, it should render as if no theme was applied.Support DetailsAfter a theme is installed, execute an IISReset command to make the theme available.


Themes re-skin the layout by changing colours and images used in the design. Since a theme is just a CSS file and images, the layout of the page such as the location of the navigation is controled by the master page.
To create a new theme, copy an existing theme from the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\THEMES directory into a new directory.
Edit the C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML file and add a section for your new theme:

<Templates>
<TemplateID>NewDirectoryName</TemplateID>
<DisplayName>Theme Display Name</DisplayName>
<Description>Give Description of the theme</Description>
<Thumbnail>images/customimage.png</Thumbnail>
<Preview>images/pagepreview.gif</Preview>
</Templates>
Perform an IIS Reset and then select the new theme from the Site Settings page.

使用IHttpHandler下载文件

namespace IBA.ECommerce.WebParts.UserControls
{
// <system.web>
// <httpHandlers>
// <add verb="GET,POST" path="GetImage.ashx" type="IBA.ECommerce.WebParts.UserControls.GetImageHandler"/>
// </httpHandlers>

public class GetImageHandler : IHttpHandler
{
#region IHttpHandler Members

public bool IsReusable
{
get { return false; }
}

public void ProcessRequest(HttpContext context)
{
Guid dociId = new Guid(context.Request["docid"]);
Document doc = Document.Get<Document>(dociId);
if (doc != null)
{
context.Response.ClearHeaders();

FileInfo fileInfo = new FileInfo(doc.FullPath);

context.Response.AddHeader("Content-Disposition", "attachment; filename=" + doc.Path2);
context.Response.TransmitFile(doc.FullPath);

context.Response.End();
}
}

#endregion
}
}

2009年4月8日星期三

如何为一个系统提供技术解决方案

Supply Portal是IBA的一个新项目。这个项目也是和SAP相关,需要用MOSS实现和客户的交流,与Ecommerce相似。不过,与Ecommerce不同的是,它需要很多工作流。

现的情况是,有一个工程师在Belgium作需求分析,它了解了整个的工作流程。需要我们MOSS工程时提技术解决方案。

使用SmartPart时的UserControls目录的权限

这个目录需要设置为Everyone可访问才行。

2009年3月24日星期二

在SharePoint的Webpart中无法使用Resources

原因未明

使用ObjectDataSource重新查询

在使用ObjectDataSource作为数据源时,如果需要重新查询,则使用ObjectDataSource的Select方法即可。如下列代码:

protected void btnSearch_Click(object sender, EventArgs e)
{
this.CatalogDataSource.Select();
this.listCatalog.DataBind();
}