Microsoft Content Management Server - Stand-alone template manager for MCMS 2002

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2004 > Stand-alone template manager for MCMS 2002





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Stand-alone template manager for MCMS 2002
Steve Walker

2004-02-19, 1:36 am

If anyone's interested I've put together a simple Windows app to allow
template definitions to be managed outside of Visual Studio.NET.

Here's the code:

-<snip>----------------------------------------------------------------------------------
// ****************************************
***********************
// Template Manager for Microsoft Content Management Server 2002
// Steve Walker, 2004
// ****************************************
***********************
// Requires the following MCMS2002 files:
// DeveloperTools.xml
// DeveloperTools.xsd
// Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
// Microsoft.ContentManagement.DeveloperTools.ToolsModel.dll
//
// Build:
// csc /t:winexe /r:Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
TemplateManager.cs
// ****************************************
***********************

using System;
using System.ComponentModel;
using System.Windows.Forms;
using Microsoft.ContentManagement.DeveloperTools.ToolControls;

namespace TemplateManager
{
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem mnuFile;
private System.Windows.Forms.MenuItem cmdExit;
private System.Windows.Forms.StatusBar statusBar;
private System.Windows.Forms.Panel clientPanel;
private System.Windows.Forms.Splitter clientSplitter;
private System.Windows.Forms.PropertyGrid propertyGrid;
private System.ComponentModel.Container components = null;
private TemplateGalleryExplorer templateGalleryExplorer;

public MainForm()
{
this.mainMenu = new System.Windows.Forms.MainMenu();
this.mnuFile = new System.Windows.Forms.MenuItem();
this.cmdExit = new System.Windows.Forms.MenuItem();
this.statusBar = new System.Windows.Forms.StatusBar();
this.clientPanel = new System.Windows.Forms.Panel();
this.propertyGrid = new
System.Windows.Forms.PropertyGrid();
this.clientSplitter = new System.Windows.Forms.Splitter();
this.templateGalleryExplorer = new
TemplateGalleryExplorer();
this.clientPanel.SuspendLayout();
this.SuspendLayout();

// mainMenu
this.mainMenu.MenuItems.AddRange(
new System.Windows.Forms.MenuItem[] {this.mnuFile});

// mnuFile
this.mnuFile.Index = 0;
this.mnuFile.MenuItems.AddRange(
new System.Windows.Forms.MenuItem[] {this.cmdExit});

this.mnuFile.Text = "&File";

// cmdExit
this.cmdExit.Index = 0;
this.cmdExit.Text = "E&xit";
this.cmdExit.Click += new
System.EventHandler(this.cmdExit_Click);

// statusBar
this.statusBar.Location = new System.Drawing.Point(0,
385);
this.statusBar.Name = "statusBar";
this.statusBar.ShowPanels = true;
this.statusBar.Size = new System.Drawing.Size(560, 22);
this.statusBar.TabIndex = 0;

// clientPanel
this.clientPanel.Controls.Add(this.propertyGrid);
this.clientPanel.Controls.Add(this.clientSplitter);
this.clientPanel.Controls.Add(this.templateGalleryExplorer);
this.clientPanel.Dock =
System.Windows.Forms.DockStyle.Fill;
this.clientPanel.Location = new System.Drawing.Point(0,
0);
this.clientPanel.Name = "clientPanel";
this.clientPanel.Size = new System.Drawing.Size(560, 385);
this.clientPanel.TabIndex = 1;

// propertyGrid
this.propertyGrid.CommandsVisibleIfAvailable = true;
this.propertyGrid.Dock =
System.Windows.Forms.DockStyle.Fill;
this.propertyGrid.LargeButtons = false;
this.propertyGrid.LineColor =
System.Drawing.SystemColors.ScrollBar;
this.propertyGrid.Location = new System.Drawing.Point(291,
0);
this.propertyGrid.Name = "propertyGrid";
this.propertyGrid.Size = new System.Drawing.Size(269,
385);
this.propertyGrid.TabIndex = 2;
this.propertyGrid.Text = "propertyGrid1";
this.propertyGrid.ViewBackColor =
System.Drawing.SystemColors.Window;
this.propertyGrid.ViewForeColor =
System.Drawing.SystemColors.WindowText;

// clientSplitter
this.clientSplitter.Location = new
System.Drawing.Point(288, 0);
this.clientSplitter.Name = "clientSplitter";
this.clientSplitter.Size = new System.Drawing.Size(3,
385);
this.clientSplitter.TabIndex = 1;
this.clientSplitter.TabStop = false;

// templateGalleryExplorer
this.templateGalleryExplorer.AutoScroll = true;
this.templateGalleryExplorer.ClientDrawMenu = false;
this.templateGalleryExplorer.Dock =
System.Windows.Forms.DockStyle.Left;
this.templateGalleryExplorer.Location = new
System.Drawing.Point(0, 0);
this.templateGalleryExplorer.Name =
"templateGalleryExplorer";
this.templateGalleryExplorer.Size = new
System.Drawing.Size(288, 385);
this.templateGalleryExplorer.TabIndex = 0;
this.templateGalleryExplorer.PropertiesRequest +=
new PropertiesRequestEventHandler(
this. templateGalleryExplorer_PropertiesReques
t);

this.templateGalleryExplorer.SelectionChanged +=
new System.EventHandler(
this. templateGalleryExplorer_SelectionChanged
);

// MainForm
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(560, 407);
this.Controls.Add(this.clientPanel);
this.Controls.Add(this.statusBar);
this.Menu = this.mainMenu;
this.Name = "MainForm";
this.Text = "Template Manager";
this.clientPanel.ResumeLayout(false);
this.ResumeLayout(false);
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

[STAThread]
static void Main()
{
try
{
Application.Run(new MainForm());
}
catch(Exception ex)
{
MessageBox.Show(
"There was a problem running this application:\n"
+
ex.Message,
"Template Manager",
MessageBoxButtons.OK,
MessageBoxIcon.Error
);
}
}

private void cmdExit_Click(object sender, System.EventArgs e)
{
Close();
}

private void templateGalleryExplorer_PropertiesReques
t(object
sender, System.EventArgs e)
{
GetProperties();
}

private void templateGalleryExplorer_SelectionChanged
(object
sender, System.EventArgs e)
{
GetProperties();
}

private void GetProperties()
{
propertyGrid.SelectedObject =
templateGalleryExplorer.SelectedItems[0];
}
}
}
--<snip>---------------------------------------------------------------------------------

To build, create a working folder and copy the following files from
your MCMS 2002 setup:
DeveloperTools.xml
DeveloperTools.xsd
Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
Microsoft.ContentManagement.DeveloperTools.ToolsModel.dll

If you've installed the MCMS developer tools you find these in the
DevTools sub folder in the MCMS Program Files location (if not you can
get them from the SP1a download).

Save the above code as TemplateManager.cs and build using the command
line shown in the code. The MCMS files are also required to run the
application.

Developed on Windows XP Pro with MCMS 2002/SP1, .NET 1.1.
Spencer Harbar [MVP]

2004-02-19, 8:36 am

very cool!

--
Spence
www.harbar.net/mcms/

"Steve Walker" <steve.walker@seacontainers.com> wrote in message
news:cd0e37e5.0402190637.8e65be4@posting.google.com...
> If anyone's interested I've put together a simple Windows app to allow
> template definitions to be managed outside of Visual Studio.NET.
>
> Here's the code:
>
> -<snip>-------------------------------------------------------------------

---------------
> // ****************************************
***********************
> // Template Manager for Microsoft Content Management Server 2002
> // Steve Walker, 2004
> // ****************************************
***********************
> // Requires the following MCMS2002 files:
> // DeveloperTools.xml
> // DeveloperTools.xsd
> // Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
> // Microsoft.ContentManagement.DeveloperTools.ToolsModel.dll
> //
> // Build:
> // csc /t:winexe

/r:Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
> TemplateManager.cs
> // ****************************************
***********************
>
> using System;
> using System.ComponentModel;
> using System.Windows.Forms;
> using Microsoft.ContentManagement.DeveloperTools.ToolControls;
>
> namespace TemplateManager
> {
> public class MainForm : System.Windows.Forms.Form
> {
> private System.Windows.Forms.MainMenu mainMenu;
> private System.Windows.Forms.MenuItem mnuFile;
> private System.Windows.Forms.MenuItem cmdExit;
> private System.Windows.Forms.StatusBar statusBar;
> private System.Windows.Forms.Panel clientPanel;
> private System.Windows.Forms.Splitter clientSplitter;
> private System.Windows.Forms.PropertyGrid propertyGrid;
> private System.ComponentModel.Container components = null;
> private TemplateGalleryExplorer templateGalleryExplorer;
>
> public MainForm()
> {
> this.mainMenu = new System.Windows.Forms.MainMenu();
> this.mnuFile = new System.Windows.Forms.MenuItem();
> this.cmdExit = new System.Windows.Forms.MenuItem();
> this.statusBar = new System.Windows.Forms.StatusBar();
> this.clientPanel = new System.Windows.Forms.Panel();
> this.propertyGrid = new
> System.Windows.Forms.PropertyGrid();
> this.clientSplitter = new System.Windows.Forms.Splitter();
> this.templateGalleryExplorer = new
> TemplateGalleryExplorer();
> this.clientPanel.SuspendLayout();
> this.SuspendLayout();
>
> // mainMenu
> this.mainMenu.MenuItems.AddRange(
> new System.Windows.Forms.MenuItem[] {this.mnuFile});
>
> // mnuFile
> this.mnuFile.Index = 0;
> this.mnuFile.MenuItems.AddRange(
> new System.Windows.Forms.MenuItem[] {this.cmdExit});
>
> this.mnuFile.Text = "&File";
>
> // cmdExit
> this.cmdExit.Index = 0;
> this.cmdExit.Text = "E&xit";
> this.cmdExit.Click += new
> System.EventHandler(this.cmdExit_Click);
>
> // statusBar
> this.statusBar.Location = new System.Drawing.Point(0,
> 385);
> this.statusBar.Name = "statusBar";
> this.statusBar.ShowPanels = true;
> this.statusBar.Size = new System.Drawing.Size(560, 22);
> this.statusBar.TabIndex = 0;
>
> // clientPanel
> this.clientPanel.Controls.Add(this.propertyGrid);
> this.clientPanel.Controls.Add(this.clientSplitter);
> this.clientPanel.Controls.Add(this.templateGalleryExplorer);
> this.clientPanel.Dock =
> System.Windows.Forms.DockStyle.Fill;
> this.clientPanel.Location = new System.Drawing.Point(0,
> 0);
> this.clientPanel.Name = "clientPanel";
> this.clientPanel.Size = new System.Drawing.Size(560, 385);
> this.clientPanel.TabIndex = 1;
>
> // propertyGrid
> this.propertyGrid.CommandsVisibleIfAvailable = true;
> this.propertyGrid.Dock =
> System.Windows.Forms.DockStyle.Fill;
> this.propertyGrid.LargeButtons = false;
> this.propertyGrid.LineColor =
> System.Drawing.SystemColors.ScrollBar;
> this.propertyGrid.Location = new System.Drawing.Point(291,
> 0);
> this.propertyGrid.Name = "propertyGrid";
> this.propertyGrid.Size = new System.Drawing.Size(269,
> 385);
> this.propertyGrid.TabIndex = 2;
> this.propertyGrid.Text = "propertyGrid1";
> this.propertyGrid.ViewBackColor =
> System.Drawing.SystemColors.Window;
> this.propertyGrid.ViewForeColor =
> System.Drawing.SystemColors.WindowText;
>
> // clientSplitter
> this.clientSplitter.Location = new
> System.Drawing.Point(288, 0);
> this.clientSplitter.Name = "clientSplitter";
> this.clientSplitter.Size = new System.Drawing.Size(3,
> 385);
> this.clientSplitter.TabIndex = 1;
> this.clientSplitter.TabStop = false;
>
> // templateGalleryExplorer
> this.templateGalleryExplorer.AutoScroll = true;
> this.templateGalleryExplorer.ClientDrawMenu = false;
> this.templateGalleryExplorer.Dock =
> System.Windows.Forms.DockStyle.Left;
> this.templateGalleryExplorer.Location = new
> System.Drawing.Point(0, 0);
> this.templateGalleryExplorer.Name =
> "templateGalleryExplorer";
> this.templateGalleryExplorer.Size = new
> System.Drawing.Size(288, 385);
> this.templateGalleryExplorer.TabIndex = 0;
> this.templateGalleryExplorer.PropertiesRequest +=
> new PropertiesRequestEventHandler(
> this. templateGalleryExplorer_PropertiesReques
t);
>
> this.templateGalleryExplorer.SelectionChanged +=
> new System.EventHandler(
> this. templateGalleryExplorer_SelectionChanged
);
>
> // MainForm
> this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
> this.ClientSize = new System.Drawing.Size(560, 407);
> this.Controls.Add(this.clientPanel);
> this.Controls.Add(this.statusBar);
> this.Menu = this.mainMenu;
> this.Name = "MainForm";
> this.Text = "Template Manager";
> this.clientPanel.ResumeLayout(false);
> this.ResumeLayout(false);
> }
>
> protected override void Dispose( bool disposing )
> {
> if( disposing )
> {
> if (components != null)
> {
> components.Dispose();
> }
> }
> base.Dispose( disposing );
> }
>
> [STAThread]
> static void Main()
> {
> try
> {
> Application.Run(new MainForm());
> }
> catch(Exception ex)
> {
> MessageBox.Show(
> "There was a problem running this application:\n"
> +
> ex.Message,
> "Template Manager",
> MessageBoxButtons.OK,
> MessageBoxIcon.Error
> );
> }
> }
>
> private void cmdExit_Click(object sender, System.EventArgs e)
> {
> Close();
> }
>
> private void templateGalleryExplorer_PropertiesReques
t(object
> sender, System.EventArgs e)
> {
> GetProperties();
> }
>
> private void templateGalleryExplorer_SelectionChanged
(object
> sender, System.EventArgs e)
> {
> GetProperties();
> }
>
> private void GetProperties()
> {
> propertyGrid.SelectedObject =
> templateGalleryExplorer.SelectedItems[0];
> }
> }
> }
> --<snip>------------------------------------------------------------------

---------------
>
> To build, create a working folder and copy the following files from
> your MCMS 2002 setup:
> DeveloperTools.xml
> DeveloperTools.xsd
> Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
> Microsoft.ContentManagement.DeveloperTools.ToolsModel.dll
>
> If you've installed the MCMS developer tools you find these in the
> DevTools sub folder in the MCMS Program Files location (if not you can
> get them from the SP1a download).
>
> Save the above code as TemplateManager.cs and build using the command
> line shown in the code. The MCMS files are also required to run the
> application.
>
> Developed on Windows XP Pro with MCMS 2002/SP1, .NET 1.1.



Stefan [MSFT]

2004-02-20, 3:37 am

Hi Steve,

you should upload this to www.GotDotNet.com as a CMS sample!

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Steve Walker" <steve.walker@seacontainers.com> wrote in message
news:cd0e37e5.0402190637.8e65be4@posting.google.com...
> If anyone's interested I've put together a simple Windows app to allow
> template definitions to be managed outside of Visual Studio.NET.
>
> Here's the code:
>
> -<snip>-------------------------------------------------------------------

---------------
> // ****************************************
***********************
> // Template Manager for Microsoft Content Management Server 2002
> // Steve Walker, 2004
> // ****************************************
***********************
> // Requires the following MCMS2002 files:
> // DeveloperTools.xml
> // DeveloperTools.xsd
> // Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
> // Microsoft.ContentManagement.DeveloperTools.ToolsModel.dll
> //
> // Build:
> // csc /t:winexe

/r:Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
> TemplateManager.cs
> // ****************************************
***********************
>
> using System;
> using System.ComponentModel;
> using System.Windows.Forms;
> using Microsoft.ContentManagement.DeveloperTools.ToolControls;
>
> namespace TemplateManager
> {
> public class MainForm : System.Windows.Forms.Form
> {
> private System.Windows.Forms.MainMenu mainMenu;
> private System.Windows.Forms.MenuItem mnuFile;
> private System.Windows.Forms.MenuItem cmdExit;
> private System.Windows.Forms.StatusBar statusBar;
> private System.Windows.Forms.Panel clientPanel;
> private System.Windows.Forms.Splitter clientSplitter;
> private System.Windows.Forms.PropertyGrid propertyGrid;
> private System.ComponentModel.Container components = null;
> private TemplateGalleryExplorer templateGalleryExplorer;
>
> public MainForm()
> {
> this.mainMenu = new System.Windows.Forms.MainMenu();
> this.mnuFile = new System.Windows.Forms.MenuItem();
> this.cmdExit = new System.Windows.Forms.MenuItem();
> this.statusBar = new System.Windows.Forms.StatusBar();
> this.clientPanel = new System.Windows.Forms.Panel();
> this.propertyGrid = new
> System.Windows.Forms.PropertyGrid();
> this.clientSplitter = new System.Windows.Forms.Splitter();
> this.templateGalleryExplorer = new
> TemplateGalleryExplorer();
> this.clientPanel.SuspendLayout();
> this.SuspendLayout();
>
> // mainMenu
> this.mainMenu.MenuItems.AddRange(
> new System.Windows.Forms.MenuItem[] {this.mnuFile});
>
> // mnuFile
> this.mnuFile.Index = 0;
> this.mnuFile.MenuItems.AddRange(
> new System.Windows.Forms.MenuItem[] {this.cmdExit});
>
> this.mnuFile.Text = "&File";
>
> // cmdExit
> this.cmdExit.Index = 0;
> this.cmdExit.Text = "E&xit";
> this.cmdExit.Click += new
> System.EventHandler(this.cmdExit_Click);
>
> // statusBar
> this.statusBar.Location = new System.Drawing.Point(0,
> 385);
> this.statusBar.Name = "statusBar";
> this.statusBar.ShowPanels = true;
> this.statusBar.Size = new System.Drawing.Size(560, 22);
> this.statusBar.TabIndex = 0;
>
> // clientPanel
> this.clientPanel.Controls.Add(this.propertyGrid);
> this.clientPanel.Controls.Add(this.clientSplitter);
> this.clientPanel.Controls.Add(this.templateGalleryExplorer);
> this.clientPanel.Dock =
> System.Windows.Forms.DockStyle.Fill;
> this.clientPanel.Location = new System.Drawing.Point(0,
> 0);
> this.clientPanel.Name = "clientPanel";
> this.clientPanel.Size = new System.Drawing.Size(560, 385);
> this.clientPanel.TabIndex = 1;
>
> // propertyGrid
> this.propertyGrid.CommandsVisibleIfAvailable = true;
> this.propertyGrid.Dock =
> System.Windows.Forms.DockStyle.Fill;
> this.propertyGrid.LargeButtons = false;
> this.propertyGrid.LineColor =
> System.Drawing.SystemColors.ScrollBar;
> this.propertyGrid.Location = new System.Drawing.Point(291,
> 0);
> this.propertyGrid.Name = "propertyGrid";
> this.propertyGrid.Size = new System.Drawing.Size(269,
> 385);
> this.propertyGrid.TabIndex = 2;
> this.propertyGrid.Text = "propertyGrid1";
> this.propertyGrid.ViewBackColor =
> System.Drawing.SystemColors.Window;
> this.propertyGrid.ViewForeColor =
> System.Drawing.SystemColors.WindowText;
>
> // clientSplitter
> this.clientSplitter.Location = new
> System.Drawing.Point(288, 0);
> this.clientSplitter.Name = "clientSplitter";
> this.clientSplitter.Size = new System.Drawing.Size(3,
> 385);
> this.clientSplitter.TabIndex = 1;
> this.clientSplitter.TabStop = false;
>
> // templateGalleryExplorer
> this.templateGalleryExplorer.AutoScroll = true;
> this.templateGalleryExplorer.ClientDrawMenu = false;
> this.templateGalleryExplorer.Dock =
> System.Windows.Forms.DockStyle.Left;
> this.templateGalleryExplorer.Location = new
> System.Drawing.Point(0, 0);
> this.templateGalleryExplorer.Name =
> "templateGalleryExplorer";
> this.templateGalleryExplorer.Size = new
> System.Drawing.Size(288, 385);
> this.templateGalleryExplorer.TabIndex = 0;
> this.templateGalleryExplorer.PropertiesRequest +=
> new PropertiesRequestEventHandler(
> this. templateGalleryExplorer_PropertiesReques
t);
>
> this.templateGalleryExplorer.SelectionChanged +=
> new System.EventHandler(
> this. templateGalleryExplorer_SelectionChanged
);
>
> // MainForm
> this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
> this.ClientSize = new System.Drawing.Size(560, 407);
> this.Controls.Add(this.clientPanel);
> this.Controls.Add(this.statusBar);
> this.Menu = this.mainMenu;
> this.Name = "MainForm";
> this.Text = "Template Manager";
> this.clientPanel.ResumeLayout(false);
> this.ResumeLayout(false);
> }
>
> protected override void Dispose( bool disposing )
> {
> if( disposing )
> {
> if (components != null)
> {
> components.Dispose();
> }
> }
> base.Dispose( disposing );
> }
>
> [STAThread]
> static void Main()
> {
> try
> {
> Application.Run(new MainForm());
> }
> catch(Exception ex)
> {
> MessageBox.Show(
> "There was a problem running this application:\n"
> +
> ex.Message,
> "Template Manager",
> MessageBoxButtons.OK,
> MessageBoxIcon.Error
> );
> }
> }
>
> private void cmdExit_Click(object sender, System.EventArgs e)
> {
> Close();
> }
>
> private void templateGalleryExplorer_PropertiesReques
t(object
> sender, System.EventArgs e)
> {
> GetProperties();
> }
>
> private void templateGalleryExplorer_SelectionChanged
(object
> sender, System.EventArgs e)
> {
> GetProperties();
> }
>
> private void GetProperties()
> {
> propertyGrid.SelectedObject =
> templateGalleryExplorer.SelectedItems[0];
> }
> }
> }
> --<snip>------------------------------------------------------------------

---------------
>
> To build, create a working folder and copy the following files from
> your MCMS 2002 setup:
> DeveloperTools.xml
> DeveloperTools.xsd
> Microsoft.ContentManagement.DeveloperTools.ToolControls.dll
> Microsoft.ContentManagement.DeveloperTools.ToolsModel.dll
>
> If you've installed the MCMS developer tools you find these in the
> DevTools sub folder in the MCMS Program Files location (if not you can
> get them from the SP1a download).
>
> Save the above code as TemplateManager.cs and build using the command
> line shown in the code. The MCMS files are also required to run the
> application.
>
> Developed on Windows XP Pro with MCMS 2002/SP1, .NET 1.1.



Emmanuel

2004-02-23, 7:34 pm

Congrats for your work ...

This is a great idea

I just install VS.Net 2003 and I loose my template manager in Visual
Studio so your little app will replace it !!

Thanks ! =)

Emmanuel
Steve Walker

2004-02-25, 9:44 am

This is now available for download via GotDotNet at:

http://www.gotdotnet.com/Community/...%5b@ResourceId='69FEF7CE-5447-4C3A-B91C-355569563507'%5d

A precompiled .exe is included for use with .NET 1.1
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com