Revision: 1981
Author: [email protected]
Date: Tue Jul 27 09:39:10 2010
Log: Added missing DOAP fields, removed unnecessary help texts and split
DOAP / JISC person fields (fixes Issue 316)
http://code.google.com/p/simal/source/detail?r=1981
Modified:
/trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/index.html
/trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js
=======================================
--- /trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/index.html
Fri Jul 23 01:56:57 2010
+++ /trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/index.html
Tue Jul 27 09:39:10 2010
@@ -39,8 +39,8 @@
</div>
<div class="q_container">
<div class="question">Full name of project:<span
class="mandatory">*</span></div>
- <div class="answer"><input type="text" id="name" class="short"
/><br />
- What is the full name of the project?</div>
+ <div class="answer"><input type="text" id="name" class="short"
/>
+ </div>
</div>
<div class="q_container">
<div class="question">Short project description (120 character
pitch):
@@ -65,8 +65,7 @@
</div>
<div class="q_container">
<div class="question">Project blog URL:</div>
- <div class="answer"><input type="text" id="blog" class="long"
/><br />
- URL of the public blog.</div>
+ <div class="answer"><input type="text" id="blog" class="long"
/></div>
</div>
<div class="q_container">
<div class="question">RSS2 or ATOM feed for project blog:</div>
@@ -101,25 +100,32 @@
<div id="people_container_9"></div>
<div id="people_container_10"></div>
<input type="button" class="generate" value="Add person"
- onclick="addPerson();" /></div>
+ onclick="addDOAPPerson();" /></div>
</div>
<div class="q_container">
<div class="question">Version control system:</div>
- <div class="answer"><span class="label">Type:</span><select
- id="repo_type">
- <option value="SVNRepository">Subversion</option>
- <option value="CVSRepository">CVS</option>
- <option value="GitRepository">Git Repository</option>
- <option value="BKRepository">BitKeeper</option>
- <option value="ArchRepository">GNU Arch</option>
- <option value="HgRepository">Mercurial</option>
- <option value="BazaarBranch">Bazaar Branch</option>
- <option value="DarcsRepository">Darcs Repository</option>
- </select> <span class="label">URL:</span><input type="text"
id="repo"
- class="long" /><br />
- URL of the version control system, eg. when your project is
named PPP
- and is hosted at GoogleCode, this would be
- 'http://PPP.googlecode.com/svn/trunk/'.</div>
+ <div class="answer"><span class="label">Type:</span>
+ <select id="repo_type">
+ <option value="SVNRepository">Subversion</option>
+ <option value="CVSRepository">CVS</option>
+ <option value="GitRepository">Git Repository</option>
+ <option value="BKRepository">BitKeeper</option>
+ <option value="ArchRepository">GNU Arch</option>
+ <option value="HgRepository">Mercurial</option>
+ <option value="BazaarBranch">Bazaar Branch</option>
+ <option value="DarcsRepository">Darcs Repository</option>
+ </select><br />
+ <span class="label">URL:</span>
+ <input type="text" id="repo" class="long" /><br />
+ URL of the version control system, eg. when your project is
+ named PPP and is hosted at GoogleCode, this would be
+ 'http://PPP.googlecode.com/svn/trunk/'.<br />
+ <span class="label">Browse URL:</span>
+ <input type="text" id="repo_browse" class="long" /><br />
+ Many hosting providers provide a web interface to the
version
+ control system, eg. if your project 'PPP' is hosted at
GoogleCode
+ the URL would
be 'http://code.google.com/p/PPP/source/browse/'.
+ </div>
</div>
<div class="q_container">
<div class="question">Issue tracker:</div>
@@ -129,6 +135,14 @@
issue tracker for project PPP this would be
'http://code.google.com/p/PPP/issues/list'.</div>
</div>
+ <div class="q_container">
+ <div class="question">Mailing list(s):</div>
+ <div class="answer">
+ <input type="text" id="mailing_list_1" class="long" /><br />
+ <input type="text" id="mailing_list_2" class="long" /><br />
+ URL to mailing list page(s) where people can register and
view the public archive(s).
+ </div>
+ </div>
<div class="q_container">
<div class="question">OSS license you will you be using for the
code generated from project:<span
class="mandatory">*</span></div>
@@ -159,6 +173,29 @@
<option value="false">Never heard of JISC</option>
</select></div>
</div>
+ <div class="q_container">
+ <div class="question_wide">Names, (main) roles and emails of
+ people working on or associated with project :<span
class="mandatory">*</span></div>
+ <div class="answer_wide">
+ <div class="label_people">Type:</div>
+ <div class="label_people">Name:<span
class="mandatory">*</span></div>
+ <div class="label_people">Email:<span
class="mandatory">*</span></div>
+ <div class="label_people">Personal homepage (emtpy for
none):</div>
+ <div class="label_people">URL link to a picture (emtpy for
none):</div>
+ <div id="people_container_11"></div>
+ <div id="people_container_12"></div>
+ <div id="people_container_12"></div>
+ <div id="people_container_13"></div>
+ <div id="people_container_14"></div>
+ <div id="people_container_15"></div>
+ <div id="people_container_16"></div>
+ <div id="people_container_17"></div>
+ <div id="people_container_18"></div>
+ <div id="people_container_19"></div>
+ <div id="people_container_20"></div>
+ <input type="button" class="generate" value="Add person"
+ onclick="addJISCPerson();" /></div>
+ </div>
<div id="jisc_questions">
<div class="q_container">
<div class="question">Person responsible for JISC project
@@ -181,8 +218,7 @@
</div>
<div class="answer">
<input type="text" id="projectemail" class="long" /><br />
- You will need a free gmail account to access this form for
future
- updates as well as for the <a
href="http://code.google.com/p/jisclms/"
+ You will need a free gmail account to access the <a
href="http://code.google.com/p/jisclms/"
target="_blank">Programme Manager's Notebook</a> to leave
comments.
</div>
</div>
=======================================
---
/trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js
Fri Jul 23 03:21:02 2010
+++
/trunk/uk.ac.osswatch.simal.web/src/main/widgets/doapcreator/scripts/doapform.js
Tue Jul 27 09:39:10 2010
@@ -19,7 +19,10 @@
return a.replace(/\s+$/, '');
};
-var personCount = 1;
+var DOAPPersonCount = 1;
+var JISCPersonCount = 1;
+
+var MAX_NR_PERSONS = 10;
var BASE_NAMESPACE_URL = "http://registry.oss-watch.ac.uk/";
var PEOPLE_NAMESPACE_URL = BASE_NAMESPACE_URL + "people/";
var CATEGORY_NAMESPACE_URL = BASE_NAMESPACE_URL + "categories/";
@@ -43,19 +46,35 @@
document.getElementById("jisc_questions").innerHTML = "";
}
-function generatePersonHtml(personIndex) {
+function generateDOAPPersonOptions() {
+ personHtml = " <option
value=\"maintainer\">Maintainer</option>\n";
+ personHtml += " <option
value=\"developer\">Developer</option>\n";
+ personHtml += " <option
value=\"documenter\">Documenter</option>\n";
+ personHtml += " <option value=\"tester\">Tester</option>\n";
+ personHtml += " <option value=\"helper\">Helper</option>\n";
+ personHtml += " <option
value=\"translator\">Translator</option>\n";
+
+ return personHtml;
+}
+
+function generateJISCPersonOptions() {
+ personHtml = " <option value=\"simal:project-director\">Project
director</option>\n";
+ personHtml += " <option value=\"simal:project-manager\">Project
manager</option>\n";
+ personHtml += " <option
value=\"simal:administrative-assistant\">Administrative</option>\n";
+ personHtml += " <option
value=\"simal:research-officer\">Research officer</option>\n";
+
+ return personHtml;
+}
+
+function generatePersonHtml(personIndex, DOAPpersons) {
personHtml = "";
personHtml += " <select id=\"person_type_" + personIndex +
"\">\n";
- personHtml += " <option value=\"simal:project-director\">Project
director</option>\n";
- personHtml += " <option value=\"simal:project-manager\">Project
manager</option>\n";
- personHtml += " <option
value=\"simal:administrative-assistant\">Administrative</option>\n";
- personHtml += " <option value=\"simal:research-officer\">Research
officer</option>\n";
- personHtml += " <option
value=\"maintainer\">Maintainer</option>\n";
- personHtml += " <option
value=\"developer\">Developer</option>\n";
- personHtml += " <option
value=\"documenter\">Documenter</option>\n";
- personHtml += " <option
value=\"tester\">Tester</option>\n";
- personHtml += " <option
value=\"helper\">Helper</option>\n";
- personHtml += " <option
value=\"translator\">Translator</option>\n";
+
+ if(DOAPpersons) {
+ personHtml += generateDOAPPersonOptions();
+ } else {
+ personHtml += generateJISCPersonOptions();
+ }
personHtml += " </select>\n";
personHtml += " <input type=\"text\" id=\"person_name_" +
personIndex
+ "\" class=\"short\"/>\n";
@@ -68,17 +87,35 @@
return personHtml;
}
-function addPerson() {
- if (personCount > 10) {
- alert("You can add a maximum of 10 people.");
- return;
- }
- document.getElementById("people_container_" + personCount).innerHTML =
generatePersonHtml(personCount++);
+function checkMaxpersonCount(personCount) {
+ if (personCount > MAX_NR_PERSONS) {
+ alert("You can add a maximum of " + MAX_NR_PERSONS + " people.");
+ throw new Error("You can add a maximum of " + MAX_NR_PERSONS + "
people.");
+ }
+}
+
+function addJISCPerson() {
+ checkMaxpersonCount(JISCPersonCount);
+ document.getElementById("people_container_"
+ + (JISCPersonCount + MAX_NR_PERSONS)).innerHTML =
+ addPerson((JISCPersonCount++ + MAX_NR_PERSONS), false);
+}
+
+function addDOAPPerson() {
+ checkMaxpersonCount(DOAPPersonCount);
+ document.getElementById("people_container_" + DOAPPersonCount).innerHTML
=
+ addPerson(DOAPPersonCount++, true);
+}
+
+
+function addPerson(personCount, DOAPPersons) {
+ return generatePersonHtml(personCount, DOAPPersons);
}
function addPersons(count) {
for (i = 1; i <= count; i++) {
- addPerson();
+ addJISCPerson();
+ addDOAPPerson();
}
}
@@ -253,7 +290,10 @@
var blog = checkUrl("blog");
var blogfeed = checkUrl("blogfeed");
var bug_database = checkUrl("bug_database");
+ var mailing_list_1 = checkUrl("mailing_list_1");
+ var mailing_list_2 = checkUrl("mailing_list_2");
var repo = checkUrl("repo");
+ var repo_browse = checkUrl("repo_browse");
} catch (e) {
return;
@@ -308,7 +348,9 @@
doap += " <repository>\n";
doap += " <" + repo_type + ">\n";
doap += " <location rdf:resource=\"" + repo + "\"/>\n";
- doap += " <browse rdf:resource=\"" + repo + "\"/>\n";
+ if (repo_browse != "") {
+ doap += " <browse rdf:resource=\"" + repo_browse + "\"/>\n";
+ }
doap += " </" + repo_type + ">\n";
doap += " </repository>\n";
}
@@ -316,6 +358,14 @@
if (bug_database != "") {
doap += " <bug-database rdf:resource=\"" + bug_database + "\"/>\n";
}
+
+ if (mailing_list_1 != "") {
+ doap += " <mailing_list rdf:resource=\"" + mailing_list_1 + "\"/>\n";
+ }
+
+ if (mailing_list_2 != "") {
+ doap += " <mailing_list rdf:resource=\"" + mailing_list_2 + "\"/>\n";
+ }
if (licence != "") {
doap += " <license rdf:resource=\"http://usefulinc.com/doap/licenses/"
@@ -462,15 +512,14 @@
} else {
reportError(xml_request);
}
- } else if (xml_request.readyState == 4) {
+ } else if (xml_request.readyState == 4 && (xml_request.status == 500 |
| xml_request.status == 403)) {
reportError(xml_request);
}
};
xml_request.setRequestHeader("Cache-Control", "no-cache");
- xml_request.setRequestHeader("Content-Type",
- "application/x-www-form-urlencoded");
- xml_request.send('rdf=' + doap);
+ xml_request.setRequestHeader("Content-Type", "text/xml");
+ xml_request.send(doap);
alert("Please copy and paste the green code (xml) and paste into a local
file.\n"
+ "I.e. copy and paste into a .txt file and then save on the 'about'
page of your project blog.\n\n");
}
--
You received this message because you are subscribed to the Google Groups "Simal
Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/simal-commits?hl=en.