Geeks Portal

From developers, to developers and for developers.
Welcome to Geeks Portal Sign in | Join | Help
in Search

Agusto Xaverius P.S

Job:Toekang, bikin bugs, ... Motto:Belajar terusss.. dan terusss.
See also: Other Geeks@INDC
  • K2Helper

    using System;
    using System.Collections;
    using SourceCode.K2ROM;
    using System.Data;
    using System.Data.SqlClient;
    using System.Configuration;

    namespace K2ROM
    {
        /**//// <summary>
        /// Summary description for K2Helper.
        /// </summary>
        public class K2Helper
        {
            public K2Helper()
            {
                //
                // TODO: Add constructor logic here
                //
            }


            public static string GetConnectionString(string domain, string userName, string password)
            {
                return string.Format(@"[;];Authenication=Windows;Domain={0};User={1};Password={2}", domain, userName, "Dell1234");
            }


            /**//// <summary>
            /// Authenication
            /// </summary>
            public static string ConnectionString = "[;];Authenication=Windows;Domain=mstech;User=administrator;Password=Satyam123241";


            /**//// <summary>
            /// Getting the K2 server name.
            /// </summary>
            public static string ServerName = ConfigurationManager.AppSettings["K2Server"].ToString();


            /**//// <summary>
            /// Start a process instance in k2 server.
            /// </summary>
            /// <param name="processName">Process name</param>
            /// <param name="param">Process instance data,stored as a hashtable</param>
            /// <returns>Return process instance</returns>
            public static ProcessInstance StartProcessInstance(string processName, Hashtable param)
            {
                Connection con = new Connection();

                con.Open(ServerName);
                ProcessInstance instance = con.CreateProcessInstance(processName);
                IDictionaryEnumerator list = param.GetEnumerator();
                while (list.MoveNext())
                    instance.DataFields[list.Key.ToString()].Value = list.Value;
                con.StartProcessInstance(instance);
                con.Close();
                return instance;

            }
            /**//// <summary>
            /// Submit the result to K2 server.
            /// </summary>
            /// <param name="item">WorklistItem</param>
            /// <param name="isSubmit">Stop or Finish</param>
            /// <returns></returns>
            public static bool UpdateWorkItem(WorklistItem item, bool isSubmit)
            {
                if (item == null)
                    throw new NullReferenceException("WorklitItem item is null!");

                if (isSubmit)
                    item.Finish();
                else
                    item.Update();
                return true;
            }


            /**//// <summary>
            /// Redirect the work item to specified person.
            /// </summary>
            /// <param name="item"></param>
            /// <param name="userName"></param>
            /// <returns></returns>
            public static bool RedirectWorkItem(WorklistItem item, string userName)
            {
                if (item != null)
                {
                    item.Redirect(userName);
                    return true;
                }
                return false;
            }


            /**//// <summary>
            /// Get WorklistItem by serialnumber.
            /// </summary>
            /// <param name="serialNumber"></param>
            /// <returns></returns>
            public static WorklistItem GetWorkistItem(string serialNumber)
            {
                Connection con = new Connection();
                con.Open(ServerName);

                WorklistItem item = con.OpenWorklistItem(serialNumber, "ASP");
                return item;

            }

            /**//// <summary>
            /// Open a server item
            /// </summary>
            /// <param name="serialNumber"></param>
            /// <returns></returns>
            public static ServerItem GetServerItem(string serialNumber)
            {
                Connection con = new Connection();
                con.Open(ServerName);
                return con.OpenServerItem(serialNumber);
            }


            /**//// <summary>
            /// convert worklist to dataset
            /// </summary>
            /// <param name="list"></param>
            /// <returns></returns>
            public static DataTable GetWorklistDataTable(Worklist list)
            {
                if (list == null || list.Count == 0)
                    return null;
                DataTable dt = CreatWorkListTable();
                foreach (WorklistItem item in list)
                {
                    DataRow dr = dt.NewRow();
                    dr["ProcInstID"] = item.ProcessInstance.ID;
                    dr["StartDate"] = item.ProcessInstance.StartDate;
                    dr["SerialNumber"] = item.SerialNumber;
                    //The id implement alternant opration between K2 DB and Location DB.
                    dr["WorkItemID"] = item.ProcessInstance.DataFields["WorkItemID"].Value.ToString();
                    dt.Rows.Add(dr);

                }
                return dt;
            }

            /**//// <summary>
            /// Creat a datatable to store WorkList.
            /// </summary>
            /// <returns></returns>
            public static DataTable CreatWorkListTable()
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("ProcInstID");
                dt.Columns.Add("StartDate");
                dt.Columns.Add("SerialNumber");
                dt.Columns.Add("WorkItemID");
                return dt;
            }

            /**//// <summary>
            /// Get Worklist by criteria.
            /// </summary>
            /// <param name="criteria"></param>
            /// <returns></returns>
            public static Worklist GetWorklist(WorklistCriteria criteria)
            {
                Connection con = new Connection();
                con.Open(ServerName);
                return con.OpenWorklist(criteria);
            }

            /**//// <summary>
            /// Get Worklist by process name.
            /// </summary>
            /// <param name="processName"></param>
            /// <returns></returns>
            public static Worklist GetWorklist(string processName)
            {
                WorklistCriteria criteria = new WorklistCriteria();
                criteria.AddFilterField(WCField.ProcessName, WCCompare.Equal, processName);
                return GetWorklist(criteria);
            }

            /**//// <summary>
            /// Get Worklist by process name and activity name.
            /// </summary>
            /// <param name="processName"></param>
            /// <param name="activityName"></param>
            /// <returns></returns>
            public static Worklist GetWorklist(string processName, string activityName)
            {

                WorklistCriteria criteria = new WorklistCriteria();
                criteria.AddFilterField(WCField.ProcessName, WCCompare.Equal, processName);
                criteria.AddFilterField(WCField.ActivityName, WCCompare.Equal, activityName);
                return GetWorklist(criteria);
            }

            /**//// <summary>
            /// Stop a process instance by process ID.
            /// </summary>
            /// <param name="ProcessID"></param>
            /// <returns></returns>
            public static bool StopProcessInstance(int ProcessID)
            {
                SourceCode.K2Mng.K2Manager mgr = K2Helper.GetK2Manager();
                bool flag = mgr.StopProcessInstances(ProcessID);
                mgr.Logout();
                return flag;
            }

            /**//// <summary>
            /// Access K2 service as admin.
            /// </summary>
            /// <returns></returns>
            public static SourceCode.K2Mng.K2Manager GetK2Manager()
            {
                SourceCode.K2Mng.K2Manager mgr = new SourceCode.K2Mng.K2Manager();
                try
                {
                    mgr.Login(ConfigurationManager.AppSettings["K2Server"], int.Parse(ConfigurationManager.AppSettings["K2AdminPort"]), ConfigurationManager.AppSettings["K2AdminConnectionString"]);
                }
                catch (Exception ex)
                {
                    throw new Exception("Access to K2 Server denied!", ex);
                }
                return mgr;
            }
        }
    }

    This code i got from this link http://www.cnblogs.com/lovemyth/archive/2007/07/13/817318.html

     

    Share this post: | | | |
    Posted Jul 07 2008, 02:27 PM by agusto with 1 comment(s)
    Filed under:
  • Host Server Performance Tweaks for K2 [blackpearl] SP1 and earlier

    Just some small tips here to help boost the performance of the Host Server.

    In the following config files in C:\Program Files\K2 blackpearl\Host Server\Bin

    • DependancyService.config
    •  SourceCode.Categories.Runtime.config
    • SourceCode.EventBus.ClientRecorder.dll.config
    • SourceCode.Workflow.Runtime.Management.config
    • SourceCode.Workspace.Runtime.config

    Look for a ConnectionString key value. This stores the SQL connection string to the database. In the connection string, change the pooling value from False to True. It would also be a good idea to make a backup of the config files if you don't really know what you are doing. :)

    Restart your Host Server to get the changes to take effect. And presto! you should see a faster Host Server. Note that this should be already fixed in the new 0803 build that should be released soon (plus a whole host of other fixes and performance enhancements).

    For detail about this information you can click on this link http://www.k2underground.com/blogs/johnny/archive/2008/04/15/host-server-performance-tweaks-for-k2-blackpearl-sp1-and-earlier.aspx

    Share this post: | | | |
    Posted Jun 16 2008, 11:33 AM by agusto with no comments
    Filed under:
  • WSS Tips on Trick - 02

    How to create a RichTextBox on WSS 3.0 / Moss. Ho ho... is so easy you don't have to used other control or third party to implement this.

    I will give you a example and code how to implement RichTextBox on the WSS 3.0.

    <textarea name="txtTextArea1" rows="6" cols="20" id="txtTextArea1" title="Body123" class="ms-long" ></textarea>
    <script language="javascript" type="text/javascript">

    RTE_ConvertTextAreaToRichEdit("txtTextArea1", true, false, "", "1033", null, null, null, null, null,"FullHtml", "\u002f",null,null,null,null);   

    </script>

    and then in your page you will get this:

     http://geeks.netindonesia.net/photos/agusto/images/50049/500x375.aspx

    Note : make sure that your page is included with this javascript :

    <script type="text/javascript" language="javascript" src="/_layouts/1033/form.js"></script>

    Share this post: | | | |
  • Install WSS 3.0 and WSS 2.0 in one machine

     Hari ini 28 Mei 2008 tepatnya jam17.30 sore sampai ke tempat salah satu client perusahaan saya bekerja. Client kami ini sudah kami lewati masa installasi di semua cabang untuk melakukan transaksi dengan aplikasi kami di pusat dengan server dummy kami dan sekarang sudah untuk masuk fase go live. 

    Untuk dapat menjaga jaga kejadian bahwa nanti installasi WSS 3.0 dan segala aplikasi gagal, client mengharuskan bahwa WSS 2.0 dan aplikasi eksisting harus masih ada.

     

    Hal-hal yang perlu di lakukan untuk install WSS 3.0 dan WSS 2.0 di satu mesin adalah :

    1. Install Windows 2003 SP1/SP2.

    2. Install .net 2.0 dan .Net 3.0

    3. Install WSS 2.0 SP2

    4. Install WSS 3.0

     

    Semoga hari ini berhasil install semua dengan mulus 

     

    Share this post: | | | |
  • How to install Windows SharePoint Services 3.0 SP1 on Vista x64/x86

  • (Almost) Everything In Active Directory via C#

    I got this link from this link http://www.codeproject.com/KB/system/everythingInAD.aspx#42 and i decide it to post to my blog for remind me about this article.

     

    Hope it can used later.

     

    Share this post: | | | |
    Posted May 23 2008, 01:04 PM by agusto with no comments
    Filed under:
  • Most Useful 20+ Visual Studio Add-ins

     This is the list of the Visual Studio Add-ins, most of which are open source or free. I hope this list will help you to code more faster and effective. If there is not your favorite add-in in the below list, do not hesitate to add it as a comment.

    • TestDriven.NET - makes it easy to run unit tests with a single click, anywhere in your Visual Studio solutions. It supports all versions of Microsoft Visual Studio .NET and it integrates with the best .NET development tools including NCover, NCoverExplorer, Reflector, TypeMock, dotTrace, NUnit, MbUnit, ZaneBug, MSBee & Team System.
    • AnkhSVN - is a Visual Studio .NET addin for the Subversion version control system. It allows you to perform the most common version control operations directly from inside the VS.NET IDE. Not all the functionality provided by SVN is (yet) supported, but the majority of operations that support the daily workflow are implemented.
    • C# Refactory - performs a large number of refactorings, allowing you to re-shape your c-sharp code as needs arise. Refactoring is an essential part of the extreme programming development approach. C# refactory enables you to automate many refactorings thus increasing the reliability and speed with which you can refactor your c-sharp code.
    • GhostDoc - is a free add-in for Visual Studio that automatically generates XML
      documentation comments for C#. Either by using existing documentation inherited
      from base classes or implemented interfaces, or by deducing comments from
      name and type of e.g. methods, properties or parameters.
    • SharpTools is an extensible add-in to the Microsoft Visual Studio.NET development environment, and a software development kit (SDK) supporting the rapid development of further extensions which will run within SharpTools.
    • Google Plugin - Search Google from Visual Studio .NET
    • Resource Refactoring Tool - provides developers an easy way to extract hard coded strings from the code to resource files.
    • BIDS Helper - A set of VS.Net add-ins that extend and enhance the functionality of the SQL Server BI Development Studio.
    • Power Toys for Visual Studio - are small tools that provide aid to developer pain-points or assist in diagnosing development-related issues. In addition to providing support, the power toys are released as Microsoft Shared Source to provide sample code to real-world solutions and allow for collaborative-development.
    • Koders IDE - enable software developers to perform Koders searches directly from within the Eclipse or Visual Studio development environments by extending the reach of the Koders.com open source code index to the desktop.
    • Codekeep - Once you've downloaded and installed a CodeKeep add-in, you can manage your code snippets and search for other code snippets without ever having to leave Visual Studio.
    • CodeShare - Add-in is a Visual Studio.NET plugin for sharing code snippets in an enterprise. It provides menu options within the IDE to contribute and find code snippets from a central repository.
    • RSS Blog Reader - open source add-in and a full-featured RSS / Blog aggregator which integrates into the familiar dockable panes of the Visual Studio.NET IDE.
    • csUnit is a free and open source unit testing tool for the .NET Framework. csUnit works with all .NET languages including C#, Visual Basic .NET, J#, and managed C++. It comes with a choice of command line, graphical user interface, and an addin for Visual Studio.
    • Oracle Developer Tools for Visual Studio .NET - The Oracle Developer Tools for Visual Studio .NET (ODT) is a tightly integrated Add-in for Microsoft Visual Studio. Features are generate SQL scripts for Oracle schema, generate ASP.NET web applications with very little coding required, drag and drop and automatically generate .NET code, seamlessly step from your .NET code into your PL/SQL stored procedure code and back out again, etc...
    • WSCF - A Free Visual Studio Add-In and Command Line Tool for ImprovedSchema-Based Contract-First Web Services Design and Programming
    • ZipStudio - provides a means of zipping up complete or partial Visual Studio solutions and projects and associated files, directly from in Visual Studio itself.
    • MySQL Developer Tools is a powerful add-in designed to simplify the MySQL database application development process. It integrates into Visual Studio and Delphi, making all database development and administration tasks available from your favorite IDE. It provides an easier way to explore and maintain existing databases, design compound SQL statements, query and manipulate data in different ways.
    • Comment Reflower - is an Add-in for Visual Studio 2003 and 2005 to reflow the text in comments in source files to have even word wrapping. It does more than simply just wrapping all text in comment blocks.
    • VSCmdShell - provides users with a shell window inside the Visual Studio IDE that can be used for Visual Studio commands as well. Current version allows user to use either Windows Command Shell (cmd.exe) or Windows PowerShell.
    • IBM Database Add-ins - development Add-In and managed provider for the Microsoft .NET platform includes RAD features, DB2 database project, scripting wizards, and CLR stored procedures to simplify building DB2 applications using Visual Studio .NET.
    • VSdocman is a tool for commenting and the quick automatic generation of class documentation from your C# and VB .NET source code files. It is ideal tool for you if you create .NET component, control, application, smart device or web site (ASP .NET) projects
    • CopySourceAsHtml - An add-in for Microsoft Visual Studio 2005 that allows you to copy source code, syntax highlighting, and line numbers as HTML. CSAH uses Visual Studio's syntax highlighting and font and color settings automatically.
    • Codexchange - is an Visual Studio.NET add-in providing you with instant integrated access to an online repository of ready to use .NET code snippets
    • ADO.NET Express - is an add-in for Visual Studio 2003 that automates common tasks of writing repetitive data access code. ADO.NET Express generates class methods for calling stored procedures and executing common types of SQL statements.
    • VSTypeFinderAddin - for Visual Studio 2005 provides the possibility to search for all classes, structs, enums and delegates in a solution.
    • AopDotNetAddIn - is a Visual Studio AddIn that provides the aspect oriented capabilities to the .Net languages (C#,VB.Net,J#), this AddIn was developed as a graduation project
    • Reflector is the class browser, explorer, analyzer and documentation viewer for .NET. Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL.
    [Updated 25/07/2007]
    • DPack– Free collection of VS .NET 2003 and 2005 tools. Brings tools designed for greatly increase developer’s productivity, automate repetitive processes and expand upon some of VS features.
    • Regionerate (pronounced ri-jeh-neh-rate) is a new open-source tool for developers and team leaders that allows you to automatically apply layout rules on C# code.
    • Consolas is intended for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for personal and business correspondence. Optimizing the font specifically for ClearType allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortable reading of extended text on-screen.
    • Project MRU Cleaner Add-In
    • Explore In Windows Add-In for Visual Studio 2005
    Resources and Articles on Visual Studio Add-in
    for detail info you can click on this link : http://www.plentyofcode.com/2007/07/most-useful-top-15-visual-studio-add.html
    Share this post: | | | |
  • Backup Script K2 BlackPearl Database

    It's important to backup K2's databases before you deploy any new workflows.  At the moment there isn't a tool to remove K2 BlackPearl Workflow Process definitions deployed to a server.
     
     
    Here this script to backup database k2 blackpearl :
     
    BACKUP DATABASE [Categories] TO DISK = N'D:\Backup_SQL\K2 DATABASE\Categories.bak' WITH NOFORMAT, NOINIT, NAME = N'Categories-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [Dependencies] TO DISK = N'D:\Backup_SQL\K2 DATABASE\Dependencies.bak' WITH NOFORMAT, NOINIT, NAME = N'Dependencies-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [EnvironmentSettings] TO DISK = N'D:\Backup_SQL\K2 DATABASE\EnvironmentSettings.bak' WITH NOFORMAT, NOINIT, NAME = N'EnvironmentSettings-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [EventBus] TO DISK = N'D:\Backup_SQL\K2 DATABASE\EventBus.bak' WITH NOFORMAT, NOINIT, NAME = N'EventBus-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [EventBusScheduler] TO DISK = N'D:\Backup_SQL\K2 DATABASE\EventBusScheduler.bak' WITH NOFORMAT, NOINIT, NAME = N'EventBusScheduler-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [HostServer] TO DISK = N'D:\Backup_SQL\K2 DATABASE\HostServer.bak' WITH NOFORMAT, NOINIT, NAME = N'HostServer-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [K2Server] TO DISK = N'D:\Backup_SQL\K2 DATABASE\K2Server.bak' WITH NOFORMAT, NOINIT, NAME = N'K2Server-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [K2ServerLog] TO DISK = N'D:\Backup_SQL\K2 DATABASE\K2ServerLog.bak' WITH NOFORMAT, NOINIT, NAME = N'K2ServerLog-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [K2SQLUM] TO DISK = N'D:\Backup_SQL\K2 DATABASE\K2SQLUM.bak' WITH NOFORMAT, NOINIT, NAME = N'K2SQLUM-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [SmartBox] TO DISK = N'D:\Backup_SQL\K2 DATABASE\SmartBox.bak' WITH NOFORMAT, NOINIT, NAME = N'SmartBox-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [SmartBroker] TO DISK = N'D:\Backup_SQL\K2 DATABASE\SmartBroker.bak' WITH NOFORMAT, NOINIT, NAME = N'SmartBroker-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [SmartFunctions] TO DISK = N'D:\Backup_SQL\K2 DATABASE\SmartFunctions.bak' WITH NOFORMAT, NOINIT, NAME = N'SmartFunctions-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [WebWorkflow] TO DISK = N'D:\Backup_SQL\K2 DATABASE\WebWorkflow.bak' WITH NOFORMAT, NOINIT, NAME = N'WebWorkflow-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    BACKUP DATABASE [Workspace] TO DISK = N'D:\Backup_SQL\K2 DATABASE\Workspace.bak' WITH NOFORMAT, NOINIT, NAME = N'Workspace-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
    GO
    Share this post: | | | |
    Posted May 21 2008, 01:52 PM by agusto with no comments
    Filed under:
  • Tips on Trick Wss 3.0 - 01

     Bila kita mempunyai suau SPListItem dimana item kita tersebut mempunyai field dengan type person / group untuk mendapatkan user tersebut kita bisa lakukan dengan 2 cara yaitu :

    public void GetUser()

    {

        SPUser user;

        string s;

        string [] split'

       using (SPSite site = new SPSite("http://portal"))

        {

                    using (SPWeb web = site.OpenWeb())

                    {

                        SPList list = web.Lists["Example For Users"];

                        SPListItem item = list.Items[0];

                         s =   item["User Name"];

                         split = s.split(';');

                         user = web.Users.GetByID(Convert.ToInt32(split[0]));

                    }

         }

    }

     

    atau dengan cara ini :

     

    public void GetUser()

    {

     

    using (SPSite site = new SPSite("http://portal"))

                {

                    using (SPWeb web = site.OpenWeb())

                    {

                        SPList list = web.Lists["Example For Users"];

                        SPListItem item = list.Items[0];

     

                        SPFieldUserValue userValue = new SPFieldUserValue(web, item["User Name"].ToString());

                        if (userValue!=null)

                        {

                            user = userValue.user;

                        }

                    }

                }

     }

    Share this post: | | | |
  • Preventing deleting item on Wss/Moss 2007

    Tadi malam ngobrol ama client dan ada request untuk tidak bisa menghapus document yang di buat tetapi user tersebut punya hak akses untuk create document / upload document.

    Daripada pikir panjang untuk menghapus link delete item di context menunya akhirnya saya langsung memberikan solusi bila user tersebut delete item tersebut akan di berikan notifikasi "You don't have authorized to delete this item".

    Setelah client setuju akhirnya saya membuat event dan coding untuk handle event tersebut. 

    Coding sbb :


    using System;
    using System.Security.Permissions;
    using System.Runtime.InteropServices;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Security;
    using System.Diagnostics;
    using System.IO;
    using System.Configuration;

    namespace Agusto.Dms.SpEvent
    {
        [CLSCompliant(false)]
        public class MyItemEvent : SPItemEventReceiver
        {
            private SPWeb spWeb = null;
                  
            /// <summary>
            /// Initializes a new instance of the Microsoft.SharePoint.SPItemEventReceiver class.
            /// </summary>
            public MyItemEvent ()
            {
            }
                

            /// <summary>
            /// Synchronous before event that occurs before an existing item is completely deleted.
            /// </summary>
            /// <param name="properties">
            /// A Microsoft.SharePoint.SPItemEventProperties object that represents properties of the event handler.
            /// </param>
            [SharePointPermission(SecurityAction.LinkDemand, ObjectModel = true)]
            public override void ItemDeleting(SPItemEventProperties properties)
            {
                string LoginName = properties.UserLoginName;
                if (!LoginName.ToLower().Equals(@"sharepoint\system"))
                {
                    try
                    {
                        using (spWeb = new SPSite(properties.SiteId).OpenWeb())
                        {
                            SPUser user = spWeb.Users[LoginName];
                            if (!user.IsSiteAdmin)
                            {
                                properties.ErrorMessage = @"You don't have authorized to delete this item";
                                properties.Cancel = true;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        properties.ErrorMessage = ex.Message + "," + ex.Source;
                        properties.Cancel = true;
                    }
                }       
            }

           }
        }
    }

     

    Dengan code ini akhirnya user yang punya hak akses read/contributor tidak bisa delete item, tetapi system account dan account yang di set sebagi full control dari site akan bisa hapus item tersebut.

    Share this post: | | | |
  • Hello World! from Moss/Wss and WWF

    This is a good article how about to create a new workflow on moss/wss. For detail this info you can click this link http://aaronweiker.com/post/2008/03/Hello-World!-from-SharePoint-and-Windows-Workflow.aspx

    Share this post: | | | |
  • SharePoint Code Snippets

    This section provides code snippets that show general SharePoint centric code, such as that used in webparts or applications that tap into the object model (22 Snippets)

  • Access SharePoint User Information - This piece of code shows you how to access the current SharePoint Users information.
  • Create SharePoint Query - This is a small piece of code that shows you how to create a SharePoint query.
  • Creating A WebPart Menu Item - This snippet demonstrates a method that will allow you to specify a link in the webpart menu box (the context menu that you get with webparts). It is helpful when creating custom menu items for webparts, although appears to be deprecated in 3.0.
  • Determine If List Column Exists - This method is helpful if you need to determine whether a column in a list exists or not by passing in the column name as a string value. It is a helpful method when working with SharePoint field existence.
  • Determine if there are files and folders - This example shows you how to determine whether there are files or folders in a SharePoint asset. This is an asset existence method and can be used to prevent the overriding of other content.
  • Display A Users Role Collection - This snippet shows you how to display a particular users set of roles based on the user name parameter.
  • Display Site Collection Information - This method shows you how you can in a webpart display various pieces of information about a SharePoint site collection.
  • Example XSL Transformation - If you have an XSL document that you wish to apply to you webpart returns, you need a method to apply the XSL transformation.
  • Get a SharePoint Field By Its Name - This piece of code demonstrates how you could return a SharePoint field by passing in the name parameter.
  • Get A SharePoint List - This is a simple method that will add you in getting a SharePoint list from a site.
  • Get A Web Based On List Existence - This code sample demonstrates how to get a specific web based on a SharePoint list, returning the specific web. It also includes several layers of exception handling and various properties that can be set.
  • Get An XSL Filepath For WebParts - This method allows you to get an XSL File Path that you can use in your webparts. I find it useful if I am applying formatting to things that are generated out of the object model.
  • Get List View Items - This code sample provides method that will get the list items that are present in a SharePoint view.
  • Get the WebPart Qualifier - This method gets the webpart qualifier.
  • Getting A SharePoint Site Name - This piece of code shows you how to retrieve a SharePoint Site name after using the OpenWeb() method.
  • Insert Values Into The URL - This method will help you when you need to insert parameters into the URL string.
  • Load Lists Into Drop Down Control - This example shows how you could load all the lists in a web into a drop down control, for use in a toolpane or otherwise.
  • Open Up A Web Conditionally - This method shows you how you can open up a web conditionally based on pre-existing text, such as whether it exists in a text box in this specific example.
  • Progamatically Move List - This example shows you how to move a list within an arbitrary number of webs in SharePoint.
  • Redirect Users To Sites - This code snippet will allow you to redirect users to various sites based on their login.
  • Return Boolean If Flat Folder Structure - This example shows you how to return a boolean value if there is a flat folder structure present.
  • Show Whether A SharePoint Field Contains Metainformation - This is a small code sample that will show you how to determine whether a SharePoint field contains meta information.
  • for detail more snipset you can et on this link  http://weblogs.mysharepoint.de/mgreth/archive/2007/05/02/sharepoint-code-snippets.aspx

    Share this post: | | | |
  • Resources and tools for WSS 3 and MOSS 2007

    SDKs and development tools

    Revised and updated August 2007.
    The official SDK contains code samples references, and an Enterprise Content Management (ECM) starter kit.
    Also check the online version of the SDK that has community content (revised December 2007): http://msdn2.microsoft.com/en-us/library/ms550992.aspx
    Revised and updated August 2007.
    From Microsoft: The Windows SharePoint Services 3.0 software development kit (SDK) contains conceptual overviews, programming tasks, samples, and references to guide you in developing solutions based on Microsoft Windows SharePoint Services 3.0.
    The online version is available here (revised December 2007): http://msdn2.microsoft.com/en-us/library/ms441339.aspx
    (Visual Studio 2005 extensions for Windows SharePoint Services 3.0, Version 1.1)
    Visual Studio 2005 templates for list definitions, site definitions, web parts, list instance, list event handler, solution package editing.

    A user guide is also available for download.
    Description from Microsoft: Compatible with the released versions of the 2007 Microsoft Office system, Microsoft Windows Vista, and the .NET Framework 3.0 Runtime Components
    Provides developers with support for building workflow-enabled applications using Windows Workflow Foundation.
    If you are developing workflows for SharePoint in Visual Studio 2005 your will need this download as well as the WSS SDK (see above) which contains the Visual Studio 2005 template specific for SharePoint workflows.
    Update Visual Studio 2008: Visual Studio now contains the project templates and designer to create SharePoint Workflows, all integrated out of the box.

    Development helpers and add-ins for WSS and MOSS 2007

    A free tool for eased installation and deployment of SharePoint 2007 solution files (wsp) to a SharePoint server farm.
    Provided by Lars Fastrup from Mondosoft.
    Update: the source code has been released and can be download via CodePlex: http://www.codeplex.com/sharepointinstaller.
    CodePlex project that delivers Visual Studio 2005 projet template(s) that help you build solution and cabinet files and finally a .wsp file.
    There is one template available at this time but it is planned to have others in the future. Check back at the CodePlex URL above.
    I personally used this template to start learning about solution files and building the .wsp file. It is not yet a completely automated process but should get you nicely on the way.
    It uses post build events that call .VBS files to create the manifest.xml and cabinet ddf file.
    CodePlex project that delivers Visual Studio 2005 projet template(s) to facilitate Workflow development with ASPX forms.
    This project aims to provide you with RAD-tools for creating workflows in Microsoft Visual Studio 2005. The current installment contains templates for three types of ASP.NET workflow forms; the association form, the instantiation form and task forms. This will later be augmented with wizard based form creation to allow the feature definition, and task content types to be auto generated.
    Tool by Wouter van Vugt
    A SharePoint Solution Package (WSP) creation tool for WSS 3.0 & MOSS 2007
    This command line utility builds the cabinet ddf file, the manifest.xml and the .wsp file based on a folder structure that corresponds to the 12 hive.
    WSPBuilder Extensions ver. 1.0.0 now has:
    - Visual Studio Add-in.
    - Visual Studio Project and Item templates.
    - MSI Install package.
    - Supports Visual Studio 2005 and 2008.
    The SmartTemplates for SharePoint project delivers a collection of Visual Studio templates which allow developers to create a range of SharePoint customizations in a painless and professional fashion:
    write the web part code;
    generate a SharePoint Solution file (WSP) for easy deployment;
    generate a setup package for a wizard driven installation
    Another project by Jan Tielens, already famous with the creation of the SmartPart (see below).
    This System Tray utility shows you all the application pools for your IIS and allows you to recycle them via the click of a button. No need for an IISRESET or going to the IIS management console anymore.
    This tool can be downloaded on Spencer Harbar's site.
    This tool by Chris O'Brien helps you export sites, lists, etc using .cmp files (Content Migration Package). It allows you to select content to export via a treeview and import functionality by running the tool on the destination server. Currently in beta but worth checking out!
    The SharePoint web part which can host any ASP.NET web user control. Create your web parts without writing code!
    Supports ASP.NET Ajax.
    STSDEV is a proof-of-concept utility application which demonstrates how to generate Visual Studio project files and solution files to facilitate the development and deployment of templates and components for the SharePoint 2007 platform including Windows SharePoint Services 3.0 (WSS) and Microsoft Office SharePoint Server 2007 (MOSS). Note that the current version of the stsdev utility only supports creating projects with the C# programming language.

    Tools for WSS and MOSS 2007 (object browsers, CAML tools)

    A WSS3 and SharePoint object model explorer and management tool developed by Carsten Keutmann.
    Description from the download site:
    You can see objects composing its structure, get their properties by reflection, which can be very useful when you want to check if your code does what it should do. You can use also some advanced features like activate/deactivate SharePoint features, add/remove event receivers, manage your recycle bin.
    Another tool made available by Mondosoft. This tool was originally available for SharePoint 2003, this version is a recompile that does not yet offer any access to new functionalities like features and event handlers.
    This will become available later according to Lars :-)
    A free feature by Karine at U2U that helps you build, test and execute your CAML Queries (Collaborative Application Markup Language). Install as a custom action to build a CAML query via the interface and saves the query to a document library. The query is then available for use in your custom developments.
    Available also as a tool for SharePoint 2003.
    A browser for SharePoint 2007 that returns the CAML for lists and views.
    Copy the CAML from lists and queries and use it directly in your code. Great helper tool.
    This tool allows you to use a point and click interface to gather information such as search scopes and properties, type in search terms, and click a button to create both the search SQL syntax as well as the Xml document that is needed to run a query against MOSS. You can see results in plain text, structured Xml and now a dataset view. It supports FREETEXT and CONTAINS as well as wildcard searching. A very valuable tool for those trying to write custom SharePoint queries.
    A must have tool if you need to dig into parts of the WSS and MOSS classes.
    Reflector contains a decompiler, member and type search, XML documentation support.
    Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL.
    SUSHI is a powerful, user-friendly SharePoint application enabling you to accomplish common SharePoint administrative and development tasks. You can think of SUSHI as a Swiss army knife for SharePoint. What does the name SUSHI stand for?
    SUSHI = SharePoint Utility with a Smart, Helpful Interface
    Functionalities include: Copy a view from one SharePoint list to another; View all sites and lists a user has access to; Backup a site; Restore a site; Bulk site creation; and more.
    This project contains a complete deployable solution that allows you to manage custom event handlers in SharePoint Server 2007. The project includes the various various visual studio projects required to build and deploy such a solution.
    See also a complete article series about event handlers by Brian Wilson: blog series.
    Can't wait for the release of Visual Studio 2008 and start using LINQ? What about using LINQ queries for SharePoint?
    Bart De Smet is working on a tool for using LINQ with SharePoint. Looks promising! Currently in alpha. See also the team blog: http://community.bartdesmet.net/blogs/LINQtoSharePoint/.
    A command line tool that helps administrators to import user profile information into MOSS 2007. Create an XML file with the informaiton and the tool will import the user information into the MOSS profile properties.
    Another tool on CodePlex.
    Contributions from several Microsoft teams and MVPs to deliver useful tools and add-ons for SharePoint.
    At the time of writing two tools are available:
    - CopyTimer: A tool for measuring SharePoint performance.
    - Alert Pipeline: Creates ability to run custom code when alerts are triggered.

    Add-ons to site settings and central administration

    At this moment there is only one add-in for MOSS/WSS3 available: Event Receivers Manager. This add-in can be enabled via a site collection level feature. The feature activates a new link in the "Site Settings" which allows you to delete event handlers and add/edit new ones. A SharePoint solution is availalbe to install the functionality.
    More to come in the future. See El Blanco's blog: http://chrissyblanco.blogspot.com.
    A free add-on feature provided by Andrew Connell: the feature adds a new menu item to the Site Actions menu that lets you toggle into edit mode on (almost) any page.

    If you ever needed to get all the details on a list including the ID, properties, content types, site column IDs, and more this feature is for you. Check out the feature on Karine's blog.
    This CodePlex project provides a whole set of features that will definitely help you with adding functionality to the interface or administration tasks. Some examples: Print List (adds a "Print List" menu item to the "Actions" menu), Attach to debugger, Manage FBA Users (if you want an interface to edit ASP.NET membership users in SharePoint), Log viewer, Manage Configuration Modifications (to manage web.config changes), and many more.
    The SharePoint for Hosters community site on CodePlex contains relevant information for shared hosting solutions on WSS3.
    There is a Solution Kit available which leverages a couple of custom components built for WSS3:
    - SQL Forms Based authentication
    - Custom SharePoint Web Services
    - Custom SharePoint Web Parts
    - HTTP Module for URL redirection

    WCM tools and add-ons

    A collection of sample Field Controls for use within Publishing Sites built using Office SharePoint Server 2007's Web Content Management features.
    For the moment only the only control available is the MultimediaFieldControl v0.9 but more will be added.
    Andrew Connell's tool provides custom commands related to Web Content Management features in MOSS 2007 such as: generate content types, publish all, generate site columns.
    A collection of sample Web Parts for use within Publishing Sites built using Office SharePoint Server 2007's Web Content Management features.
    There are 3 web parts available at the moment: FAQWebPart, RandomFlashMovieWebPart v0.9 and ThumbnailWebPart v0.9.
    Override the default content query web part, and add advanced features such as context menus for the items, toolbar for lists (if the web part is connected to a single list) and so on.
    A set of utilities for MOSS 2007 publishing web sites. I particularly like the PropertyBagFeature feature that allows content authors to modify values within the property bag of pages, similar to the custom properties that were available in MCMS 2002.

    Site templates

    A set of 40 application templates ready to use on WSS 3. A bunch of ready to use scenarios including:
    - Project Tracking Workspace
    - Integrated Marketing Campaign Tracking
    - Help Desk
    - Bug Database
    - Event Planning
    - Lending Library
    - Case Management for Government Agencies
    Contains a set of templates, best practices and web parts for building community sites. Several templates and tools are available in the kit: - Enhanced Blog Edition
    - User Group Edition
    - CKS:Internet/Extranet Edition
    - Tag Cloud 1.0
    SharePoint Learning Kit is a SCORM 2004-conformant e-learning delivery and tracking application built as a Windows SharePoint Services 3.0 solution.

    SharePoint Designer 2007 tools and resources

    This CodePlex project provides custom workflow activities for SharePoint Designer. Some of the activities you can find:
    - Send Email with HTTP File attachment
    - Send Email with List Item attachments
    - Is User a member of a SharePoint group
    - Grant Permission on Item

    to more detail you can click this link http://www.katriendg.com/aboutdotnet/Resources-wss3-moss.aspx

     

     

    Share this post: