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
  • Anonymous Users In SharePoint

     If you want to set permission as anonymous user in sharepoint may be you can see this articles

    http://blogs.devhorizon.com/reza/?p=498 

    http://www.sharepointplatform.com/teamblog/Lists/Posts/Post.aspx?List=427bfca2-b731-4c19-87c6-83c90460e02c&ID=29


     

    Share this post: | | | |
  • SharePoint Interview Questions

    Check this out this link : http://sharepoint-interview-questions.blogspot.com/.

    Share this post: | | | |
  • K2Helper

    using System;
    using System.Collections;  
    using System.Collections.Generic;
    using System.Text;
    using System.Data;
    using SourceCode.Workflow.Client;
    using SourceCode.Workflow.Common;
    using SourceCode.Workflow.Runtime;  
     
    namespace MyCommon
    {
        /// <summary>
        /// K2Helper Class
        /// </summary>
        public class K2Helper: IDisposable
        {
            private string serverName = string.Empty;
            private SourceCode.Workflow.Client.Connection conn = null;
            private string errorMessage = string.Empty;
            private SourceCode.Workflow.Client.User user = null;       

            /// <summary>
            /// Initializes a new instance of the <see cref="K2HelperClient"/> class.
            /// </summary>
            /// <param name="ServerName">Name of the server.</param>
            public K2Helper(string ServerName)
            {
                serverName = ServerName;
                try
                {
                    Open();
                }catch (Exception ex)
                {
                    errorMessage = ex.Message + "," + ex.Source;
                }
            }

            /// <summary>
            /// Gets the name of the server.
            /// </summary>
            /// <value>The name of the server.</value>
            public string ServerName
            {
                get { return serverName; }
            }

            /// <summary>
            /// Gets the user.
            /// </summary>
            /// <value>The user.</value>
            public User User
            {
                get { return conn.User; }
            }

            /// <summary>
            /// Gets the error message.
            /// </summary>
            /// <value>The error message.</value>
            public string ErrorMessage
            {
                get { return errorMessage; }
            }

            /// <summary>
            /// Gets the conn.
            /// </summary>
            /// <value>The conn.</value>
            public SourceCode.Workflow.Client.Connection K2Conn
            {
                get
                {
                    Open();
                    return conn;
                }

                set { conn = value; }
            }

            /// <summary>
            /// Opens this instance.
            /// </summary>
            private void Open()
            {
                if (string.IsNullOrEmpty(serverName)) serverName = "localhost";  
                if (conn == null)
                {
                    conn = new Connection();
                    conn.Open(serverName);
                }
            }

            /// <summary>
            /// Impersonates the user.
            /// </summary>
            /// <param name="userName">Name of the user.</param>
            public void ImpersonateUser(string userName)
            {
                Open();
                conn.ImpersonateUser(userName);   
            }
            
            /// <summary>
            /// K2s the server event finish.
            /// </summary>
            /// <param name="k2SN">The k2 SN.</param>
            /// <returns></returns>
            public bool K2ServerEventFinish(string k2SN)
            {
                SourceCode.Workflow.Client.ServerItem k2ServerItem=null;    
                bool sts=false;
                try
                {
                    Open();
                    k2ServerItem = conn.OpenServerItem(k2SN);
                    k2ServerItem.Finish();
                    sts = true;
                }
                catch (Exception ex)
                {
                    errorMessage = ex.Message + "," + ex.Source;
                }
                finally
                {
                    k2ServerItem = null;
                }
                return sts;
            }
                    

            /// <summary>
            /// Starts the process instance.
            /// </summary>
            /// <param name="processName">Name of the process.</param>
            /// <param name="param">The param.</param>
            /// <returns></returns>
            public ProcessInstance StartProcessInstance(string processName, Hashtable param)
            {
                ProcessInstance instance = null;
                try
                {
                    Open();
                    instance = conn.CreateProcessInstance(processName);
                    IDictionaryEnumerator list = param.GetEnumerator();
                    while (list.MoveNext())
                    {
                        instance.DataFields[list.Key.ToString()].Value = list.Value;
                    }
                    conn.StartProcessInstance(instance);
                }
                catch (Exception ex)
                {
                    errorMessage = ex.Message + "," + ex.Source;
                }
                return instance;
            }

            /// <summary>
            /// Redirects the work list item.
            /// </summary>
            /// <param name="item">The item.</param>
            /// <param name="userName">Name of the user.</param>
            /// <returns></returns>
            public bool RedirectWorkListItem(WorklistItem item,string userName)
            {
                bool sts = false;
                try
                {
                    if (item == null)
                    {
                        errorMessage = "WorklistItem is null";
                        return false;
                    }
                    item.Redirect(userName);  
                }
                catch (Exception ex)
                {
                    errorMessage = ex.Message + "," + ex.Source;
                }
                return sts;
            }

            /// <summary>
            /// Gets the work list item.
            /// </summary>
            /// <param name="k2SN">The k2 SN.</param>
            /// <returns></returns>
            public WorklistItem GetWorkListItem(string k2SN)
            {
                Open();
                WorklistItem item = conn.OpenWorklistItem(k2SN, "ASP", true, true);
                return item;
            }

            /// <summary>
            /// Gets the server item.
            /// </summary>
            /// <param name="k2SN">The k2 SN.</param>
            /// <returns></returns>
            public ServerItem GetServerItem(string k2SN)
            {
                Open();
                ServerItem item = conn.OpenServerItem(k2SN);
                return item;
            }

            /// <summary>
            /// Creates the work list data table.
            /// </summary>
            /// <returns></returns>
            private DataTable CreateWorkListDataTable()
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Folio");  
                dt.Columns.Add("ProcInstID");
                dt.Columns.Add("StartDate");
                dt.Columns.Add("SerialNumber");
                return dt;
            }

            /// <summary>
            /// Gets the work list data table.
            /// </summary>
            /// <param name="list">The list.</param>
            /// <returns></returns>
            public DataTable GetWorkListDataTable(Worklist list)
            {
                DataTable dt = null;
                if (list != null && list.Count > 0)
                {
                    dt = CreateWorkListDataTable();
                    foreach (WorklistItem item in list)
                    {
                        DataRow dr = dt.NewRow();
                        dr["Folio"] = item.ProcessInstance.Folio;
                        dr["ProcInstID"] = item.ProcessInstance.ID;
                        dr["StartDate"] = item.ProcessInstance.StartDate;
                        dr["SerialNumber"] = item.SerialNumber;  
                    }
                }
                return dt;
            }

            /// <summary>
            /// Gets the work list.
            /// </summary>
            /// <returns></returns>
            public Worklist GetWorkList()
            {
                Open();
                Worklist list = conn.OpenWorklist();
                return list;
            }

            /// <summary>
            /// Gets the work list.
            /// </summary>
            /// <param name="criteria">The criteria.</param>
            /// <returns></returns>
            public Worklist GetWorkList(WorklistCriteria criteria)
            {
                Open();
                Worklist list = conn.OpenWorklist(criteria);
                return list;
            }

            /// <summary>
            /// Gets the work list.
            /// </summary>
            /// <param name="processName">Name of the process.</param>
            /// <returns></returns>
            public Worklist GetWorkListByProcessName(string processName)
            {
                WorklistCriteria criteria = new WorklistCriteria();
                criteria.AddFilterField(WCField.ProcessName, WCCompare.Equal, processName);
                return GetWorkList(criteria);   
            }

            /// <summary>
            /// Gets the work list by folio.
            /// </summary>
            /// <param name="folio">The folio.</param>
            /// <returns></returns>
            public Worklist GetWorkListByFolio(string folio)
            {
                WorklistCriteria criteria = new WorklistCriteria();
                criteria.AddFilterField(WCField.ProcessFolio, WCCompare.Equal, folio);
                return GetWorkList(criteria);  
            }


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

            /// <summary>
            /// Gets the k2 manager.
            /// </summary>
            /// <returns></returns>
            public SourceCode.K2Mng.K2Manager GetK2Manager()
            {
                SourceCode.K2Mng.K2Manager mgr = new SourceCode.K2Mng.K2Manager();
                try
                {
                    mgr.Login(serverName, 5252, "");
                }
                catch (Exception ex)
                {
                    throw new Exception("Access to K2 Server denied!", ex);
                }
                return mgr;
            }

            /// <summary>
            /// Gets all work list items.
            /// </summary>
            /// <param name="dtStart">The dt start.</param>
            /// <param name="dtEnd">The dt end.</param>
            /// <param name="destination">The destination.</param>
            /// <param name="processName">Name of the process.</param>
            /// <param name="activityName">Name of the activity.</param>
            /// <param name="eventName">Name of the event.</param>
            /// <param name="folio">The folio.</param>
            /// <returns></returns>
            public SourceCode.K2Mng.WorkListItems GetK2MngAllWorkListItems(DateTime dtStart, DateTime dtEnd, string destination, string processName, string activityName, string eventName, string folio)
            {
                SourceCode.K2Mng.WorkListItems list;
                SourceCode.K2Mng.K2Manager mgr = this.GetK2Manager();
                list = mgr.GetWorkListItems(dtStart, dtEnd, destination, processName, activityName, eventName, folio);    
                mgr.Logout();
                return list;
            }

            /// <summary>
            /// Gets the k2 MNG all work list items.
            /// </summary>
            /// <param name="dtStart">The dtStart.</param>
            /// <param name="dtEnd">The dtEnd.</param>
            /// <returns></returns>
            public SourceCode.K2Mng.WorkListItems GetK2MngAllWorkListItems(DateTime dtStart, DateTime dtEnd)
            {
                SourceCode.K2Mng.WorkListItems list;
                SourceCode.K2Mng.K2Manager mgr = this.GetK2Manager();
                list = mgr.GetWorkListItems(dtStart, dtEnd, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty);
                mgr.Logout();
                return list;
            }

            /// <summary>
            /// Gets all process instances.
            /// </summary>
            /// <returns></returns>
            public SourceCode.K2Mng.ProcessInstances GetK2MngAllProcessInstances()
            {
                SourceCode.K2Mng.ProcessInstances list;
                SourceCode.K2Mng.K2Manager mgr = this.GetK2Manager();
                list = mgr.GetProcessInstances();
                mgr.Logout();
                return list;
            }
     

            /// <summary>
            /// Closes this instance.
            /// </summary>
            public void Close()
            {
                if (conn != null)
                {
                    conn.Close();
                }
                conn = null;  
            }



            /// <summary>
            /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
            /// </summary>
            public void Dispose()
            {
                serverName = string.Empty;
                errorMessage = string.Empty;
                Close();
                GC.Collect();
            }
        }
    }

    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