Project

General

Profile

« Previous | Next » 

Revision 4032

Added by berkley almost 16 years ago

added functionality to make the document public after upload

View differences:

util.js
114 114
  var searchval = document.getElementById("searchtextbox").value
115 115
  var url = '/sms/metacat?action=query&anyfield=' + searchval + '&returnfield=dataset/title&qformat=sms&pagesize=10&pagestart=0';
116 116
  setCookie("sms-searchval", searchval);
117
  setCookie("sms-pagestart", 0);
117 118
  reloadSearchContent(url);
118 119
}
119 120

  
120 121
function showDatasets()
121 122
{
122 123
  var searchval = getCookie('sms-searchval');
123
  alert('searchval: ' + searchval);
124
  if(searchval == '')
124
  if(searchval == null || searchval == '')
125 125
  {
126 126
    searchval = '%25';
127 127
  }
......
153 153
  $("form").submit();
154 154
}
155 155

  
156
function makepublic(docid)
157
{
158
  $.get("/sms/metacat?action=setaccess&docid=" + docid + 
159
        "&principal=public&permission=read&permType=allow&permOrder=allowFirst",
160
        function(data) {
161
          if(data.indexOf("<success>") != -1)
162
          {
163
            slideUp("#uploadstatus");
164
            $("#uploadstatus").html('<p>The document with id ' + 
165
              '<a href="/sms/metacat?action=read&docid=' + docid + '&qformat=sms">' + docid + 
166
              '</a> is now publicly readable.</p>');
167
            slideDown("#uploadstatus");
168
            //alert('success: ' + "#makepublic");
169
            //slideUp("#makepublic");
170
          }
171
          else
172
          {
173
            alert('The access control changes for ' + docid + ' failed.  It is not publicly readable.');
174
          }
175
        }, "XML");
176
}
177

  
156 178
function slideUp(id)
157 179
{
158 180
  $(id).slideUp("slow");

Also available in: Unified diff