承接MOSS各种工作流开发 联系人:王先生.电话:13691349686 QQ:252385878 MSN:wanghao-3@hotmail.com

寻找网络安全产品代理商(主要产品有:主机审计与监控系统,移动介质管理系统,文件集中管理安全存储系统,硬盘锁等)主要针对内网安全和数据防泄密 联系人:张小姐 电话:13522877350 QQ:419919940

2008年5月7日 #

用友软件工程公司招聘moss




我朋友委托我帮忙招聘一些moss开发的工程师 !!
待遇优厚。。。
要求:3年asp.net开发经验 1年MOSS经验
工资比一般公司待遇要高,目前公司急需MOSS 人才,会moss 开发就OK。。(有几个moss的项目)
有大项目,项目奖金丰厚。。

地址: 北京
有兴趣可以帮简历: yanglei2@use.com.cn  或者 hovic.wang@gmail.com




posted @ 2008-06-10 23:36 A A 阅读(143) | 评论 (6)编辑

列表查询WebPart

SmartListSearchWebPart
简单列表查询WebPart.本代码只是一个简单的Demo,代码没有实际的价值,但是很有学习价值.
在项目中可以得到很好的应用!


输入key





Code :

using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using System.Xml;

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

namespace SmartListSearchWebPart
{
    [Guid("34903418-36da-45cb-ae81-27cd82b628dd")]
    public class SmartListSearchWebPart : System.Web.UI.WebControls.WebParts.WebPart
    {
        public SmartListSearchWebPart()
        {
            this.ExportMode = WebPartExportMode.All;
        }

        private Button btnSearch;
        private TextBox tbKey;
        /// <summary>
        /// create child controls
        /// </summary>
        protected override void CreateChildControls()
        {
            btnSearch = new Button();
            btnSearch.Text = "查询";
            btnSearch.Click += new EventHandler(btnSearch_Click);
            this.Controls.Add(btnSearch);

            tbKey = new TextBox();
            this.Controls.Add(tbKey);

            base.CreateChildControls();
        }

        private SPList List
        {
            get
            {
                return SPContext.Current.List;
            }
        }
        /// <summary>
        /// search
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnSearch_Click(object sender, EventArgs e)
        {
  
            if (this.tbKey.Text != "")
            {
                string cmal = string.Format("<Where><Contains><FieldRef Name='Title' /><Value Type='Text'>{0}</Value></Contains></Where>", this.tbKey.Text.ToString());
                this.SetCurrentListViewSchemaQuery(cmal);
            }
           

        }
        /// <summary>
        /// set current list view schema query
        /// </summary>
        /// <param name="cmal"></param>
        private void SetCurrentListViewSchemaQuery(string cmal)
        {
            if (!string.IsNullOrEmpty(cmal))
            {
                string str = "{" +this.List.ID.ToString() +"}";

               
                foreach (System.Web.UI.WebControls.WebParts.WebPart webPart in base.Zone.WebParts)
                {
                    if (webPart is ListViewWebPart)
                    {
                        ListViewWebPart listViewWebPart = (ListViewWebPart)webPart;
                        if (string.Compare(listViewWebPart.ListName, str, true) != 0)
                        {
                            continue;
                        }

                        if (string.IsNullOrEmpty(cmal))
                        {
                            listViewWebPart.ListViewXml = this.List.Views[new Guid(listViewWebPart.ViewGuid)].HtmlSchemaXml;

                        }
                        else
                        {
                            XmlDocument xmlDocument = new XmlDocument();
                            xmlDocument.LoadXml(listViewWebPart.ListViewXml);
                            this.ChangeSchemaXmlCaml(xmlDocument, cmal);
                            listViewWebPart.ListViewXml = xmlDocument.InnerXml;
                        }
                    }
                }
            }
        }
        /// <summary>
        /// move where
        /// </summary>
        /// <param name="q"></param>
        /// <returns></returns>
        private string GetInnerQuery(string q)
        {
            XmlDocument docuemnt = new XmlDocument();
            docuemnt.LoadXml(q);
            return docuemnt.DocumentElement.InnerXml;
        }
        /// <summary>
        /// change schema xml query
        /// </summary>
        /// <param name="xmlDocument"></param>
        /// <param name="query"></param>
        private void ChangeSchemaXmlCaml(XmlDocument xmlDocument,string query)
        {
            if (!string.IsNullOrEmpty(query))
            {
                string innerXml = this.GetInnerQuery(query);
                if (innerXml != "")
                {
                    XmlNode node = xmlDocument.DocumentElement.SelectSingleNode("Query");
                    XmlNode oldChild = node.SelectSingleNode("Where");

                    if (oldChild != null)
                    {
                        node.RemoveChild(oldChild);
                    }

                    XmlNode newChild = xmlDocument.CreateElement("Where");
                    newChild.InnerXml = innerXml;
                    node.AppendChild(newChild);
                    xmlDocument.DocumentElement.SelectSingleNode("ViewEmpty").InnerXml = "<HTML><![CDATA[<font color='red'><b>AA Say:未找到符合查询条件的记录。</b></font>]]></HTML>";
                }

            }
        }
        /// <summary>
        /// render
        /// </summary>
        /// <param name="writer"></param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.Write("<table><tr><td>");
            writer.Write("关键字:");
            tbKey.RenderControl(writer);
            btnSearch.RenderControl(writer);
            writer.Write("</td></tr></table>");
        }
    }
}

这个webPart 核心就是修改它的Scheam就OK
listViewWebPart.ListViewXml = xmlDocument.InnerXml;(主要代码)


jianyi 的文章对我很大帮助。。。希望更多的朋友向建议学习。分享





posted @ 2008-05-15 16:43 A A 阅读(251) | 评论 (1)编辑

Feature Action List Settings


今天很无赖。。很痛苦。。。很郁闷。 。。。。


首先 code .cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
namespace ActionDemo
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:ListSettingsMenu runat=server></{0}:ListSettingsMenu>")]
    public class ListSettingsMenu : WebControl
    {
        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue("")]
        [Localizable(true)]
        public string Text
        {
            get
            {
                String s = (String)ViewState["Text"];
                return ((s == null) ? String.Empty : s);
            }

            set
            {
                ViewState["Text"] = value;
            }
        }


        protected override void CreateChildControls()
        {
            //base.CreateChildControls();
            SubMenuTemplate listSettings = new SubMenuTemplate();
            listSettings.Text = "List Settings";
            listSettings.Description = "Manage settings for lists on this site";
            listSettings.ImageUrl = "/_layouts/images/lg_ICASCX.gif";

            foreach (SPList list in SPContext.Current.Web.Lists)
            {
                if (!list.Hidden)
                {
                    MenuItemTemplate listItem = new MenuItemTemplate();
                    listItem.Text = list.Title;
                    listItem.Description = string.Format(
                        "Manage settings for {0}", list.Title);

                    listItem.ImageUrl = list.ImageUrl;

                    string url = string.Format(
                        "{0}/_layouts/listedit.aspx?List={{{1}}}",
                        SPContext.Current.Web.Url, list.ID.ToString());
                    listItem.ClientOnClickNavigateUrl = url;

                    listSettings.Controls.Add(listItem);


                }
            }

            this.Controls.Add(listSettings);
        }
        protected override void RenderContents(HtmlTextWriter output)
        {
            output.Write(Text);
        }
    }
}


Feature
feature.xml

<Feature xmlns="http://schemas.microsoft.com/sharepoint/"

         Id="{abeaae41-f8bc-4d60-b793-1ab65e633009}"
         Title="AA is great "
         Description="default Site Actions menu of WSS site by adding extra menu options."
         Scope="Site"
        
         >
 <ElementManifests>
  <ElementManifest Location="manifest.xml"/>
 </ElementManifests>

</Feature>

manifest.xml

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

 <CustomAction Id="{99777c4a-55d9-459b-aefe-e38b0d610ee1}"
      Location="Microsoft.SharePoint.StandardMenu"
      GroupId="SiteActions"
      ControlAssembly="ActionDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bf2af071df56a875"
      ControlClass="ActionDemo.ListSettingsMenu"
    >
 </CustomAction>

</Elements>


Dll放在 GAC 或者BIN

然后 二个xml 文件放在
Feature  下面,自己建立一个文件夹

在 站点的Web.Config 文件里面注册 这个dll
这个不用我写吧。。一般的WebPart 都需要。。

然后安装

 

@SET TEMPLATEDIR="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\"

@SET STSADM="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm"

xcopy /e /y TEMPLATE\* %TEMPLATEDIR%\Template

@ECHO ON

REM %STSADM% -o installfeature -name MyCustomListSettings -force
REM %STSADM% -o activatefeature -name MyCustomListSettings -force -url http://server:8000/

REM IISRESET /timeout:0


CustomAction 可以设置 Microsoft.SharePoint.StandardMenu

当然别的都可以设置。。。发挥你的想象去吧。/。。。


代码没有任何价值。。只是一种方式。。。


今天特烦。。。。








posted @ 2008-05-09 16:29 A A 阅读(104) | 评论 (0)编辑

SPPropertyBag Type



我们在使用一个site 保存信息的时候,可以使用 SPPropetryBag来很方便的存储!
Code:
 SPWeb spWeb = (new SPSite("http://AA.local")).OpenWeb();
SPPropertyBag spProperties = spWeb.Properties;
 
foreach (DictionaryEntry entry in spProperties)
  Console.WriteLine("   {0,-25} {1}", entry.Key, entry.Value);

我们还可以增加一个新的key and value

Code:

private void SetValue(String key, String value, String siteUrl) {
SPWeb spWeb = (new SPSite("http://AA.local")).OpenWeb();
SPPropertyBag spProperties = spWeb.Properties;
 
if (spProperties.ContainsKey(key)) {
spProperties[key] = Value;
} else {
spProperties.Add(Key, Value);
}
 
spProperties.Update();
}


posted @ 2008-05-09 14:20 A A 阅读(51) | 评论 (0)编辑

InfoPath 获取重复表的Value

    看到很多人需要,所以我写下来。。
   在以下示例中,将使用 SelectNodes(XPathNavigator,XPathNavigator,String) 方法选择绑定到 group2 的“重复表”控件的第一行中的节点。然后使用 GetContextNodes 方法基于当前所选项和指定节点返回上下文节点的集合。最后,代码将遍历上下文节点的集合,并显示每个节点的名称、内部 XML 和值。

// Create XPathNavigator and specify XPath for nodes.
XPathNavigator repeatingTableRow1 = MainDataSource.CreateNavigator().SelectSingleNode(
   "/my:myFields/my:group1/my:group2[1]", NamespaceManager);

// Select nodes in specified XPathNavigator.
CurrentView.SelectNodes(repeatingTableRow1,repeatingTableRow1,"CTRL5");

// Get context nodes in selection.
XPathNodeIterator contextNodes = CurrentView.GetContextNodes(repeatingTableRow1,"CTRL5");

// Loop through collection and display information.
foreach (XPathNavigator contextNode in contextNodes)
{
   MessageBox.Show(contextNode.Name);
   MessageBox.Show(contextNode.InnerXml);
   MessageBox.Show(contextNode.Value);
}

很简单就获取到重复表的Value..
希望对各位有帮助。。。

本文代码 。。来之MSDN。。 。

posted @ 2008-05-07 14:55 A A 阅读(129) | 评论 (3)编辑