VS2010 편리한 기능 WSP 파일 복원

by will 11. February 2010 07:07

안녕하세요?

Will 입니다. 이번에는 VS2010 의 편리한 기능이 있어서 소개해 드리도록 하겠습니다 Moss2007을 개발 하셨던 분들은 .WSP파일을 기억

하시고 있을 것이라고 생각 합니다. 그런데 이런 파일들을 VS2010에서 자체적으로 압축을 풀고 Feature단위로 나뉘어서 Solution파일로

복원을 시켜주는 기능이 있습니다. 2007에서 개발 됬던 것들을 2010으로 converting시 매우 유용 하리라고 생각 합니다.

1. VS2010 에서 File -> New -> Project

2. Visual C# -> Sharepoint 0> 2010 -> Import SharePoint Solution Package

3. 배포할 서버 선택 -> Next

4. .wsp파일을 찾아서 선택해 달라는 내용입니다. -> Browser를 선택 해서 해당 파일을 선택

5. 파일을 선택 했으면은 Next

6. .wsp파일의 복원 파일들이 맞는지 체크를 해달라는 내용입니다. 체크를 확인 하고 Finish

7. 완료가 되면은 Success라는 팝업 창이 뜨고 파일들의 복원을 확인 할 수 있습니다.

Tags: ,

SharePoint

Moss 2007 백업 복원

by will 11. February 2010 06:51

안녕하세요?

Will 입니다. 이번에는 예전에 2007에서 백업과 복업시 했던 방법을 소개 하기 위해 쓰도록 하겠습니다.

기본적으로 Moss 2007에서는 stsadm을 사용해서 백업을 하고 복원을 하는 경우가 많습니다.

하지만 이툴로 설정을 하였을 시 에러가 나서 롤백을 하는 경우도 있는데요. 이럴때 참 난감합니다.

이럴때 쓰는 방법인데요. WebPart의 dll 및 파일들을 다 가지고 계시다면은 해당 백업 및 복원이 가능 한데요.

우선 삭제 하시기 전에 12폴더를 백업을 시켜 둡니다. 그리고 해당 필요한 DB (보통 SharePoint_80) 를 백업을 해둡니다.

그리고 복원해야 될 서버에 가서 Moss2007을 설치를 하시고 80으로 WebApplication만 만듭니다. 그리고 나서 사이트 모음을 만들지

마시고 아까 백업한 SharePoint_80.bak을 가지고 DB에 있는 아까 만든 WebApplication의 DB(처음 만드셧다면, SharePoint_80)를 덮어

씌웁니다. 그럼 기존에 있던 데이터들은 전체가 다 복원이 되고요 해당 웹파트 및 Feature들은 직접 기존에 설치 했던 되로 설치를 하면은

해당 사이트의 복원이 완료 됩니다.

궁금한 사항은 메일로 보내주시면은 정성스럽게 답변을 드리도록 하겠습니다.

Tags: ,

SharePoint

SharePoint 2010 사용자 권한 EventFiring

by will 11. February 2010 06:31

안녕하세요?

Will 입니다. 이번에는 다름이 아닌 SharePoint 2007에서 사용 하던 EventFiring에 대해서 쓰도록 하겠습니다.

기본적으로 리스트에 값들을 업데이트를 하고 내용을 채워 넣을 때 EventReceiver를 통해서 값들을 변경 하고 업데이트를 하고 하는데요.

이런경우 관리자가 아니면은 제약이 많은 경우가 많습니다. 그래서 SharePoint 2007에서는 해당 업데이트시 DisableEventFiring() 함수를 사용해서

권한의 제약을 풀고 업데이트를 하고 나서 EnableEventFiring() 함수를 사용해서 다시 권한의 제약을 활성화 하는 경우가 있는데요. SharePoint2010

에서는 해당 함수가 사라진것은 아닌데 경고창이 뜹니다. 해당 함수를 찾을 수 없다 등등..... 에러를 뿌리지는 않는데 해당 함수가 따로 변경 되었습니다.

 EventFirngEnabled 라는 속성으로 바뀌면서 해당 값에 True, False를 넣어 주면은 됩니다. 예로 들어서

EventFiringEnabled = false;

list.update();

EventFiringEnabled = true;

 

위와 같은 식으로 사용 하시면은 됩니다.

 

Tags: ,

SharePoint

SharePoint 2010 Microsoft.SharePoint.Publishing.dll 사용시 Error

by will 2. February 2010 07:16

안녕하세요? Will입니다.

이번에는 제가 Navigation의 기능을 쓰기 위해 Microsoft.SharePoint.Publishing.dll 을 사용 했는데 빌드 시 Error가 나타나서 해당 Error에 대한

해결 방안을 쓰도록 하겠습니다.  해당 dll이 존재 하지 않는 다는 황당한 문구의 Error입니다. 분명히 참조를 시켜놧는데요.....

Error 내용 : The type or namespace name 'Publishing' does not exist in the namespace 'Microsoft.SharePoint' (are you missing an assembly reference?) 

Warrings 에서 보니깐 해당 dll은 System.Web.DataVisualization 이라는 dll 의 어느 Class를 사용 해서 Error가 난듯 합니다.

Warrings : The primary reference "Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35". 

그래서 해당 Dll을 검색 하여서 찾으니 아래의 폴더에 있군요. C:\Program Files (x86)\Microsoft Chart Controls\Assemblies\System.Web.DataVisualization.dll

드라이브는 설치에 따라서 틀립니다. 해당 dll 을 참조 해주고 다시 빌드를 하니 에러가 사라지며 잘 사용 되네요.

그리고 옛날에 Silverlight.dll 사용시에도 에러가 낫엇는데 해당 dll을 참조 하면은 Error 가 사라집니다.

SharePoint 2010 Custom Action

by will 2. February 2010 06:14

안녕하세요? Will 입니다.

이번시간에는 Custom Action에 대해서 자료를 올려 보도록 하겠습니다. SDK에 올라와 있는 자료를 가지고 원래는 글을 쓸려고 하였으나.

SDK자료가 에러가 나는 관계로 간단히 Custom Action을 만들어 보도록 하겠습니다.

1. VS2010으로 Project에서 새로운 프로젝트를 생성 하도록 하겠습니다. SharePoint2010에 있는 ContentType을 생성 하도록 하겠습니다.

2. VS2010 의 Feature.xml의 이름과 ContentType에 있는 이름을 알아서 변경 합니다.

3. Elements.xml 파일의 내용을 채웁니다.

Location 은 상태라고 생각 하시면은 됩니다. View모드냐 Edit모드냐와 같이 상태 모드입니다.

RegistrationId 는 문서라이브러니냐 아님 일반 리스트(100)냐 등등과 같이 리스트 값들이 지정되어있습니다. 아래 소스는 문서라이브러리(101)로 설정 하엿습니다.

RegistrationType 은 리스트냐, ContentType 이냐 등과 같은 걸 정의하는 곳입니다.

Title은 이름 그대로 타이틀입니다.

UrlAction 은 해당 타이틀이 선택 될때 동작할 내용을 적어 넣는 것입니다. 이번에는 간단히 test라는 알러트 창을 띄우겟습니다.


<?xml version="1.0" encoding="utf-8"?>

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

  <CustomAction Id="Ribbon.Library.Actions.AddAButton"

   Location="ViewToolbar"

   RegistrationId="101"

   RegistrationType="List"

   Title="Add a Ribbon Button">

    <UrlAction Url="javascript:alert('test');"/>

  </CustomAction>

  </Elements> 

4. 내용을 채우고 나서 빌드를 하고 배포를 합니다.

SharePoint2010 SDK  의 내용 중 에러가 나는 곳이 CommandUIHandlers 안에 CommandUIHandler 의 프로파티 중 CommandScript 자체를

VS2010에서는 프로파티로 인식을 못합니다. 그래서 SDK는 에러가 납니다.

 소스는 아래에 첨부 합니다.

CustomAction.zip (37.64 kb)

Tags: ,

SharePoint

SharePoint 2010 Columns

by will 12. January 2010 08:26

안녕하세요?

Will입니다. 이번에는 저번에 2007에서 개발한 소스를 가지고 SharePoint 2010 에서 다시 사용 할 수 있는지

체크를 해보도록 하겠습니다.

VS2010 의 Class Library를 사용해서 만들어 보았습니다 밑에 포스팅 되어 있는 내용을 참고로 하시면은 됩니다.

그리고 나서 배포를 해보았습니다. 배포후 아래와 같은 결과 하면을 볼 수 있습니다.

결과 1) 새글 추가

 결과2) 내용을 채우 겠습니다.

결과 3) 내용을 쓰면은 0의 값이 들어 가는걸 확인 할 수 있을 것입니다. 

 결과 4) 그리고 나서 DisplayMode에서 확인한 결과 버튼이 잘나오네요.

 결과 5)버튼을 클릭 해 보았습니다.

 

결과 6) 그리고 닫으니.... 허걱 값이 안변하네요! 아마 중간에 확인을 눌렀을시 이벤트가 동작 해야 되는데 닫기를 눌럿더니 값이 안변한것 같습니다.

결과 7) 하지만 F5을 눌러 Refresh를 하니 아래와 같이 값이 들어가 있는 걸 확인 할 수 있습니다.  

SharePoint 2010은 ClientScript로 Ajax처리가 되어 있어서 값의 변화가 있을 시 제로드를 하기 때문에 기존의 값이 변하지 않는 것을 확인 할 수 있습니다.

하지만 자체 DB에 저장되어 있는 값은 +1이 되어 있는 것을 확인 할 수 있습니다.  해당 문제에 대해서는 조금 더 SharePoint 2010을 분석한 후에 추후에

수정 하도록 하겠습니다.  밑에 SharePoint 2010 개발 소스를 올립니다. 참고 하시고 소스에는 주석으로 저희 사이트 이름을 소스에 꼭 넣어서 사용해 주시기 바랍니다.

 질문은 메일로 보내주시거나 코멘트를 다시면은 답변을 드리도록 하겠습니다.

 

SPNote.SharePoint.Fields.zip (38.15 kb)

Tags: ,

SharePoint

SharePoint Object Model

by will 3. January 2010 05:21

안녕하세요?

Will 입니다.

이번에는 SharePoint2010 OM에 대해서 내용을 적기로 하겠습니다.

우선 OM(Object Model) SharePoint2010에서는 사용자 단에서 즉 클라이언트 단에서 돌아 갈 수 있도록 dll로 정의가 되어 있는데요, Windows 응용프로그램, Consol 응용프로그램, Silverligth 응용프로그램 그리고 Javascript 에서 클라이언트 스크립팅으로 사용을 할 수 있습니다.

 

1 .Clinet Object Model

 우선 VS2010으로 Window응용프로그램을 만들도록 하겠습니다. 응용프로그램을 만드실 때 .net 3.5를 베이스로 해주시고 만드시면은 되겠습니다.

그리고 폼에 각각의 컨트롤들을 그림과 같이 배치 하시면은 되겠습니다.

컨트롤

ID

Event

Text Box

txtUrl

 

List Box

lstCollection

 

Button

btnSearch

btnSearch_Click
  

 

그런 다음 참조를 통해서 C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI 해당 경로에 잇는 Microsoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll 을 추가해 줍니다.

  

그런 다음 해당 소스를 자신의 코딩에 맞춰서 넣습니다.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using Microsoft.SharePoint.Client;   

namespace SPNote.SharePoint.ObjectModel{   

public partial class ClientOM : System.Windows.Forms.Form    {       

public ClientOM()        {            

InitializeComponent();       

}        

private void btnSearch_Click(object sender, EventArgs e)        {           

//Create A Client Connection           

using (ClientContext clientCon = new ClientContext(txtUrl.Text))           

{                //Get the Site Collection               

Site csite = clientCon.Site;                

//Fill SharePoint Data               

clientCon.Load(csite);               

 clientCon.ExecuteQuery();                

lstCollection.Items.Add(csite.Url);                

//Get the Site                

Web cWeb = clientCon.Web;                

//Fill SharePoint Data               

clientCon.Load(cWeb);               

clientCon.ExecuteQuery();                 

lstCollection.Items.Add(cWeb.Title);                

//Load Lists               

clientCon.Load(cWeb.Lists);               

clientCon.Load(cWeb, x => x.Lists.Where(l => l.Title != null));               

clientCon.ExecuteQuery();                 

foreach (List list in cWeb.Lists)               

{                   

lstCollection.Items.Add(list.Title);               

}           

}       

}   

}//class

}//namespace  

그리고 실행을 하면은 해당 값들을 확인 할 수 있습니다.

  

 

2. ECMAScript Client Object Model

 Script단에서 SharePoint 컨트롤을 사용 할 수 있도록 정의가 되어 있는 것이다. 우선 Project를 새로 생성 하는데 SharePoint 의 빈 SharePoint 프로젝트를 선택하고 생성 한 다음 Applicationpage를 추가 한다. 그럼 Layouts 밑에 해당 페이지가 생성 되게 된다.

  

그리고 나서 해당 소스를 집어 넣고 돌려 본다. 첫번째 했던 ClientOM과 비슷한 소스 이다. 보고 이해 하시기 바랍니다. 그럼 해당 컨트롤을 통해서 Ajax처리가 되어서 해당 사이트의 타이틀을 읽어 올 수 있습니다.

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>

<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %><%@ Import Namespace="Microsoft.SharePoint" %><%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ECMAScript.aspx.cs" Inherits="EcmascriptClientOM.Layouts.EcmascriptClientOM.ECMAScript" DynamicMasterPageFile="~masterurl/default.master" %> 

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

<SharePoint:ScriptLink ID="SPScriptLink" runat="server" LoadAfterUI="true" Localizable="false" Name="sp.js" /> 

<script language="javascript" type="text/jscript" >   

function eClientOM(){       

var context = new SP.ClientContext.get_current();       

this.site = context.get_web();       

context.load(this.site);       

context.executeQueryAsync(Function.createDelegate(this,this.rSuceess),Function.createDelegate(this,this.rFailure));   

}    

function rSuceess(senger, args){       

alert("site title" + this.site.get_title());   

}       

function rFailure(sender, args){       

alert("Request failed " + args.get_message());   

}</script>

</asp:Content> 

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">   

<input type="button" onclick="eClientOM()" value="Ecmas" />

</asp:Content> 

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">Application Page</asp:Content> 

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >My Application Page</asp:Content>   

 

3. Silverlight Client Object Model

 해당 dll의 오류가 있어서 지금 작업은 하지 못하였으나 조만간 작업을 하여서 올리도록 하겠습니다.

 

좋은 한해 보내시고 질문 사항이 있으면은 메일을 주시거나 코멘트를 달아 주시면은 답변을 드리도록 하겠습니다.

 

  

SP.js (379.92 kb)

Tags: , ,

NetFramework

SharePoint 2010 설치

by Will 7. December 2009 11:16

안녕하세요?

Will입니다. 이번에는 SharePoint 2010의 설치에 대한 내용을 쓰도록 하겠습니다.

 기본적으로 Window2008 R2에 MSSQL2008 을 설치 하여서 SharePoint를 설치 하도록 하겠습니다.

1.SharePiont Server 2010 설치 파일을 더블 클릭 하면은 아래와 같은 화면이 나옵니다 Install -> Install software prerequisites 를 클릭하여서

SharePoint의 구성 시 필요한 사항들을 체크 및 설치를 합니다.

2.  해당 구성들을 확인 하기 위해서 넥스트.

3. 해당 설치 프로그램을 설치 할 수 있도록 I accept 체크 넥스트

 

4. 설치가 완료 되었으면은 완료.

5. 이제 본격적으로 SharePoint를 설치해 보도록 하겠습니다. Install -> Install SharePoint Server 클릭.

 6. SharePoint 2010 키를 입력 합니다. 그리고 계속 클릭.

7. License에 대한 동의를 하고 계속

8.  독립된 서버가 아닌 서버 팜으로 구성 하도록 하겠습니다. Server Farm 클릭.

9. Server Type에서 Stand - alone 이 아닌 전체를 설치 하도록 하겠습니다 Complete 선택 -> 지금 설치.

10. 클릭이 완료 되면은 지금 진행중인 화면이 나옵니다.

11.  설치가 완료 되었으며 이제 SharePoint의 구성이 남았습니다 Configuration Wizard를 선택한 상태에서 닫기를 선택.

12.  SharePoint를 구성 하기 위한 요건들 확인 후 넥스트

13. 해당 서비스들이 돌아 갈수 있도록 수락 Yes 클릭.

14. 현재 구성되어 있는 팜이 없으므로 Create a new server farm 체크 -> 넥스트.

15. DB정보와 사용자 아이디 및 비번을 넣고 넥스트.

16. 켁 에러가 나오네요.... 읽어 보니 SQL Server 2008 SP1 CU2를 설치 안했다는 에러 네요. SQL Server 2008 SP1 을 설치 하도록 하겠습니다

http://www.microsoft.com/downloads/details.aspx?FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19&displaylang=en <-- 해당 url에서 다운을 받고 설치.

17.  동의 하고 넥스트.

18. 전체 선택 후 (MSSQLSERVER는 무조건 되어있어야 함 안되있으면은. 취소 했다가 다시 클릭)-> 넥스트

 19. 파일 체크가 완료 되면은 넥스트 클릭.

20. 해당 구성 확인후 Update 클릭.

21. 설치가 성공 하면은 넥스트. -> 완료 화면 닫기 클릭.

22. 다시 시작 -> 모든프로그램 -> SharePoint 2010 -> Configuration Wizard 클릭 후 -> 12번에서 15번까지 다시 설정

켁;; 그래두 똑같은 에러가 ㅡㅡ  알아 보니 버젼이 틀려서 안되는 거였네;; 10.00.2714.00 찾기 위해서 해당 Url로 이동

http://support.microsoft.com/kb/970315

23. 해당 페이지가 나오면은 핫픽스 보기 및 다운로드 요청 하기 클릭.

 

 24. 약관의 동의 후 동의를 클릭.

25. 파일 이름에 x64 인지 체크 후 해당 파일 두개 선택 후 메일주소를 쓰면은 해당 파일을 다운 받을 수 있는 url경로와 압축 풀시 키값이 날라 온다.

26. 내용은 이렇다. 요기 라구 체크 한데서 다운을 받고 비밀 번호는 그 밑에 있는걸 쓰면은 해당 핫픽스를 다운 받을 수 있다.

IMPORTANT INFORMATION

For your convenience, we put the hotfix that you requested on an HTTP site. You can download the hotfix from this site without us filling up your e-mail inbox.

WARNING This hotfix has not undergone full testing. Therefore, it is intended only for systems or computers that are experiencing the exact problem that is described in the one or more Microsoft Knowledge Base articles that are listed in "KB Article Numbers" field in the table at the end of this e-mail message. If you are not sure whether any special compatibility or installation issues are associated with this hotfix, we encourage you to wait for the next service pack release. The service pack will include a fully tested version of this fix. We understand that it can be difficult to determine whether any compatibility or installation issues are associated with a hotfix. If you want confirmation that this hotfix addresses your specific problem, or if you want to confirm whether any special compatibility or installation issues are associated with this hotfix, support professionals in Customer Support Services can help you with that. For information about how to contact support, copy the following link and then past it into your Web browser:

http://support.microsoft.com/contactus/

For additional support options, please copy the following link and then paste it into your Web browser:

http://support.microsoft.com/

Before you install this hotfix
------------------------------

If you decide to install this hotfix, please note the following items:

Do not deploy a hotfix in a production environment without first testing the hotfix.

Back up the system or the computer that will receive the hotfix before you install the hotfix.

Additional hotfix information
-----------------------------

This hotfix package uses a password. Therefore, you must enter for each package the password that we included in this e-mail message. To make sure that you enter the correct password, we recommend that you highlight, copy, and then paste the password from this e-mail message when you are prompted. If you do not enter the correct password, you cannot install the hotfix.

NOTE Passwords are set to expire every seven days. Download the package within the next seven days to make sure that you can extract the files. If there are fewer than seven days left in the password change cycle when you receive this e-mail message, you receive two passwords. If this is the case, use the first password if you download the hotfix package before the date in the "Password Changes On" field that is listed in the table at the end of this e-mail message. Use the second password if you download the hotfix package after the date in the "Password Changes On" field.

NOTE For your convenience, we send the hotfix location to you in a hyperlink. To connect to this hotfix location, you can click the hyperlink in the "Location" field that is listed in the table at the end of this e-mail message to have your Web browser open that location. However, sometimes e-mail program settings disable hyperlinks. If the hyperlink in this e-mail message is disabled, please copy the hyperlink in the "Location" field and then past it into the address box of your Web browser. Make sure that you include the exact text (without spaces) between the parentheses in the http:// address.


Package:
-----------------------------------------------------------
-----------------------------------------------------------
KB Article Number(s): 948567, 949862, 953626, 956574, 956686, 960616, 960976, 960978, 961106, 961146, 961237, 961282, 961325, 961340, 961526, 961648, 961695, 961760, 961803, 961811, 961920, 961928, 961935, 961979, 962003, 962008, 963061, 963117, 963118, 963659, 965217, 965221, 966306, 967148, 967157, 967161, 967162, 967164, 967169, 967178, 967205, 967206, 967315, 967337, 967480, 967523, 967524, 967552, 967561, 967614, 967749, 967821, 967889, 967983, 967984, 968080, 968085, 968152, 968159, 968290, 968369, 968449, 968539, 968543, 968615, 968722, 968740, 968741, 968742, 968834, 968900, 969007, 969050, 969086, 969099, 969131, 969235, 969357, 969362, 969386, 969453, 969467, 969469, 969513, 969528, 969588, 969611, 969653, 969775, 969793, 969844, 969872, 969890, 969942, 969997, 970014, 970044, 970058, 970070, 970133, 970150, 970160, 970184, 970198, 970255, 970287, 970315, 970324, 970349, 970399, 970461, 970507, 970538, 970550, 970551, 970654, 970666, 970713, 970719, 970731, 970823, 970824, 970909, 970966, 970989, 971020, 971049, 971051, 971057, 971064, 971068, 971125, 971132, 971136, 971402, 971482, 971491, 971622, 971640, 971683, 971753, 971772, 971780, 971898, 971914, 971934, 971985, 972068, 972075, 972101, 972184, 972197, 972198, 972200, 972201, 972203, 972207, 972261, 972271, 972367, 972395, 972440, 972458, 972498, 972521, 972537, 972545, 972650, 972681, 972687, 972759, 972763, 972777, 972833, 972856, 972893, 972936, 972939, 972969, 972984, 973087, 973090, 973102, 973103, 973192, 973200, 973204, 973223, 973250, 973251, 973255, 973257, 973292, 973300, 973302, 973303, 973524, 973580, 973588, 973602, 973696, 973877, 973897, 973953, 974076, 974231, 974262, 974269, 974276, 974289, 974371, 974398, 974404, 974712, 974766, 974816, 974948, 975055, 975171, 975272, 976761
Language: All (Global)
Platform: x64
Location: (http://hotfixv4.microsoft.com/SQL%20Server%202008/sp1/SQL_Server_2008_SP1_CU_Updated_Ref_KB_97/10.00.2740.00/free/398850_intl_x64_zip.exe)   <--요기
Password: )llB]dsAM  <-- 요기

-----------------------------------------------------------
KB Article Number(s): 960616, 961106, 961760, 961811, 963061, 965217, 967206, 967337, 967561, 967983, 967984, 968085, 968290, 968449, 968834, 968900, 969007, 969131, 969235, 969362, 969469, 969588, 969775, 969872, 970070, 970184, 970198, 970255, 970315, 970461, 970550
Language: All (Global)
Platform: x64
Location: (http://hotfixv4.microsoft.com/SQL%20Server%202008/sp1/SQL_Server_2008_SP1_Cumulative_Update_2/10.00.2714.00/free/381569_intl_x64_zip.exe) <-- 요기
Password: +iSZWIF <-- 요기



NOTE Make sure that you include all the text between "(" and ")" when you visit this hotfix location.

27. SP1을 깔아서 그런지. 핫픽스 두개 중에 한개만 설치가 된다 압축을 풀고 나서 끝자리가 315로 되어 있는건 설치가 안되고 다른 건 설치가 된다 SP1에 똑같은 버젼의 315가 포함이 되어 있어서 설치가 안됨.

무튼 한개의 핫픽스를 깔고 (까는 방법은 SP1 설치 방법과 같다 위에 그림들을 참고 하시기를..)

28. 다시 12에서 16번 까지 하였더니 이번에는 해당 버젼이 맞아서 넘어 감. 비밀 번호를 넣고 넥스트.

29. portnumber를 5000번으로 지정 하도록 하겠습니다. 그리고 인증은 NTLM으로 하도록 하겠습니다 그리고 넥스트

30. 해당 구성이 맞는지 체크를 하고 넥스트.  여기가 맞나;; SharePoint 구성의 진행 화면이 나옴..

31. 구성이 완료 되었다는 페이지가 나오고 완료 클릭.

32. 해당 구성 화면을 들어가 보면은.. SharePoint 2010의 구성 페이지를 볼 수 있음.

SharePoint 2010은 언듯 봐도 참많이 바뀌었다는 생각이듬. 리본 메뉴가 생겨 났으며, SPS사라지구 각각의 구성으로 밖으로 나와 있는 것을 볼 수 있었음. 해당 구성 방법은 이번주 내로

추가 해서 올리도록 하겠습니다 .

저도 피곤한지라... 짬날때 조금씩 하구 있으니.. 많은 양해를;;;ㅋㅋ

 궁금하시거나 모르시는게 있으면은 댓글을 달아 주시거나~ 메일을 보내주시면은 답변을 드리도록 하겠습니다.

 

 

 

Tags: ,

SharePoint

SharePoint Custom Field(Button)

by will 21. July 2009 11:58

안녕하세요?
오늘은 저번에 공지한대로 커스텀 텍스트 필드에 버튼 컨트롤을 넣어서 작업을 해보겠습니다.

우선 이번에는 저번과 다르게 디폴트 템플릿도 만들 것이고 display할 때 기본 컨트롤 뿐만 아니라.

버튼이 함께 들어 가도록 하겠습니다.

1. class를 생성 하고 SPField를 상속을 받도록 하겠습니다.

2. 그냥 빌드를 하면은 저번과 같이 에러가 나게 됩니다. 생성자를 넣지 않아서 나는오류입니다.
   그럼 저번과 같이 생성자 또한 정의를 해보겠습니다.

3. 그런 다음 FiellRenderingControl을 상속을 받고 제가 지정한 class를 넣어 주도록 하겠습니다.

 4. 그리고 금방 생성한 class에 baseFieldControl을 상속 받도록 하겠습니다.

5. 그런 다음 아까 말했듯이 디폴트 템플릿을 사용자 지정으로 넣습니다.(아무 이름이나 상관 없음.)

6. ControlTemplate를 생성 합니다.(이름 상관 없음.)

7. ControlTemplate의 내용은 아래의 그림과 같이 정의를 해줍니다.(Source단 참조, Template안에 컨트롤 및 테그 아무렇게 넣어도됨.)
  * SharePoint:RenderingTemplate 의 ID는 디폴트 템플릿의 사용자 이름으로 해야됨.(아래 그림 참조)

8. 컨트롤을 정의 하겠습니다 Template에 있는 텍스트 박스 하나, Display에 뿌릴 테이블 하나, 버튼 등록을 위한 버튼 하나.

9. 텍스트박스를 넣기 쉽게 하기 위해서 캡슐화 하겠습니다.

10. 값을 저장 하고 빼오기 위해서 Value를 상속 받고 Text의 값의로 설정 하도록 하겠습니다.

 

11. 그리고 버튼을 클릭 이벤트를 생성 하도록 하겠습니다.


 
12. 이제 Display시 뿌려질 내용을 하나의 함수를 생성 해서 넣도록 하겠습니다. (Microsoft.SharePoint.WebControls.OWSForm이라는 것을 참조)

13. 해당 페이지에 뿌려줄때 동작 하는 CreateChildControls를 상속 받는다 (필드가 널인지 체크, base컨트롤 생성 및 display모드시 버튼 등록, New모드시 기본값설정)

14. SharePoint에서 Display이시 컨트롤을 랜더링을 관장하는 RenderFieldForDisplay를 상속 받는다.(아까 생성한 Table을 뿌림.)

 

15. 이벤트에 해당 컬럼의 값을 +1 시킨다.

16. 필드 타입 정의 XML (저번 XML그대루 같다가 씁니다;; 편집해서 쓰세요~)

17. 해당 dll은 객에 등록, Controltemplate랑 xml은 Controltemplates랑 xml폴에 각각 복사 후 iisreset

완료 화면 1)

완료 2)

완료 3)

완료 4)

완료 6)

소스 1)


 


    public class CustomButton : Microsoft.SharePoint.SPField
    {
        public CustomButton(SPFieldCollection fields, string fieldName)
            : base(fields, fieldName)
        {
        }//


        public CustomButton(SPFieldCollection fields, string typeName, string displayName)
            : base(fields, typeName, displayName)
        {
        }//


        public override BaseFieldControl FieldRenderingControl
        {
            get
            {
                BaseFieldControl bfc = new CustomButtonBaseControl();
                bfc.FieldName = InternalName;
                return bfc;
            }
        }//FieldRenderingControl


    }//class

소스 2)

 


    public class CustomButtonBaseControl : BaseFieldControl
    {


        protected TextBox Ctb_txt;
        public Button spnote_btn;
        private Table table;


        protected override string DefaultTemplateName
        {
            get
            {
                return "btn_SPNote_Template";
            }
        }//DefaultTemplateName


        protected override void CreateChildControls()
        {
            if (base.Field == null)
            {
                return;
            }


            base.CreateChildControls();
           
            if (base.ControlMode == SPControlMode.Display)
            {
                spnote_btn = new Button();
                spnote_btn.Click += new EventHandler(spnote_btn_Click);
                spnote_btn.ID = "spnote_btn";
                spnote_btn.Text = "버튼테스트";
                DisPalyFormAdd();
            }
            else
            {
                Ctb_txt = (TextBox)this.TemplateContainer.FindControl("SPNote_txt");
                Ctb_txt.Enabled = false;
                if (base.ControlMode == SPControlMode.New)
                {
                    Ctb_txt.Text = "0";
                }
            }


        }//CreateChildControls


        public void DisPalyFormAdd()
        {
            Microsoft.SharePoint.WebControls.OWSForm form =
                new Microsoft.SharePoint.WebControls.OWSForm();
            Controls.Add(form);
            table = new Table();
            form.Controls.Add(table);
            table.Width = Unit.Percentage(80);
            TableRow row = new TableRow();
            table.Rows.Add(row);
            row.BackColor = Color.White;
            TableCell cell = new TableCell();
            cell.Width = Unit.Pixel(150);
            cell.Attributes["class"] = "ms-vb2";
            cell.Controls.Add(spnote_btn);
            row.Cells.Add(cell);
               
        }//DisPlayFormAdd


        protected override void RenderFieldForDisplay(HtmlTextWriter output)
        {
            base.RenderFieldForDisplay(output);
            if (table == null)
            {
                DisPalyFormAdd();
            }


            table.RenderControl(output);


        }//RenderFieldForDisplay


        void spnote_btn_Click(object sender, EventArgs e)
        {
            Web.AllowUnsafeUpdates = true;
            String itemvalue =  this.ItemFieldValue.ToString();
            this.ItemFieldValue = (int.Parse(itemvalue) + 1).ToString();
            this.Item.Update();
            Web.AllowUnsafeUpdates = false;
            string responseurl= this.Page.Request.Url.ToString();
            this.Page.Response.Redirect(responseurl);
           
        }//spnote_btn_Click


        public virtual string Text
        {
            get
            {
                this.EnsureChildControls();
                if (this.Ctb_txt == null)
                {
                    return null;
                }
                return this.Ctb_txt.Text;
            }
            set
            {
                this.EnsureChildControls();
                if (this.Ctb_txt != null)
                {
                    this.Ctb_txt.Text = value;
                }
            }
        }//Text


        public override object Value
        {
            get
            {
                return this.Text;
            }
            set
            {
                if (base.Field != null)
                {
                    this.Text = base.Field.GetFieldValueForEdit(value);
                }
            }
        }//Value


    }//class
소스 3)


<?xml version="1.0" encoding="utf-8" ?>
<FieldTypes>
  <FieldType>
  <Field Name="TypeName">사용자정의버튼</Field>
  <Field Name="ParentType">Text</Field>
  <Field Name="TypeDisplayName">사용자정의버튼</Field>
  <Field Name="TypeShortDescription">사용자정의버튼</Field>
  <Field Name="UserCreatable">TRUE</Field>
  <Field Name="FieldTypeClass">SPnote.SharePoint.SPField.SPFeildText.CustomButton, SPnote.SharePoint.SPField, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be2c734ef24c0327</Field>
  <RenderPattern Name="DisplayPattern">
   <Column HTMLEncode="TRUE" AutoHyperLink="TRUE" AutoNewLine="TRUE"/>
  </RenderPattern>
 </FieldType>
</FieldTypes>

Tags:

SharePoint

SharePoint Custom Field

by will 20. July 2009 03:12

SPFieldText 를 상속을 하여서 간단히 필드를 하나 만들어 보겠습니다.

 

SPFieldTextSharePoint에서 기본적으로 텍스트 박스 형태의 255길이의 문자를 쓸 수 있는 텍스트 박스 입니다.

 

우선 CS단을 만들고 해당 SPFieldText 를 상속 해 보겠습니다.

  

그리고 빌드를 하면은 에러가 나게 되어있습니다.

베이스 컨트롤의 생성자 들을 안 넣었기 때문입니다. 

 

이런 식으로 넣어 주면은 에러 없이 돌아 갑니다.

 

다음으로 해당 컨트롤에 필드랜더링컨트롤을 오버라이드 해서 상속을 받아서 커스텀

된 해당 필드를 넣어 보도록 하겠습니다.

 

우선 컨트롤을 오버라이드를 하고,

클래스를 하나 만들어서 아래와 같이 소스를 채워 넣습니다.

그 다음 금방 만든 class파일에 가서 basefieldcontrol을 상속 해서 만들어 둡니다.

 

 

텍스트 박스를 바꿔야 하기 때문에 우선 텍스트 박스를 상속하겠다고 선언 하고, 그리고 기본 템플릿을

 SharePoint FieldText 가 사용 하는 “TextField”라는 템플릿을 사용 하도록 하겠습니다.

 

우선 값을 넣을 수 있는 Text라는 인자 값을 리펙터링으로 선언 해서 텍스트박스 값을 집어 넣습니다.

 

 

그리고 value를 오버라이드 해서 해당 값을 채워 줍니다.

 

 

그리고 나서 CreateChildControls를 오버라이드 해서 해당 컨트롤에 뿌려 질 때 할 행동들을 집어 넣을

수 있습니다. (편집과 새로 만들기 시 값을 넣어줘야 함.)

Findcontrol로 해당 필드를 찾아서 넣어 주면은 랜더링이 끝나고 나서 값을 채울 때 해당 필드가 널 값이

 아니기 때문에 값을 넣게 됨( 참고 : 해당 필드 값은 DefaultTemplates.ascx에 정의 되어있음. )

* 기본템플릿에서 TextField로 정의 되어있으니 DefaultTemplates.ascx파일에서 검색을 하시면은 한결 이해가 쉽습니다.

 

  

key파일을 생성 하고 빌드 한 다음 객에 등록을 합니다.

 

 

그리고 xml파일을 하나 만들어서 해당 내용을 집어 넣습니다.

(xml이름은 : fldtypes_아무이름  ß이런 식으로 맞춰주어야지 moss에서 인식을 합니다.)

FieldTypeClass 에 해당 파일의 dll정보 와 해당 class명을 넣어 주고 나서 12 폴더 밑에 xml파일에 넣어 주고 iis reset하면은 끝)

 

 

 

완료1)

완료2)

 

완료3)

 

소스1)


public class CustomTextField : SPFieldText
{
        public CustomTextField(SPFieldCollection fields, string fieldName)
            : base(fields, fieldName)
        {
        }


        public CustomTextField(SPFieldCollection fields, string typeName, string displayName)
            : base(fields, typeName,displayName)
        {
        }


        public override BaseFieldControl FieldRenderingControl
        {
            get
            {
                BaseFieldControl cbc = new CustomTextBaseControl();
                cbc.FieldName = InternalName;
                return cbc;
            }
        }//FieldRenderingControl


}//class

소스 2)


public class CustomTextBaseControl : BaseFieldControl
{
        protected TextBox customTextField;
       
        protected override string DefaultTemplateName
        {
            get
            {
                return "TextField";
            }
        }


        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            if ((base.ControlMode != SPControlMode.Display) && (base.Field != null))
            {
                this.customTextField = (TextBox)this.TemplateContainer.FindControl("TextField");
            }


        }


        public virtual string Text
        {
            get
            {
                this.EnsureChildControls();
                if (this.customTextField == null)
                {
                    return null;
                }
                return this.customTextField.Text;
            }
            set
            {
                this.EnsureChildControls();
                if (this.customTextField != null)
                {
                    this.customTextField.Text = value;
                }
            }
        }


 


        public override object Value
        {
            get
            {
                return this.Text;
            }
            set
            {
                if (base.Field != null)
                {
                    this.Text = base.Field.GetFieldValueForEdit(value);
                }
            }
        }


}

소스 3)


<?xml version="1.0" encoding="utf-8" ?>

<FieldTypes>

 <FieldType>

  <Field Name="TypeName">사용자변경</Field>

  <Field Name="ParentType">Text</Field>

  <Field Name="TypeDisplayName">사용자변경텍스트</Field>

  <Field Name="TypeShortDescription">사용자변경텍스트</Field>

  <Field Name="UserCreatable">TRUE</Field>

  <Field Name="FieldTypeClass">SPnote.SharePoint.SPField.SPFeildText.CustomTextField, SPnote.SharePoint.SPField, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be2c734ef24c0327</Field>

  <RenderPattern Name="DisplayPattern">

   <Column HTMLEncode="TRUE" AutoHyperLink="TRUE" AutoNewLine="TRUE"/>

  </RenderPattern>

 </FieldType>

</FieldTypes> 
 

이상으로 커스텀 필드에 대해서 마쳤습니다. 내용이 많이 부족 하지만 부족한 내용들은 개인들이 

채워 주시면은 고맙겠습니다.

다음에는 버튼 필드를 만들어 보도록 하겠습니다.                   

 

 

 

 

 

Tags: ,

SharePoint