Project

General

Profile

« Previous | Next » 

Revision 3997

Added by berkley over 16 years ago

removing some sms that somehow got in this dir

View differences:

lib/style/skins/knb/util.js
1
function login()
2
{
3
  var user = document.getElementById("un").value;
4
  var org = document.getElementById("org").value;
5
  var pass = document.getElementById("pw").value;
6
  var ldapUsername = 'uid=' + user + ',o=' + org + ',dc=ecoinformatics,dc=org';
7
  
8
  $.get("metacat", {username: ldapUsername, password: pass, action:"login", qformat:"xml"}, 
9
    function(data) {
10
      //alert('user ' + ldapUsername + ' logged in.  data:' + data);
11
      if(data.indexOf('<sessionId>') != -1)
12
      { //login successful
13
        //alert('user logged in');
14
        slideUp("#loginformdiv");
15
        setCookie("sms-login", true);
16
        setCookie("sms-user", user);
17
        setCookie("sms-org", org);
18
        setLoginHeader(true);
19
      }
20
      else
21
      { //login not successful
22
        alert('Sorry, your login failed.  Please try again.  If you need a username, please go to http://knb.ecoinformatics.org.');
23
        setCookie("sms-login", false);
24
      }
25
      
26
    }, "XML");
27
}
28

  
29
function setLoginHeader(loggedin)
30
{
31
  if(loggedin)
32
  {
33
    var user = getCookie("sms-user");
34
    $('#loginheader').replaceWith("<h2 style=\"text-align:center\" id=\"loginheader\">" 
35
      + user + " Logged In <a href=\"javascript:\" onclick=\"logout()\" style=\"font-size:70%\">[logout]</a></h2>");
36
    slideUp("#loginformdiv");
37
    $('#maindiv').css("display", "block");
38
    $('#bottomimg').css("bottom", "0px");
39
    $.get("metacat", {action:"getlastdocid", scope:"sms"}, 
40
      function(data)
41
      {
42
        var docid = data.substring(data.indexOf("<docid>") + 7, data.indexOf("</docid>"));
43
        var nextid;
44
        if(docid == 'null')
45
        {
46
          nextid = "sms.1.1";
47
        }
48
        else
49
        {
50
          nextid = docid.substring(docid.indexOf(".") + 1, docid.lastIndexOf("."));
51
          nextid++;
52
          nextid = "sms." + nextid + ".1";
53
        }
54
        $('#docidtextfield').val(nextid); 
55
      }, 
56
      "XML");
57
  }
58
  else
59
  {
60
    $('#loginheader').replaceWith("<h2 style=\"text-align:center\" id=\"loginheader\">" 
61
      + "Please Log In</h2>");
62
    slideDown("#loginformdiv");
63
    $('#maindiv').css("display", "none");
64
    $('#bottomimg').css("bottom", "15px");
65
  }
66
}
67

  
68
function logout()
69
{
70
  $.get("metacat", {action:"logout", qformat:"xml"});
71
  setLoginHeader(false);
72
  setCookie("sms-login", false);
73
}
74

  
75
function checkLogin()
76
{
77
  if(getCookie("sms-login") == "true")
78
  {
79
    setLoginHeader(true);
80
  }
81
  else
82
  {
83
    setLoginHeader(false);
84
  }
85
}
86

  
87
function uploadfile()
88
{
89
  if(getCookie("sms-login") != "true")
90
  {
91
    alert('You cannot upload.  You are not logged in.');
92
    return;
93
  }
94
  
95
  /*$.post("metacat", $("form").serialize(), 
96
    function(data)
97
    {
98
      alert($("form").serialize());
99
      alert(data);
100
    }, 
101
    "XML");*/
102
  $("form").submit();
103
}
104

  
105
function slideUp(id)
106
{
107
  $(id).slideUp("slow");
108
}
109

  
110
function slideDown(id)
111
{
112
  $(id).slideDown("slow");
113
}
114

  
115
function setCookie( name, value, expires, path, domain, secure ) 
116
{
117
  // set time, it's in milliseconds
118
  var today = new Date();
119
  today.setTime( today.getTime() );
120
  
121
  /*
122
  if the expires variable is set, make the correct 
123
  expires time, the current script below will set 
124
  it for x number of days, to make it for hours, 
125
  delete * 24, for minutes, delete * 60 * 24
126
  */
127
  if ( expires )
128
  {
129
    expires = expires * 1000 * 60 * 60 * 24;
130
  }
131
  var expires_date = new Date( today.getTime() + (expires) );
132
  
133
  document.cookie = name + "=" +escape( value ) +
134
  ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
135
  ( ( path ) ? ";path=" + path : "" ) + 
136
  ( ( domain ) ? ";domain=" + domain : "" ) +
137
  ( ( secure ) ? ";secure" : "" );
138
}
139

  
140
function getCookie( check_name ) {
141
	// first we'll split this cookie up into name/value pairs
142
	// note: document.cookie only returns name=value, not the other components
143
	var a_all_cookies = document.cookie.split( ';' );
144
	var a_temp_cookie = '';
145
	var cookie_name = '';
146
	var cookie_value = '';
147
	var b_cookie_found = false; // set boolean t/f default f
148
	
149
	for ( i = 0; i < a_all_cookies.length; i++ )
150
	{
151
		// now we'll split apart each name=value pair
152
		a_temp_cookie = a_all_cookies[i].split( '=' );
153
		
154
		// and trim left/right whitespace while we're at it
155
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
156
	
157
		// if the extracted name matches passed check_name
158
		if ( cookie_name == check_name )
159
		{
160
			b_cookie_found = true;
161
			// we need to handle case where cookie has no value but exists (no = sign, that is):
162
			if ( a_temp_cookie.length > 1 )
163
			{
164
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
165
			}
166
			// note that in cases where cookie is initialized but no value, null is returned
167
			return cookie_value;
168
			break;
169
		}
170
		a_temp_cookie = null;
171
		cookie_name = '';
172
	}
173
	if ( !b_cookie_found )
174
	{
175
		return null;
176
	}
177
}		
178 0

  
lib/style/skins/knb/sms.css
1
body 
2
{
3
	font-size: 70%; /* Resets 1em to 10px */
4
	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
5
	background-color: white;
6
	color: #333;
7
}
8
  
9
#page 
10
{
11
  width: 700px;
12
  margin: 00px auto;
13
  border: 0px;
14
  background: #e7bd59;
15
}
16

  
17
img
18
{
19
  border: 0px;
20
}
21

  
22
p
23
{
24
  padding: 5px;
25
}
26

  
27
.headerbar
28
{
29
  width: 650px;
30
  margin: 0px auto;
31
  border: 1px;
32
}
33

  
34
a:hover
35
{
36
  color:#e7bd59;
37
}
38

  
39
a
40
{
41
  text-decoration:none;
42
  color:white;
43
  font-size: 70%;
44
}
45 0

  
lib/style/skins/knb/sms.js
1
 /**
2
  *   '$RCSfile$'
3
  *     Purpose: Default style sheet for KNB project web pages 
4
  *              Using this stylesheet rather than placing styles directly in 
5
  *              the KNB web documents allows us to globally change the 
6
  *              formatting styles of the entire site in one easy place.
7
  *   Copyright: 2000 Regents of the University of California and the
8
  *               National Center for Ecological Analysis and Synthesis
9
  *     Authors: Matt Jones
10
  *
11
  *    '$Author$'
12
  *      '$Date$'
13
  *  '$Revision$'
14
  *
15
  * This program is free software; you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License as published by
17
  * the Free Software Foundation; either version 2 of the License, or
18
  * (at your option) any later version.
19
  *
20
  * This program is distributed in the hope that it will be useful,
21
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
  * GNU General Public License for more details.
24
  *
25
  * You should have received a copy of the GNU General Public License
26
  * along with this program; if not, write to the Free Software
27
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
  */
29

  
30
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
31
 * * * * * *  CONFIGURATION SETTINGS - EDIT THESE FOR YOUR ENVIRONMENT * * * * 
32
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
33

  
34
 
35
//  These settings allow you to include and display common content (eg a common 
36
//  header) on all your pages, in much the same way as a frameset allows you to 
37
//  do, but through the use of iframes and a table instead. You can include up 
38
//  to 4 external pages, each one within the header, footer, left or right areas
39
//
40
//  looks like this (if you're using a fixed width font to display these notes):
41
//    ___________________
42
//    |     header      |
43
//    |-----------------|
44
//    | |             | |
45
//    | |             | |
46
//    |L|   content   |R|
47
//    | |             | |
48
//    | |             | |
49
//    |-----------------|
50
//    |     footer      | 
51
//    -------------------
52
//
53
//  Each area may display another page on the local site, or a page on a 
54
//  different server, or may be set to display nothing (in which case an iframe 
55
//  will not be drawn, although the containing table cell will still need to be 
56
//  resized using the css style - see below) 
57
//
58
//  NOTES:
59
//
60
//  1) if you have any links in the included documents, the target attribute for 
61
//     these *MUST* be set to _top, otherwise the new document will be displayed 
62
//     inside the small iframe areas, instead of replacing the entire page!
63
//     - example: <a href="index.html" target="_top">HOME</a>
64
//   
65
//  2) you will need to set the correct iframe size, in order to accomodate 
66
//     each of these areas on the page. The default location for these size 
67
//     settings is in the default.css file - see the "IFRAME_XXXXXX_CLASS" 
68
//     variables (below) for the name of the style to edit
69
//
70
//  3) you will also need to set the correct table cell sizes and/or overall 
71
//     table size for similar reasons. The default location for these size 
72
//     settings is in the default.css file - see the "TEMPLATE_XXXXXX_CLASS" 
73
//     variables (below) for the name of the style to edit
74

  
75

  
76

  
77
////////////////////////////////////////////////////////////////////////////////
78
//  Edit these variables to define the content that will be loaded into the 
79
//  various iframes. Each may be a relative path to another page on the local 
80
//  site, or a full URL to a page on a remote server, or may be set to the empty 
81
//  string if no content is required at that position on the page (and in which  
82
//  case an iframe will not be drawn, although an empty table cell will still  
83
//  exist unless it is resized smaller) . 
84
//  ( e.g. if you do not want a header to be included, set: HEADER_URL="";)
85
////////////////////////////////////////////////////////////////////////////////
86

  
87
//NOTE: for KNB skin, these file locations are set to the ROOT web application path
88

  
89
//  Location of the header that will be displayed at the top of the page
90
var HEADER_URL 
91
  = "/includes/include_portalhead_page.jsp";
92

  
93
// Location of the search box that will be displayed above the  
94
//  results on the results page (optional)
95
var SEARCHBOX_URL 
96
  = "/includes/include_searchbox_page.jsp";
97

  
98
//  Location of the header that will be displayed at the top of the page
99
var LEFTCOL_URL 
100
  = "";
101
  
102
//  Location of the header that will be displayed at the top of the page
103
var RIGHTCOL_URL 
104
  = "";
105
  
106
//  Location of the header that will be displayed at the top of the page
107
var FOOTER_URL 
108
  = "";
109
  
110

  
111

  
112

  
113
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
114
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
115
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
116
/* * * * * * * * *  MAY CHANGE THE FOLLOWING, BUT SHOULDN'T NEED TO* * * * * */ 
117
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
118
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
119
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
120

  
121
  
122
////////////////////////////////////////////////////////////////////////////////
123
//  Edit the default.css file to set the correct iframe sizes to accomodate the 
124
//  header, footer, left and right areas.
125
//  The following variables set the names of the styles that will be applied to 
126
//  each of the iframes - they can be anythign you wish, provided you use the 
127
//  same names for your classes in the css file
128
//  NOTE: these styles apply only to each container frame, *NOT* to the document 
129
//  within it!
130
////////////////////////////////////////////////////////////////////////////////
131

  
132
//header iframe class
133
var IFRAME_HEADER_CLASS         = "iframeheaderclass";
134

  
135
//(metacat only) search box iframe class
136
var IFRAME_SEARCHBOX_CLASS      = "iframesearchboxclass";
137

  
138
//left column iframe class
139
var IFRAME_LEFTCOL_CLASS        = "iframeleftcolclass";
140

  
141
//right column iframe class
142
var IFRAME_RIGHTCOL_CLASS       = "iframerightcolclass";
143

  
144
//footer iframe class
145
var IFRAME_FOOTER_CLASS         = "iframefooterclass";
146

  
147

  
148
////////////////////////////////////////////////////////////////////////////////
149
//  Edit the default.css file to set the correct table sizes to accomodate the 
150
//  header, footer, left and right iframes.
151
//  The following variables set the names of the styles that will be applied to 
152
//  each of the table cells (or the table itself - see below) - they can be 
153
//  anything you wish, provided you use the same names for your classes in the 
154
//  css file
155
//  NOTE: these styles apply only to each table cell, *NOT* to the document 
156
//  inside the iframe that is nested within it! (the exception is 
157
//  TEMPLATE_CONTENTAREA_CLASS, since the content probably isn't within an 
158
//  iframe - so style elements in this class will apply to the content istelf)
159
////////////////////////////////////////////////////////////////////////////////
160

  
161
//entire table class
162
var TEMPLATE_TABLE_CLASS        = "templatetableclass";
163

  
164
//header table-cell class. Note you should not set css "width" on this, since it 
165
//includes a colspan
166
var TEMPLATE_HEADERROW_CLASS    = "templateheaderrowclass";
167

  
168
//left column table-cell class. Note that restricting css "height" on this may 
169
//affect visibility of the main content, since it's in the same table row 
170
var TEMPLATE_LEFTCOL_CLASS      = "templateleftcolclass";
171

  
172
//main central content table-cell class. Note that css attributes set here may 
173
//apply to the content nested inside this cell
174
var TEMPLATE_CONTENTAREA_CLASS  = "templatecontentareaclass";
175

  
176
//rigth column table-cell class. Note that restricting css "height" on this may 
177
//affect visibility of the main content, since it's in the same table row 
178
var TEMPLATE_RIGHTCOL_CLASS     = "templaterightcolclass";
179

  
180
//footer table-cell class. Note you should not set "width" on this, since it 
181
//includes a colspan
182
var TEMPLATE_FOOTERROW_CLASS    = "templatefooterrowclass";
183

  
184

  
185 0

  
lib/style/skins/knb/sms.cfg
1
#
2
# General configuration parameters
3
#
4
metacatUrl = http://@httpserver@@servlet-path@
5
username = uid=knbadmin,o=NCEAS,dc=ecoinformatics,dc=org
6
password = your-pw-goes-here
7
ldapUrl=@ldapUrl@
8
defaultScope = sms
9
organization = SEEK
10
orgabbrev = SEEK
11
orgurl = http://seek.ecoinformatics.org/
12
responseTemplate = @responseForm@
13
entryFormTemplate = @entryForm@
14
guideTemplate = @guide@
15
confirmDataTemplate = @confirmData@
16
deleteDataTemplate = @deleteData@
17
accesspubid = -//ecoinformatics.org//eml-access-2.0.0beta6//EN
18
accesssysid = eml-access.dtd
19
datasetpubid = eml://ecoinformatics.org/eml-dataset-2.0.0
20
datasetsysid = eml-dataset.dtd
21
mailhost = @mailhost@ 
22
sender = KNB Data Registry <help@nceas.ucsb.edu>
23
recipient = help@nceas.ucsb.edu
24
adminname = the repository administrator
25
debug = 1
26
lsite = 'station'
27
usite = 'Station'
28
showSiteList = 'false'
29
showWgList = 'false'
30
showOrganization = 'true'
31
hasTaxonomic = 'true'
32
hasMethod = 'true'
33
hasSpatial = 'true'
34
hasKeyword = 'true'
35
hasTemporal = 'true'
36
nceas_db = somedb
37
nceas_db_user = someuser
38
nceas_db_password = your-pw-goes-here
39 0

  
lib/style/skins/knb/sms.xml
1
<?xml version="1.0"?>
2
<style-set name="sms">
3
<!-- general login & search -->
4
  <default-style>/style/common/ascii-treeview.xsl</default-style>
5
  
6
  <doctype publicid="message">
7
    <target publicid="-//W3C//HTML//EN">/style/skins/sms/redirect.xsl</target>
8
  </doctype>
9

  
10
  <doctype publicid="-//NCEAS//resultset//EN">
11
    <target publicid="-//W3C//HTML//EN">/style/common/resultset.xsl</target>
12
  </doctype>
13

  
14
<!-- added back login authentication for the registry workflow -->
15
  <doctype publicid="-//NCEAS//login//EN">
16
    <target publicid="-//W3C//HTML//EN">/style/common/login.xsl</target>
17
  </doctype>
18

  
19
  <!--FGDC styles -->
20
  <doctype publicid="metadata">
21
    <target publicid="-//W3C//HTML//EN">/style/skins/knb/knb_fgdc.xsl</target>
22
  </doctype>
23
<!--
24
  <doctype publicid="-//NCEAS//eml-generic//EN">
25
    <target publicid="-//W3C//HTML//EN">/style/common/generic-morpho.xsl</target>
26
  </doctype>
27
-->
28

  
29
<!-- pre-beta6 modules -->
30
<!-- NOTE these settings are unchanged from the previous version - only the xsl 
31
     filename has changed from "eml-dataset-display.xsl" to "eml-dataset-2.0.0beta4.xsl" -->
32
  <doctype publicid="eml://ecoinformatics.org/eml-2.0.1">
33
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.1/eml.xsl</target>
34
  </doctype>
35
  <doctype publicid="eml://ecoinformatics.org/eml-2.0.0">
36
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.1/eml.xsl</target>
37
  </doctype>
38
  <doctype publicid="-//NCEAS//eml-dataset//EN">
39
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta4/eml-dataset-2.0.0beta4.xsl</target>
40
  </doctype>
41
  <doctype publicid="-//NCEAS//eml-dataset-2.0//EN">
42
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta4/eml-dataset-2.0.0beta4.xsl</target>
43
  </doctype>
44
  <doctype publicid="-//NCEAS//eml-resource//EN">
45
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta4/eml-dataset-2.0.0beta4.xsl</target>
46
  </doctype>
47
  <doctype publicid="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN">
48
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta4/eml-dataset-2.0.0beta4.xsl</target>
49
  </doctype>
50
<!-- beta6 modules -->
51
  <doctype publicid="-//ecoinformatics.org//eml-access-2.0.0beta6//EN">
52
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-access-2.0.0beta6.xsl</target>
53
  </doctype>
54
  <doctype publicid="-//ecoinformatics.org//eml-attribute-2.0.0beta6//EN">
55
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-attribute-2.0.0beta6.xsl</target>
56
  </doctype>
57
  <doctype publicid="-//ecoinformatics.org//eml-constraint-2.0.0beta6//EN">
58
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-constraint-2.0.0beta6.xsl</target>
59
  </doctype>
60
  <doctype publicid="-//ecoinformatics.org//eml-coverage-2.0.0beta6//EN">
61
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-coverage-2.0.0beta6.xsl</target>
62
  </doctype>
63
  <doctype publicid="-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN">
64
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-dataset-2.0.0beta6.xsl</target>
65
  </doctype>
66
  <doctype publicid="-//ecoinformatics.org//eml-entity-2.0.0beta6//EN">
67
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-entity-2.0.0beta6.xsl</target>
68
  </doctype>
69
  <doctype publicid="-//ecoinformatics.org//eml-literature-2.0.0beta6//EN">
70
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-literature-2.0.0beta6.xsl</target>
71
  </doctype>
72
  <doctype publicid="-//ecoinformatics.org//eml-physical-2.0.0beta6//EN">
73
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-physical-2.0.0beta6.xsl</target>
74
  </doctype>
75
  <doctype publicid="-//ecoinformatics.org//eml-project-2.0.0beta6//EN">
76
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-project-2.0.0beta6.xsl</target>
77
  </doctype>
78
  <doctype publicid="-//ecoinformatics.org//eml-protocol-2.0.0beta6//EN">
79
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-protocol-2.0.0beta6.xsl</target>
80
  </doctype>
81
  <doctype publicid="-//ecoinformatics.org//eml-software-2.0.0beta6//EN">
82
    <target publicid="-//W3C//HTML//EN">/style/common/eml-2.0.0beta6/eml-software-2.0.0beta6.xsl</target>
83
  </doctype>
84
</style-set>
85 0

  

Also available in: Unified diff