blob: b5c80bf525bc6c278fb97f82a0ba6832bc5e654b [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2016, 2017 Eclipse Foundation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
require_once (dirname ( __FILE__ ) . "/../../eclipse.org-common/system/app.class.php");
require_once (dirname ( __FILE__ ) . "/../../eclipse.org-common/system/nav.class.php");
require_once (dirname ( __FILE__ ) . "/../../eclipse.org-common/system/menu.class.php");
require_once dirname(__FILE__) . "/../classes/Project.class.php";
require_once dirname(__FILE__) . "/../classes/common.php";
require_once dirname(__FILE__) . "/../classes/debug.php";
$App = new App ();
$Nav = new Nav ();
$Menu = new Menu ();
include ($App->getProjectCommon ());
mustBeCommitter();
require_once dirname ( __FILE__ ) . '/legal.inc';
$pageTitle = "Legal Documentation Generator";
$pageKeywords = "";
$pageAuthor = "Wayne Beaton";
$project = null;
if ($id = @$_GET ['id'])
if (isValidProjectId ( $id ))
$project = Project::getProject ( $id );
if (! $width = ( int ) @$_GET ['width'])
$width = 80;
ob_start ();
function renderTemplate($function) {
echo "<pre style=\"background: lightgrey\">";
$function ();
echo "</pre>";
}
/**
* This function renders a project selection drop-down.
* When the
* user selects a value, the page is reloaded with the id of the
* selected project in the <code>id</code> parameter. All other
* parameters that had been passed to the page are preserved via
* hidden fields.
*
* @param string $id
* The id of the selected project
*/
function dumpProjectSelectionForm($id) {
echo "<form method=\"get\">";
foreach ( $_GET as $key => $value ) {
if ($key == 'id')
continue;
echo "<input type=\"hidden\" name=\"$key\" value=\"$value\"";
}
echo "<p>Select a project: ";
echo "<select name=\"id\" onchange=\"this.form.submit()\">";
foreach ( Project::getActiveProjects () as $project ) {
$indent = str_repeat ( '&nbsp;', 4 * (count ( explode ( '.', $project->getId () ) ) - 1) );
$selected = $id == $project->getId () ? ' selected="true"' : '';
echo "<option value=\"{$project->getId()}\"$selected>{$indent}{$project->getFormalName()}</option>";
}
echo "</select>";
echo "<input type=\"submit\" value=\"Go!\"/>";
echo "</p>";
echo "</form>";
}
?>
<div id="maincontent">
<div id="midcolumn">
<h1><?= $pageTitle ?></h1>
<p>
<strong>EXPERIMENTAL!</strong>
</p>
<p>
This page provides automatically generated template content for legal
documentation, including copyright and license headers, copyright
assignments for notices, and more. The information here is generated
from information found in our databases. Some information may be
missing; it is ultimately the project team's responsibility to
provide this information. As we evolve this <em>experimental</em>
implementation, we will identify gaps and improve the quality of the
output.
</p>
<p>
There is more information in the
<a href="https://www.eclipse.org/projects/handbook/#legaldoc">Eclipse
Project Handbook</a>.
</p>
<?php dumpProjectSelectionForm($id); ?>
<?php
if ($project) {
?>
<h2><?php echo $project->getFormalName(); ?></h2>
<h3 id="copyright">Copyright and License Header</h3>
<p>
Where possible, all source code, property files, and metadata files
(including application, test, and generated source code as well as
other types of files such as XML, HTML, etc.) must include a header
with appropriate <a
href="/projects/handbook/#ip-copyright-headers">copyright
and license notices</a>.
</p>
<p>The following copyright and license header should be a reasonable
default for project files based on the information available in the
Eclipse Foundation database.</p>
<p>A <a href="legal/header.php?id=<?php echo $id?>">Plain Text Version</a>
is available.</p>
<?php
renderTemplate ( function () use (&$project, $width) {
echo getDefaultFileHeader ( $project->getLicenses (), $width );
} );
?>
<p>Alternatively, the project team may choose to adopt this more
generic copyright header for each file and include the identities of
the copyright holders in the notice file.</p>
<?php
renderTemplate ( function () use (&$project, $width) {
echo getAlternativeFileHeader ( $project->getLicenses (), $width );
} );
?>
<h3 id="notice">NOTICE File</h3>
<p>The <a href="/projects/handbook/#legaldoc-notice">NOTICE</a>
file must include basic project metadata, an expression of the
declared project licenses, information regarding the licensing of any
third party content, and a statement regarding the use of
cryptography in cases where the content employs cryptography.</p>
<p>The NOTICE file may have an extension, and should be placed in the root of all project
repositories.</p>
<?php
renderTemplate ( function () use (&$id, $width) {
renderNoticeFile ( $id, $width );
} );
?>
<h3 id="license">LICENSE File</h3>
<p>
The <a href="https://www.eclipse.org/projects/handbook/#legaldoc-license">LICENSE</a> file contains the exact text of the project's declared licenses in human readable form.
</p>
<p>
We don't have a generator for this yet. For most projects,
however, this file should contain the text of the
Eclipse Public License.
</p>
<ul>
<li><a href="https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt">Eclipse Public License 2.0</a>
<li><a href="https://www.eclipse.org/org/documents/epl-1.0/EPL-1.0.txt">Eclipse Public License 1.0</a></li>
</ul>
<p>The LICENSE file may have an extension, and should be placed in the root of all project
repositories.</p>
<h3 id="contributing">CONTRIBUTING File</h3>
<p>The CONTRIBUTING file describes the steps by which a developer
can contribute to the project. This includes information like
pointers to the Eclipse Contributor Agreement (ECA), coding
guidelines, build instructions, etc.</p>
<p>The CONTRIBUTING file may have an extension, and should be placed in the root of all project
repositories.</p>
<p>A <a href="legal/contributing.php?id=<?php echo $id?>">Plain Text Version</a>
is available. Note that you must be logged in for this link to work.</p>
<?php
renderTemplate ( function () use (&$id, $width) {
renderContributingFile ( $id, $width );
} );
?>
<?php
}
?>
</div>
</div>
<?php
$html = ob_get_contents ();
ob_end_clean ();
$App->generatePage ( $theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html );
?>