Joseph Michael Pesch
VP Programming

Sharepoint Hidden Site User List Collection

by 14. June 2011 10:48

Logged in as administrator, navigate to: _catalogs/users/simple.aspx

see: http://www.zimmergren.net/archive/2008/06/25/sharepoints-hidden-user-list-user-information-list.aspx

Tags:

Sharepoint

Deploy Visual Studio 2010 Sharepoint 2010 Workflow via .WSP File and STSADM

by 9. June 2011 10:04

NOTE:
Make sure the "Sharepoint 2010 Administration" service is NOT running.
Using execadmsvcjobs to execute in lieu of Timer service running them.
This ensures that the prior steps are complete before running the next.

Generate .WSP file by using the "Package" command from Visual Studio.

Copy .WSP file to somewhere on the Sharepoint server
for this example: "c:\MySpDeployment\MyWorkflow.wsp"
Run command window as Administrator and execute the commands below.

NOTE:
If you are re-installing the workflow you can first fully remove it
by using the Uninstall steps shown below the Install steps.

INSTALL STEPS

1) Navigate to the BIN where the STSADM.EXE exists
   (so we don't need the full path on all commands)

cd "c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"

2) Run all the STSADM commands...
stsadm -o addsolution -filename "MySpDeployment\MyWorkflow.wsp"
stsadm -o deploysolution -name "MyWorkflow.wsp" -immediate -allowgacdeployment -allowcaspolicies
stsadm -o execadmsvcjobs
stsadm -o activatefeature -name "MyWorkflow" -url http://yoursharepointsite

NOTE: 
Last step to activate feature requires exact folder name of feature.
Verify by navigating to the features folder to confirm the folder name.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES

UNINSTALL STEPS

1) Navigate to the BIN where the STSADM.EXE exists
   (so we don't need the full path on all commands)

cd "c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"

NOTE: 
First step to deactivate feature requires exact folder name of feature.
Verify by navigating to the features folder to confirm the folder name.
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES

2) Run all the STSADM commands...
stsadm -o deactivatefeature -name "MyWorkflow" -url http://devuam
stsadm -o retractsolution -name "MyWorkflow.wsp" -immediate
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name "MyWorkflow.wsp"

Tags:

Sharepoint

Deploy Visual Studio 2010 Sharepoint 2010 Workflow via .WSP File and STSADM

by 9. June 2011 09:37

NOTE: Make sure the "Sharepoint 2010 Administration" service is NOT running.
      We are using the execadmsvcjobs to execute rather than letting th Timer service run them.

To install workflow from .WSP file ("Package" command from Visual Studio 2010 generates this file)
Copy the .WSP file to somewhere on the Sharepoint server (c:\MySpDeployment\MyWorkflow.wsp for this example)
Running command window as Administrator execute the commands below.
NOTE: If you are re-installing the workflow you can first fully remove it with the Uninstall steps also shown below.

INSTALL STEPS

1) Navigate to the BIN where the STSADM.EXE exists (so we don't need the full path on all commands)..
cd "c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"

2) Run all the STSADM commands...
stsadm -o addsolution -filename "MySpDeployment\MyWorkflow.wsp"
stsadm -o deploysolution -name "MyWorkflow.wsp" -immediate -allowgacdeployment -allowcaspolicies
stsadm -o execadmsvcjobs
stsadm -o activatefeature -name "MyWorkflow" -url http://devuam

NOTE: The last step to activate the feature requires the exact folder name where the feature was installed.
      You can verify by navigating to the features folder (listed below) and confirming the folder name.
      (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES

UNINSTALL STEPS

1) Navigate to the BIN where the STSADM.EXE exists (so we don't need the full path on all commands)..
cd "c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN"

2) Run all the STSADM commands... (see NOTE from last step of install that also applies to first step of removal)
stsadm -o deactivatefeature -name "MyWorkflow" -url http://devuam
stsadm -o retractsolution -name "MyWorkflow.wsp" -immediate
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name "MyWorkflow.wsp"

Tags:

Sharepoint

Sharepoint Get User Information from within Workflow/Application Page

by 27. May 2011 14:39

// Workflow member variable declarations...
public Guid workflowId = default(System.Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();

private void SomeMethod()
{
  // This method failed: SPList userList = SPContext.Current.Web.SiteUserInfoList;
  SPList userList = workflowProperties.Site.RootWeb.SiteUserInfoList;
  SPUser user = SPContext.Current.Web.EnsureUser(@"domain\userid");
  SPListItem userItem = userList.Items.GetItemById(user.ID);
  foreach(SPField fld in userItem.Fields) 
  {
    System.Diagnostics.Debug.WriteLine(string.Format("{0} >>> {1}", fld.Title, fld.InternalName)); 
  }
}

OUTPUT FROM MY SAMPLE TEST:
ID >>> ID
Content Type ID >>> ContentTypeId
Content Type >>> ContentType
Name >>> Title
Modified >>> Modified
Created >>> Created
Created By >>> Author
Modified By >>> Editor
Has Copy Destinations >>> _HasCopyDestinations
Copy Source >>> _CopySource
owshiddenversion >>> owshiddenversion
Workflow Version >>> WorkflowVersion
UI Version >>> _UIVersion
Version >>> _UIVersionString
Attachments >>> Attachments
Approval Status >>> _ModerationStatus
Approver Comments >>> _ModerationComments
Edit >>> Edit
Name >>> LinkTitleNoMenu
Title >>> LinkTitle
Title >>> LinkTitle2
Select >>> SelectTitle
Instance ID >>> InstanceID
Order >>> Order
GUID >>> GUID
Workflow Instance ID >>> WorkflowInstanceID
URL Path >>> FileRef
Path >>> FileDirRef
Modified >>> Last_x0020_Modified
Created >>> Created_x0020_Date
Item Type >>> FSObjType
Sort Type >>> SortBehavior
Effective Permissions Mask >>> PermMask
Name >>> FileLeafRef
Unique Id >>> UniqueId
Client Id >>> SyncClientId
ProgId >>> ProgId
ScopeId >>> ScopeId
File Type >>> File_x0020_Type
HTML File Type >>> HTML_x0020_File_x0020_Type
Edit Menu Table Start >>> _EditMenuTableStart
Edit Menu Table Start >>> _EditMenuTableStart2
Edit Menu Table End >>> _EditMenuTableEnd
Name >>> LinkFilenameNoMenu
Name >>> LinkFilename
Name >>> LinkFilename2
Type >>> DocIcon
Server Relative URL >>> ServerUrl
Encoded Absolute URL >>> EncodedAbsUrl
File Name >>> BaseName
Property Bag >>> MetaInfo
Level >>> _Level
Is Current Version >>> _IsCurrentVersion
Item Child Count >>> ItemChildCount
Folder Child Count >>> FolderChildCount
Account >>> Name
E-Mail >>> EMail
Mobile Number >>> MobilePhone
About Me >>> Notes
SIP Address >>> SipAddress
Locale >>> Locale
Calendar Type >>> CalendarType
AdjustHijriDays >>> AdjustHijriDays
TimeZone >>> TimeZone
Time Format >>> Time24
Alternate Calendar Type >>> AltCalendarType
CalendarView Options >>> CalendarViewOptions
WorkDays >>> WorkDays
WorkDay StartHour >>> WorkDayStartHour
WorkDay EndHour >>> WorkDayEndHour
Is Site Admin >>> IsSiteAdmin
Deleted >>> Deleted
Picture >>> Picture
Department >>> Department
Job Title >>> JobTitle
Is Active >>> IsActive
Group >>> GroupLink
Edit >>> GroupEdit
Name >>> ImnName
Picture >>> PictureDisp
Name >>> NameWithPicture
Name >>> NameWithPictureAndDetails
Edit >>> EditUser
Selection Checkbox >>> UserSelection
Content Type >>> ContentTypeDisp
 
 

Tags:

C# | Sharepoint

Sharepoint Get User Information from within Workflow/Application Page

by 27. May 2011 13:51

SPList userList = SPContext.Current.Web.SiteUserInfoList;

SPUser user = SPContext.Current.Web.EnsureUser(@"domain\userid");

SPListItem userItem = userList.Items.GetItemById(user.ID);

 

 

Tags:

C# | Sharepoint

Linq to Sharepoint DataContext Binding

by 27. May 2011 07:32

// Get DataContext from application page

SPMetalDataContext data = new SPMetalDataContext(SPContext.GetContext(this.Context).Web.Url);

 

// Get DataContext from workflow

public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();

// The workflowProperties variable would be declared in the workflow class

SPMetalDataContext data = new SPMetalDataContext(workflowProperties.Item.Web.Url); 

 

OR

SPMetalDataContext data = new SPMetalDataContext(SPContext.Current.Web.Url);

 

Tags:

C# | Sharepoint

Add Author, Created, Editor and Modified Fields to SPMetal Generated C# Class for Sharepoint

by 26. May 2011 09:29
public partial class Item : Microsoft.SharePoint.Linq.ITrackEntityState
  , Microsoft.SharePoint.Linq.ITrackOriginalValues
  , System.ComponentModel.INotifyPropertyChanged
  , System.ComponentModel.INotifyPropertyChanging
{
  // Add the following to the Item class in the SPMetal generated class...
  string _CreatedBy;
  [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Author", Storage = "_CreatedBy"
    , ReadOnly = true, FieldType = "User", IsLookupValue = true)]
  public string CreatedBy
  {
    get
    { return this._CreatedBy; }
    set
    {
      if ((value != this._CreatedBy))
      {
        this.OnPropertyChanging("CreatedBy"this._CreatedBy);
        this._CreatedBy = value;
        this.OnPropertyChanged("CreatedBy");
      }
    }
  }

  DateTime _CreatedOn;
  [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Created", Storage = "_CreatedOn"
    , ReadOnly = true, FieldType = "DateTime", IsLookupValue = false)]
  public DateTime CreatedOn
  {
    get
    { return this._CreatedOn; }
    set
    {
      if ((value != this._CreatedOn))
      {
        this.OnPropertyChanging("CreatedOn"this._CreatedOn);
        this._CreatedOn = value;
        this.OnPropertyChanged("CreatedOn");
      }
    }
  }

  string _ModifiedBy;
  [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Editor", Storage = "_ModifiedBy"
    , ReadOnly = true, FieldType = "User", IsLookupValue = true)]
  public string ModifiedBy
  {
    get
    {
      return this._ModifiedBy;
    }
    set
    {
      if ((value != this._ModifiedBy))
      {
        this.OnPropertyChanging("ModifiedBy"this._ModifiedBy);
        this._ModifiedBy = value;
        this.OnPropertyChanged("ModifiedBy");
      }
    }
  }

  DateTime _ModifiedOn;
  [Microsoft.SharePoint.Linq.ColumnAttribute(Name = "Modified", Storage = "_ModifiedOn"
    , ReadOnly = true, FieldType = "DateTime", IsLookupValue = false)]
  public DateTime ModifiedOn
  {
    get
    {
      return this._ModifiedOn;
    }
    set
    {
      if ((value != this._ModifiedOn))
      {
        this.OnPropertyChanging("ModifiedOn"this._ModifiedOn);
        this._ModifiedOn = value;
        this.OnPropertyChanged("ModifiedOn");
      }
    }
  }

Tags:

C# | Sharepoint

Hide/Remove Title Column from Sharepoint List

by 25. May 2011 10:08

Tags:

Sharepoint