WCM-FAQ.html #4

  • //
  • guest/
  • mike_meyer/
  • WCM-FAQ.html
  • View
  • Commits
  • Open Download .zip Download (8 KB)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
	"http://www.w3.org/TR/REC-html40/strict.dtd">

<html>
<head>
<title>Web Content Management FAQ</title>
<meta name="Author" content="Mike Meyer"></head>
<body>
<h1>Web Content Management FAQ</h1>

<p>Contributed by Mike Meyer</p>

<p><em>Some pointers on using <a
href="http://www.perforce.com/">Perforce</a> for Web Content
Management, presented in the form of a FAQ.</em></p>

<ul>
<li><a href="#wcmfaq1">What is W.C.M.?</a></li>
<li><a href="#wcmfaq2">How is W.C.M. different from S.C.M?</a></li>
<li><a href="#wcmfaq4">How can I use Perforce to help with my
    W.C.M. problems?</a></li>
<li><a href="#wcmfaq5">How can I ensure that no one edits files in the
    published branch?</a></li>
<li><a href="#wcmfaq6">How can I check my HTML documents?</a></li>
<li><a href="#wcmfaq7">How can I update my search engine's database?</a></li>
<li><a href="#wcmfaq8">How can I make my scripts executable?</a></li>
</ul>

<h2>Answers</h2>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq1"><a name="wcmfaq1"></a>What is W.C.M.?</h3>

<p>Web Content Management - W.C.M. - is the maintainence of the
content of a web site. Like an S.C.M. task, it involves keeping track
of a collection of files being revised by different people
for different reasons, and being able to recreate a specific set of
those files from any moment in time.</p>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq2"><a name="wcmfaq2"></a>How is W.C.M. different from S.C.M?</h3>

<p>S.C.M. involves maintaining a collection of files that go through a
build process to create a product that can be tested.  W.C.M. involves
maintaining the files for a web site. A web site is a collection of
pages which users access over the web. Some of those pages are just
bits of text. Others are programs - possibly compiled - that
dynamically generate new text on every access. Any possible variation
between those extremes is possible, from pages that are nearly static
with a few bits of dynamically generated text, to programming
languages that have the same structure as the generated HTML page.</p>

<p>One major difference between W.C.M. and S.C.M. is in the build
phase. The result of a build is critical to an S.C.M., as that
<strong>is</strong> the product. For a W.C.M., there may not be a
build phase at all.</p>

<p>A second major difference between W.C.M. and S.C.M. is that there
is only <strong>one</strong> web site, and everyone uses it. You don't
have a copy of the product for each user, and one for testing.</p>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq3"><a name="wcmfaq3"></a>How do I test a web site?</h3>

<p>For static pages, you verify that the pages meet your standards
(see <a href="#wcmfaq6">the question on checking documents</a> for
instruction on automating this), and that all the links are to valid
documents. Since web sites sometimes vanish or change - even yours -
running link checks on the production files at regular intervals is a
good practice.</p>

<p>For dynamic pages, part of whose content come from an external
database, the problem is much harder. You don't want to run tests
against the production database. The solution is to duplicate the
production environment on a <em>test</em> server, and run tests on
that. In extreme cases, the database client software running on the
web server may not be something that can be duplicated on each
developers desktop. In this case, a third copy of the server can be
set up as a <em>development</em> server, though this leads to quite
predictable resource conflicts.</p>

<p>Software for testing web sites is a rapidly changing field. Rather
than recommend a specific product or product list, I'd recommend
trying your favorite search engine for <em>web server testing</em></p>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq4"><a name="wcmfaq4"></a>How can I use Perforce to help with my W.C.M. problems?</h3>

<p>By using it to help manage the files, just as you would if they
were part of any other product. See the white paper on <a
href="http://www.perforce.com/perforce/wcm.html">Web Content
Management with Perforce</a> for a detailed description of several
plans for doing this.</p>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq5"><a name="wcmfaq5"></a>How can I ensure that no one edits files in the
published branch?</h3>

<p>By adding a trigger to the published branch which verifies that the
changes which affect files in that branch are branches, integrations
or deletions. The <em>checkfor.py</em> script can do this, with a
trigger line similar to:</p>

<pre>integration //depot/web/published/... "checkfor.py ' - (integrate|branch|delete) change ' %changelist% %serverport%"</pre>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq6"><a name="wcmfaq6"></a>How can I check my HTML documents?</h3>

<p>Perforce can do this for you.  Doing so requires that you have one
branch for unchecked files, and a branch for checked files - which is
one of the two methods recommended by the white paper on <a
href="http://www.perforce.com/perforce/wcm.html">Web Content
Management with Perforce</a>. Since files in the published branch
should be exact copies of the files in the development branch (see <a
href="#wcmfaq5">the question on preventing edits</a>), a trigger on
the published branch can get the file from the development branch to
check. The error messages from the checker will be sent to the
change submitter if the check fails, so the developer is notified
about what needs to be fixed.</p>

<p>After such an integration fails, the file in the published branch
is locked. Fixing the problem will require reverting the file on the
published branch before reintegrating the fixed file from the
production branch.</p>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq7"><a name="wcmfaq7"></a>How can I update my search engine's database?</h3>

<p>The answer depends on how you are getting files from Perforce to
the web server, and how your search engine builds the database.</p>

<p>To take proper advantage of Perforce in this case, you need a
search engine that can update its database when a single file
changes. Once you have that, you add hooks to the W.C.M. system to get
a list of files that have changed so the database can be updated.</p>

<p>If your production web server is a client which you synchronize to
the Perforce depot to update, then the list of new files is
immediately available as the output of the <em>p4 sync</em>
command. It will need to be massaged into a form acceptable to the
search engine, which should be a simple text substitution.</p>

<p>If you are using <a
href="http://www.perforce.com/perforce/webkeeper.html">WebKeeper,</a>
then the list of files isn't quite so readily available. In this case,
you set up a review daemon which gets the lists of changes that
involve the web files in the depot, and extract the list of depot
files from those changes. From this point, it's again a simple matter
of text substitution.</p>

<!-- if netscape weren't garbage, the <A> wouldn't need to be here -->
<h3 id="wcmfaq8"><a name="wcmfaq8"></a>How can I make my scripts executable?</h3>

<p>Perforce stores the file type for each file which includes this
information. See the <code>p4 help filetypes</code> text for complete
information for your server. The correct type for scripts is
<em>text+x</em>.</p>

<p>The easy way to get this set properly is to make the file
executable in the client workspace before adding it to the
depot. Perforce will set the type properly from that. If the file
doesn't exist, you can use <code>p4 add -t text+x
<em>filename</em></code> to set the file type. If it has already been
added, or is being edited, use <code>p4 reopen -t text+x
<em>filename</em></code>. If the file is not open for editing, then
you must edit it, and can use <code>p4 edit -t text+x
<em>filename</em></code>. These commands will set the file type to
executable when the file is submitted to the depot, and the next sync
on the server will make the file executable there.</p>

</html>
# Change User Description Committed
#4 222 Mike Meyer Add unneeded <A> tags so that a really, really badly written
browsers (like Netscape Navigator) can find internal links.
#3 221 Mike Meyer Add "How do I make my scripts executable" Q & A.
#2 220 Mike Meyer Minor correction of the english before public announcement.
#1 217 Mike Meyer Rename the WCM FAQ to the top level.
//guest/mike_meyer/perforce/WCM-FAQ.html
#6 208 Mike Meyer Split "How can I test my web server" into a separate question.
#5 206 Mike Meyer Actually get the changes that are in the buffer.
#4 205 Mike Meyer Changes from Donna Inches.
#3 203 Mike Meyer Change differences to note the problems with the environment
not being replicable to each developer, etc.
#2 200 Mike Meyer Include the changes from Baj.
#1 199 Mike Meyer Add first version of a WCM faq.
Put in checkfor.py for the FAQ to refer to.