Changeset 6576


Ignore:
Timestamp:
Oct 22, 2014, 6:41:55 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

Merged patch release 3.3.2 to the trunk.

Location:
trunk
Files:
2 deleted
58 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/credits.txt

    r6540 r6576  
    11$Id$
    22
    3 The current BASE team is (at BASE 3.3.1 release)
     3The current BASE team is (at BASE 3.3.2 release)
    44{{{
    55Jari Häkkinen
     
    2121Peter Johansson
    2222David Lindgren
     23Bob MacCallum
    2324Olle Månsson
    2425Peter Mörck
  • trunk/doc/src/docbook/developer/documentation.xml

    r6403 r6576  
    989989          All screen shots are from Firefox and Windows 7. Popup windows in Firefox should not have the
    990990          navigation toolbar (nor any other toolbars). Full windows should have the navigation toolbar.
    991           Replace the URL with <userinput>base2.thep.lu.se/demo/</userinput>. Avoid extra toolbar buttons,
     991          Replace the URL with <userinput>base.onk.lu.se/demo/</userinput>. Avoid extra toolbar buttons,
    992992          etc. that are from plug-ins you may have installed in Firefox.
    993993          </para>
  • trunk/doc/src/docbook/developer/migrate_2_3.xml

    r5830 r6576  
    133133      You'll need to make sure that your build system can handle this.
    134134      The BASE JAR files can be downloaded from
    135       <ulink url="http://base2.thep.lu.se/base/jars/">http://base2.thep.lu.se/base/jars/</ulink>.
     135      <ulink url="http://base.thep.lu.se/chrome/site/files/base/jars/">http://base.thep.lu.se/chrome/site/files/base/jars/</ulink>.
    136136    </note>
    137137   
  • trunk/doc/src/docbook/developer/plugins.xml

    r6429 r6576  
    355355        <note>
    356356          <para>
    357           The installation wizard can only install configurations that belong to
    358           plug-ins defined by the same package. It is currently not possible to,
    359           for example, include configuration for core plug-ins.
     357          As of BASE 3.3.2 the installation wizard can also install configurations
     358          for plug-ins defined by the BASE core or other extensions. Simply include
     359          the configuration settings for the plug-in as you would do with a configuration
     360          for a plug-in defined by your own extension.
    360361          </para>
    361362        </note>
  • trunk/doc/src/docbook/overview/resources.xml

    r6465 r6576  
    211211      explore BASE without having to install it. Follow the link on
    212212      BASE web site to the demo server or go directly to
    213       <ulink url="http://base2.thep.lu.se/demo/">
    214         http://base2.thep.lu.se/demo/
    215       </ulink>
     213      <ulink url="http://base.onk.lu.se/demo/">
     214        http://base.onk.lu.se/demo/
     215      </ulink>. NOTE! The demo server is currently down!
    216216    </para>
    217217    <para>
  • trunk/doc/src/docbook/user/webclient.xml

    r6268 r6576  
    4747        <para>
    4848          You may, for example, try the BASE demo server. Go to the
    49           URL <ulink url="http://base2.thep.lu.se/demo/">http://base2.thep.lu.se/demo/</ulink>
     49          URL <ulink url="http://base.onk.lu.se/demo/">http://base.onk.lu.se/demo/</ulink>
    5050          and enter <userinput>base2</userinput> for the login and <userinput>base2</userinput>
    51           for the password.
     51          for the password. NOTE! The demo server is currently down!
    5252        </para>
    5353       
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/WebClientRegisterExtensionsProcessor.java

    r6417 r6576  
    2323
    2424import net.sf.basedb.clients.web.servlet.ContentSecurityPolicyFilter;
     25import net.sf.basedb.clients.web.taglib.Head;
    2526import net.sf.basedb.core.plugin.About;
    2627import net.sf.basedb.util.Values;
     
    9899      ContentSecurityPolicyFilter.setSafeResources(xtFile.getName(), safeResources);
    99100    }
     101    // Register the version of this extension so
     102    // we can append ?version to script and css URLs
     103    if (about != null && about.getVersion() != null)
     104    {
     105      Head.setExtensionVersion(xtFile.getName(), about.getVersion());
     106    }
    100107
    101108    super.processFile(manager, wFile);
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/menu/FixedMenuItemFactory.java

    r6401 r6576  
    2323
    2424import net.sf.basedb.clients.web.extensions.AbstractJspActionFactory;
     25import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2526import net.sf.basedb.util.Values;
    2627import net.sf.basedb.util.extensions.InvokationContext;
     
    5556  private String submenuId;
    5657  private String icon;
     58  @Deprecated
    5759  private String onClick;
    5860  private String style;
     
    190192 
    191193  @VariableSetter
     194  @Deprecated
    192195  public void setOnClick(String onClick)
    193196  {
    194197    this.onClick = onClick;
     198    DeprecationLogger.warn("MenuItemAction", "onclick", "3.5");
    195199  }
    196200
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/menu/MenuItemBean.java

    r6401 r6576  
    2323
    2424import net.sf.basedb.clients.web.extensions.DynamicActionAttributeSupport;
     25import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2526
    2627/**
     
    4243  private String submenuId;
    4344  private String icon;
     45  @Deprecated
    4446  private String onClick;
    4547  private String clazz;
     
    183185  {
    184186    this.onClick = onClick;
     187    DeprecationLogger.warn("MenuItemAction", "onclick", "3.5");
    185188  }
    186189
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/menu/PermissionMenuItemFactory.java

    r6401 r6576  
    2424import net.sf.basedb.clients.web.extensions.AbstractJspActionFactory;
    2525import net.sf.basedb.clients.web.extensions.menu.MenuItemAction.MenuType;
     26import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2627import net.sf.basedb.core.Item;
    2728import net.sf.basedb.core.Permission;
     
    6970  private String disabledClazz;
    7071 
     72  @Deprecated
    7173  private String onClick;
    7274  private MenuType type;
     
    230232  {
    231233    this.onClick = onClick;
     234    DeprecationLogger.warn("MenuItemAction", "onclick", "3.5");
    232235  }
    233236
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/tabcontrol/FixedTabFactory.java

    r6164 r6576  
    2323
    2424import net.sf.basedb.clients.web.extensions.AbstractJspActionFactory;
     25import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2526import net.sf.basedb.util.Values;
    2627import net.sf.basedb.util.extensions.InvokationContext;
     
    202203  {
    203204    this.onValidate = onValidate;
     205    DeprecationLogger.warn("TabAction", "onvalidate", "3.5");
    204206  }
    205207
     
    209211  {
    210212    this.onActivate = onActivate;
     213    DeprecationLogger.warn("TabAction", "onactivate", "3.5");
    211214  }
    212215
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/tabcontrol/IncludeContentTabFactory.java

    r6402 r6576  
    2828import net.sf.basedb.clients.web.extensions.AbstractJspActionFactory;
    2929import net.sf.basedb.clients.web.extensions.JspContext;
     30import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    3031import net.sf.basedb.clients.web.util.HTML;
    3132import net.sf.basedb.util.Values;
     
    143144  {
    144145    this.onValidate = onValidate;
     146    DeprecationLogger.warn("TabAction", "onvalidate", "3.5");
    145147  }
    146148
     
    150152  {
    151153    this.onActivate = onActivate;
     154    DeprecationLogger.warn("TabAction", "onactivate", "3.5");
    152155  }
    153156
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/tabcontrol/TabBean.java

    r6305 r6576  
    2323
    2424import net.sf.basedb.clients.web.extensions.DynamicActionAttributeSupport;
     25import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2526
    2627/**
     
    165166  {
    166167    this.onValidate = onValidate;
     168    DeprecationLogger.warn("TabAction", "onvalidate", "3.5");
    167169  }
    168170 
     
    171173  {
    172174    this.onActivate = onActivate;
     175    DeprecationLogger.warn("TabAction", "onactivate", "3.5");
    173176  }
    174177
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ButtonBean.java

    r6219 r6576  
    2323
    2424import net.sf.basedb.clients.web.extensions.DynamicActionAttributeSupport;
     25import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2526
    2627/**
     
    4041  private String icon;
    4142  private String id;
     43  @Deprecated
    4244  private String onClick;
    4345  private String style;
     
    137139  {
    138140    this.onClick = onClick;
     141    DeprecationLogger.warn("ButtonAction", "onclick", "3.5");
    139142  }
    140143
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/FixedButtonFactory.java

    r6219 r6576  
    2323
    2424import net.sf.basedb.clients.web.extensions.AbstractJspActionFactory;
     25import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    2526import net.sf.basedb.util.Values;
    2627import net.sf.basedb.util.extensions.InvokationContext;
     
    5960  private String clazz;
    6061  private String icon;
     62  @Deprecated
    6163  private String onClick;
    6264  private String style;
     
    176178  {
    177179    this.onClick = onClick;
     180    DeprecationLogger.warn("ButtonAction", "onclick", "3.5");
    178181  }
    179182
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Body.java

    r6520 r6576  
    161161  {
    162162    this.onLoad = onLoad;
     163    DeprecationLogger.warn("base:body", "onload", "3.5");
    163164  }
    164165  @Deprecated
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Button.java

    r6164 r6576  
    259259  {
    260260    this.onClick = onClick;
     261    DeprecationLogger.warn("base:button", "onclick", "3.5");
    261262  }
    262263  @Deprecated
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/CalendarButton.java

    r6216 r6576  
    3737
    3838  public CalendarButton()
     39  {}
     40 
     41 
     42  @Override
     43  protected void initDefaultAttributes()
    3944  {
    4045    super.setTitle("Calendar&hellip;");
     
    4348    setDynamicAttribute(null, "data-auto-init", "calendar");
    4449  }
    45  
     50
    4651  public void setTextarea(String textarea)
    4752  {
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Head.java

    r6540 r6576  
    2323package net.sf.basedb.clients.web.taglib;
    2424
     25import net.sf.basedb.clients.web.extensions.ExtensionsControl;
     26import net.sf.basedb.clients.web.util.HTML;
    2527import net.sf.basedb.core.SessionControl;
     28import net.sf.basedb.core.Version;
    2629import net.sf.basedb.util.Values;
    2730
     31import java.util.HashMap;
    2832import java.util.LinkedHashSet;
    2933import java.util.Arrays;
    30 
     34import java.util.Map;
     35import java.util.regex.Matcher;
     36import java.util.regex.Pattern;
     37
     38import javax.servlet.http.HttpServletRequest;
    3139import javax.servlet.jsp.JspException;
    3240import javax.servlet.jsp.JspTagException;
     41import javax.servlet.jsp.PageContext;
    3342import javax.servlet.jsp.tagext.TagSupport;
    3443
     
    91100  private static final long serialVersionUID = 948719986796860767L;
    92101
     102  // Contain the file name of extension JAR files mapped to versions
     103  private static final Map<String, String> xtVersions = new HashMap<String, String>();
     104
     105  // Match files under /base-root/extensions path. group 1 is the JAR file name
     106  private static final Pattern PATH_MATCH =
     107      Pattern.compile("/?[^/]*" + ExtensionsControl.RESOURCES_URL + "/([^/]+)/(.*)");
     108
     109  /**
     110    Register the version for an exteniosn JAR file.
     111    Used for appending a query parameter to all scripts and style sheets
     112    to prevent that browsers cache the old version.
     113    @see #getVersionParameter(String)
     114    @since 3.3.2
     115  */
     116  public static void setExtensionVersion(String jarName, String version)
     117  {
     118    synchronized (xtVersions)
     119    {
     120      xtVersions.put(jarName, "v="+HTML.urlEncode(version));
     121    }
     122  }
     123
     124  /**
     125    Get query parameter to the given absolute path (including root directory).
     126    If the path points to a file in the /base-root/extensions/ directory the version
     127    of the extension is used, otherwise the BASE version is used. The
     128    returned parameter is of the form v=<version>.
     129    @param absolutePath An absolute path with or without the base-root directory
     130    @since 3.3.2
     131  */
     132  public static final String getVersionParameter(String absolutePath)
     133  {
     134    Matcher m = PATH_MATCH.matcher(absolutePath);
     135    String version = globalVersion;
     136    if (m.matches())
     137    {
     138      String jarFile = m.group(1);
     139      if (xtVersions.containsKey(jarFile))
     140      {
     141        version = xtVersions.get(jarFile);
     142      }
     143    }
     144    return version;
     145  }
     146
     147 
    93148  /**
    94149    The parent &lt;base:page&gt; tag.
     
    105160  */
    106161  private String scripts = null;
     162 
     163  private static final String globalVersion = "v=" + Version.getMajor()+"."+Version.getMinor()+"."+Version.getMaintenance();
     164  private String localVersion;
    107165 
    108166  /*
     
    143201    for (String style : allStyles)
    144202    {
     203      char pp = style.indexOf('?') == -1 ? '?' : '&';
    145204      sb.append("\t<link rel=\"stylesheet\" type=\"text/css\" href=\"");
    146205      if (style.startsWith(appRoot))
    147206      {
    148207        // Full absolute path
    149         sb.append(style);
     208        sb.append(style).append(pp).append(getVersionParameter(style));
    150209      }
    151210      else if (style.startsWith("/"))
    152211      {
    153         // Absolute path is relative the page root (eg. /foo/bar.css --> /base/foo/bar.css)
    154         sb.append(appRoot).append(style.substring(1));
     212        sb.append(appRoot).append(style.substring(1)).append(pp).append(getVersionParameter(style));
    155213      }
    156214      else if (style.startsWith("~"))
    157215      {
    158216        // Relative path is relative the current page (eg. ~bar.css --> bar.css)
    159         sb.append(style.substring(1));
     217        sb.append(style.substring(1)).append(pp).append(localVersion);
    160218      }
    161219      else
    162220      {
    163221        // All other style sheets are in the /include/styles folder
    164         sb.append(appRoot).append("include/styles/").append(style);
     222        sb.append(appRoot).append("include/styles/").append(style).append(pp).append(globalVersion);
    165223      }
    166224      sb.append("\">\n");
     
    192250    for (String script : allScripts)
    193251    {
     252      char pp = script.indexOf('?') == -1 ? '?' : '&';
    194253      sb.append("\t<script type=\"text/javascript\" charset=\"UTF-8\" src=\"");
    195254      if (script.startsWith(appRoot))
    196255      {
    197256        // Full absolute path
    198         sb.append(script);
     257        sb.append(script).append(pp).append(getVersionParameter(script));
    199258      }
    200259      else if (script.startsWith("/"))
    201260      {
    202261        // Absolute path that is relative the BASE root (eg. /foo/bar.js --> /base/foo/bar.js)
    203         sb.append(appRoot).append(script.substring(1));
     262        sb.append(appRoot).append(script.substring(1)).append(pp).append(getVersionParameter(script));
    204263      }
    205264      else if (script.startsWith("~"))
    206265      {
    207266        // Relative path is relative the current page (eg. ~bar.js --> bar.js)
    208         sb.append(script.substring(1));
     267        sb.append(script.substring(1)).append(pp).append(localVersion);
    209268      }
    210269      else
    211270      {
    212271        // All other scripts are in the /include/scripts folder
    213         sb.append(appRoot).append("include/scripts/").append(script);
     272        sb.append(appRoot).append("include/scripts/").append(script).append(pp).append(globalVersion);
    214273      }
    215274      sb.append("\"></script>\n");
     
    217276  }
    218277
     278  @Override
     279  public void setPageContext(PageContext pageContext)
     280  {
     281    super.setPageContext(pageContext);
     282    HttpServletRequest req = (HttpServletRequest)pageContext.getRequest();
     283    // If we are on /extension subpage, the localVersion is the
     284    // version for the extension, otherwise we use the global version
     285    localVersion = getVersionParameter(req.getServletPath());
     286  }
     287 
     288 
    219289  @Override
    220290  public int doStartTag()
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Icon.java

    r6166 r6576  
    235235    this.onClick = onClick;
    236236    if (!setEnabledIsCalled) this.enabled = onClick != null;
     237    DeprecationLogger.warn("base:icon", "onclick", "3.5");
    237238  }
    238239  @Deprecated
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/Select.java

    r6300 r6576  
    495495  {
    496496    this.onChange = onChange;
     497    DeprecationLogger.warn("base:select", "onchange", "3.5");
    497498  }
    498499  @Deprecated
     
    506507  {
    507508    this.onSelect = onSelect;
     509    DeprecationLogger.warn("base:select", "onselect", "3.5");
    508510  }
    509511  @Deprecated
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/StylableTag.java

    r6401 r6576  
    7676    super.setPageContext(pageContext);
    7777    dynamicAttributes = null;
    78   }
    79 
     78    initDefaultAttributes();
     79  }
     80
     81  /**
     82    Initialize default attributes. Can be called multiple times (once before each tag is used/re-used).
     83    This default implementation does nothing.
     84    @since 3.3.2
     85  */
     86  protected void initDefaultAttributes()
     87  {}
     88 
    8089  public void setClazz(String clazz)
    8190  {
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/extensions/Scripts.java

    r6134 r6576  
    3434
    3535import net.sf.basedb.clients.web.extensions.JspContext;
     36import net.sf.basedb.clients.web.taglib.Head;
    3637
    3738/**
     
    9293    for (String script : scripts)
    9394    {
     95      char pp = script.indexOf('?') == -1 ? '?' : '&';
    9496      sb.append("<script type=\"text/javascript\" src=\"");
    95       sb.append(script);
     97      sb.append(script).append(pp).append(Head.getVersionParameter(script));
    9698      sb.append("\" charset=\"UTF-8\"></script>\n");
    9799    }
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/extensions/Stylesheets.java

    r5384 r6576  
    3434
    3535import net.sf.basedb.clients.web.extensions.JspContext;
     36import net.sf.basedb.clients.web.taglib.Head;
    3637
    3738/**
     
    9394    for (String stylesheet : stylesheets)
    9495    {
     96      char pp = stylesheet.indexOf('?') == -1 ? '?' : '&';
    9597      sb.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"");
    96       sb.append(stylesheet);
     98      sb.append(stylesheet).append(pp).append(Head.getVersionParameter(stylesheet));
    9799      sb.append("\">\n");
    98100    }
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/menu/Menuitem.java

    r6401 r6576  
    3030
    3131import net.sf.basedb.clients.web.extensions.DynamicActionAttribute;
     32import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    3233import net.sf.basedb.clients.web.taglib.StylableTag;
    3334
     
    191192    Javascript statment to execute when the user clicks the menu.
    192193  */
     194  @Deprecated
    193195  private String onclick = null;
    194196   
     
    234236  {
    235237    this.onclick = onclick;
     238    DeprecationLogger.warn("base:menu", "onclick", "3.5");
    236239  }
    237240  @Deprecated
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/Tab.java

    r6305 r6576  
    3535import net.sf.basedb.clients.web.extensions.DynamicActionAttributes;
    3636import net.sf.basedb.clients.web.extensions.tabcontrol.TabAction;
     37import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    3738
    3839/**
     
    279280  {
    280281    this.validate = validate;
     282    DeprecationLogger.warn("t:tab", "validate", "3.5");
    281283  }
    282284  @Override
     
    294296  {
    295297    this.activate = activate;
     298    DeprecationLogger.warn("t:tab", "activate", "3.5");
    296299  }
    297300  /**
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/tab/TabControl.java

    r6305 r6576  
    2828import net.sf.basedb.clients.web.extensions.DynamicActionAttributeSupport;
    2929import net.sf.basedb.clients.web.extensions.tabcontrol.TabAction;
     30import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    3031import net.sf.basedb.clients.web.taglib.StylableTag;
    3132import net.sf.basedb.util.extensions.ExtensionsInvoker;
     
    273274  {
    274275    this.switchtab = s;
     276    DeprecationLogger.warn("t:tabcontrol", "switch", "3.5");
    275277  }
    276278  @Deprecated
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Button.java

    r6219 r6576  
    2929import net.sf.basedb.clients.web.extensions.toolbar.ButtonAction;
    3030import net.sf.basedb.clients.web.extensions.toolbar.ToolbarButtonRenderer;
     31import net.sf.basedb.clients.web.taglib.DeprecationLogger;
    3132import net.sf.basedb.clients.web.taglib.StylableTag;
    3233
     
    237238  {
    238239    this.onClick = onClick;
     240    DeprecationLogger.warn("tbl:button", "onclick", "3.5");
    239241  }
    240242  @Deprecated
  • trunk/src/core/net/sf/basedb/core/DbControl.java

    r6468 r6576  
    904904        {
    905905          throw new ItemNotFoundException(HibernateUtil.getShortEntityName(ex.getEntityName())+
    906             "[id="+ex.getIdentifier()+"]");
     906            "[id="+ex.getIdentifier()+"]", ex);
    907907        }
    908908      }
  • trunk/src/core/net/sf/basedb/core/Job.java

    r6497 r6576  
    511511 
    512512  /**
     513    Set the version of the plugin that executes the job.
     514    NOTE! This is automatically called for jobs that are executed by
     515    plug-ins but should be called excplicitely for other types of jobs
     516    @param pluginVersion
     517    @since 3.3.2
     518  */
     519  public void setPluginVersion(String pluginVersion)
     520  {
     521    checkPermission(Permission.WRITE);
     522    getData().setPluginVersion(StringUtil.setNullableString(pluginVersion, "pluginVersion", JobData.MAX_PLUGIN_VERSION_LENGTH));
     523  }
     524 
     525  /**
    513526    Get the version number of the configuration parameters used for this job.
    514527  */
     
    10491062      data.setJobAgentId(agent == null ? null : agent.getId());
    10501063      PluginDefinitionData plugin = data.getPluginDefinition();
    1051       data.setPluginVersion(plugin == null ? null : plugin.getVersionString());
     1064      if (plugin != null) data.setPluginVersion(plugin.getVersionString());
    10521065    }
    10531066
  • trunk/src/core/net/sf/basedb/core/Project.java

    r6465 r6576  
    4747import java.util.Set;
    4848import java.util.Collections;
     49
     50import org.hibernate.Hibernate;
    4951
    5052/**
     
    933935
    934936    Class dataClass = itemType.getDataClass();
    935     for (BasicData data : defaultItems.getValues())
    936     {
     937    Iterator<BasicData> it = defaultItems.getValues().iterator();
     938    while (it.hasNext())
     939    {
     940      BasicData data = it.next();
    937941      if (dataClass.isInstance(data))
    938942      {
     943        // Check if item has been removed
     944        try
     945        {
     946          Hibernate.initialize(data);
     947        }
     948        catch (org.hibernate.ObjectNotFoundException ex)
     949        {
     950          it.remove();
     951          continue;
     952        }
     953       
    939954        // Found an item of the correct item type... get it's subtype
    940955        ItemSubtypeData otherSubtype = null;
     
    9851000   
    9861001    Class dataClass = itemType.getDataClass();
    987     for (BasicData data : defaultItems.getValues())
    988     {
     1002    Iterator<BasicData> it = defaultItems.getValues().iterator();
     1003    while (it.hasNext())
     1004    {
     1005      BasicData data = it.next();
    9891006      if (dataClass.isInstance(data))
    9901007      {
     1008        // Check if item has been removed
     1009        try
     1010        {
     1011          Hibernate.initialize(data);
     1012        }
     1013        catch (org.hibernate.ObjectNotFoundException ex)
     1014        {
     1015          it.remove();
     1016          continue;
     1017        }
     1018
    9911019        // Found an item of the correct item type... get it's subtype
    9921020        ItemSubtypeData otherSubtype = null;
  • trunk/src/core/net/sf/basedb/core/query/CaseExpression.java

    r6127 r6576  
    7474    {
    7575      sb.append("WHEN ").append(when.getCondition().toQl(query, dc));
    76       sb.append(" THEN ").append(when.getValue().toQl(query, dc));
     76      sb.append(" THEN ").append(when.getValue() == null ? "null" : when.getValue().toQl(query, dc));
    7777      sb.append("\n");
    7878    }
     
    9595    {
    9696      all.add(when.getCondition());
    97       all.add(when.getValue());
     97      if (when.getValue() != null) all.add(when.getValue());
    9898    }
    9999    if (elseExpression != null) all.add(elseExpression);
  • trunk/src/core/net/sf/basedb/core/query/Hql.java

    r6444 r6576  
    5656 
    5757  /**
    58     A property can only contain the characters a-zA-Z0-9, period(.) or hash (#)
     58    A property can only contain the characters a-zA-Z0-9, period(.), underscore(_) or hash (#)
    5959    It cannot begin or end with a period/hash and cannot have two periods/hashes in a sequence.
    6060    A hash indicates a path to a component while a period indicates a path to another
    6161    entity.
    6262  */
    63   public static final Pattern PROPERTY_REGEXP = Pattern.compile("[a-zA-Z0-9]+((\\.|\\#)[a-zA-Z0-9]+)*");
     63  public static final Pattern PROPERTY_REGEXP = Pattern.compile("[a-zA-Z0-9_]+((\\.|\\#)[a-zA-Z0-9_]+)*");
    6464
    6565  /**
     
    199199      if (!PROPERTY_REGEXP.matcher(property).matches())
    200200      {
    201         throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     201        throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    202202      }
    203203      if (property.endsWith("affyChip"))
     
    234234    if (property != null && !PROPERTY_REGEXP.matcher(property).matches())
    235235    {
    236       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     236      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    237237    }
    238238    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    260260    if (!PROPERTY_REGEXP.matcher(property).matches())
    261261    {
    262       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     262      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    263263    }
    264264    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    287287    if (!PROPERTY_REGEXP.matcher(property).matches())
    288288    {
    289       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     289      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    290290    }
    291291    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    365365    if (!PROPERTY_REGEXP.matcher(property).matches())
    366366    {
    367       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     367      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    368368    }
    369369    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    438438    if (!PROPERTY_REGEXP.matcher(property).matches())
    439439    {
    440       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     440      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    441441    }
    442442    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    484484    if (!PROPERTY_REGEXP.matcher(property).matches())
    485485    {
    486       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     486      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    487487    }
    488488    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    535535    if (!PROPERTY_REGEXP.matcher(property).matches())
    536536    {
    537       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     537      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    538538    }
    539539    if (alias != null && !ALIAS_REGEXP.matcher(alias).matches())
     
    557557    if (!PROPERTY_REGEXP.matcher(property).matches())
    558558    {
    559       throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9 and . is allowed.");
     559      throw new InvalidDataException("Property '"+property+"' has one or more invalid characters. Only a-z, A-Z, 0-9, _ and . is allowed.");
    560560    }
    561561    return Restrictions.eq(
  • trunk/src/core/net/sf/basedb/core/query/WhenStatement.java

    r5320 r6576  
    2323
    2424import net.sf.basedb.core.InvalidUseOfNullException;
     25import net.sf.basedb.util.EqualsHelper;
    2526
    2627/**
     
    4546      value is returned or not, null is not allowed
    4647    @param value The value to return if the condition is TRUE,
    47       null is not allowed
     48      null is allowed
    4849  */
    4950  public WhenStatement(Restriction condition, Expression value)
    5051  {
    5152    if (condition == null) throw new InvalidUseOfNullException("condition");
    52     if (value == null) throw new InvalidUseOfNullException("value");
    5353    this.condition = condition;
    5454    this.value = value;
     
    8282    StringBuilder sb = new StringBuilder();
    8383    sb.append("WHEN ").append(getCondition().toString());
    84     sb.append(" THEN ").append(getValue().toString());
     84    sb.append(" THEN ").append(getValue() == null ? "null" : getValue().toString());
    8585    return sb.toString();
    8686  }
     
    9696    if (other == null || this.getClass() != other.getClass()) return false;
    9797    WhenStatement o = (WhenStatement)other;
    98     return condition.equals(o.condition) && value.equals(o.value);
     98    return condition.equals(o.condition) && EqualsHelper.equals(value, o.value);
    9999  }
    100100
     
    102102  public int hashCode()
    103103  {
    104     return condition.hashCode() + value.hashCode();
     104    return condition.hashCode() + (value == null ? 0 : value.hashCode());
    105105  }
    106106  // -------------------------------------------
  • trunk/src/core/net/sf/basedb/util/extensions/manager/processor/PluginInstallationProcessor.java

    r6473 r6576  
    3030
    3131import net.sf.basedb.core.DbControl;
     32import net.sf.basedb.core.Include;
    3233import net.sf.basedb.core.ItemKey;
    3334import net.sf.basedb.core.ItemQuery;
     
    174175           
    175176            PluginDefinition plugin = allPlugins.get(pluginClassName);
     177            if (plugin == null)
     178            {
     179              try
     180              {
     181                plugin = PluginDefinition.getByClassName(dc, pluginClassName);
     182              }
     183              catch (RuntimeException ex)
     184              {}
     185            }
    176186            if (plugin != null)
    177187            {
     
    180190              {
    181191                ItemQuery<PluginConfiguration> query = plugin.getPluginConfigurations();
     192                query.setIncludes(Include.ALL);
    182193                query.restrict(Restrictions.eq(Hql.property("name"), Expressions.parameter("name", name, Type.STRING)));
    183194                List<PluginConfiguration> existing = query.list(dc);
     
    202213              }
    203214            }
    204  
     215            else
     216            {
     217              numError++;
     218              wFile.setError(true);
     219              String msg = "Failed to install plug-in configuration '" + name + "', no plug-in: " + pluginClassName;
     220              if (results != null) results.addErrorMessage(xtFile, msg);
     221              log.error(msg);
     222            }
    205223          }
    206224        }
     
    213231        if (numInstalled > 0) results.addMessage(xtFile, numInstalled + " plug-in(s) installed.");
    214232        if (numUpdated > 0) results.addMessage(xtFile, numUpdated + " plug-in(s) updated.");
    215         if (numConfigurations > 0) results.addMessage(xtFile, numConfigurations + " plug-in configuration(s) created");
     233        if (numConfigurations > 0) results.addMessage(xtFile, numConfigurations + " plug-in configuration(s) created.");
    216234        if (numInstalled == 0 && numUpdated == 0 && numProcessed > 0)
    217235        {
    218           results.addMessage(xtFile, numProcessed + " plug-in(s) loaded");
     236          results.addMessage(xtFile, numProcessed + " plug-in(s) loaded.");
    219237        }
    220238      }
  • trunk/src/plugins/core/net/sf/basedb/plugins/RawDataFlatFileImporter.java

    r6127 r6576  
    892892      msg.append(" spot(s) skipped due to missing features");
    893893    }
    894     if (skippedLines > 0)
    895     {
    896       msg.append("; ").append(skippedLines).append(" spot(s) skipped due to errors");
     894    if (skippedLines > numSkippedMissingFeature)
     895    {
     896      msg.append("; ").append(skippedLines-numSkippedMissingFeature).append(" spot(s) skipped due to errors");
    897897    }
    898898    return msg.toString();
  • trunk/src/test/TestFile.java

    r6520 r6576  
    7979    int baseTracServer = TestFileServer.test_create("base.thep.lu.se", "BASE trac site",
    8080        "base", "base", null, null, null);
    81     int base2DemoServer = TestFileServer.test_create("base2.thep.lu.se", "BASE demo site", null, null,
    82         "data/base2.thep.lu.se.crt", null, null);
     81    int base2DemoServer = TestFileServer.test_create("base.onk.lu.se", "BASE demo site", null, null,
     82        "data/base.onk.lu.se.crt", null, null);
    8383    int extId1 = test_create("http://base.thep.lu.se/robots.txt", false, false);
    84     int extId2 = test_create("https://base2.thep.lu.se/base/base-2.17.2.tar.gz.MD5", false, false);
     84    int extId2 = test_create("https://base.onk.lu.se/onk/images/baselogo.png", false, false);
    8585    int extId3 = test_create("http://base.thep.lu.se/login", false, false);
    8686    test_load(id1);
     
    9696    test_download(id1, "data/test.upload.txt");
    9797    test_download(extId1, "data/test.download.robots.txt");
    98     test_download(extId2, "data/test.download.base-2.17.2.md5");
     98    test_download(extId2, "data/test.download.baselogo.png");
    9999    test_download(extId3, null);
    100100   
  • trunk/src/test/TestFileServer.java

    r5362 r6576  
    4747    // Standard tests: create, load, list
    4848    int id = test_create("base.thep.lu.se", "BASE trac site", "base", "base", null, null, null);
    49     int id2 = test_create("base2.thep.lu.se", "BASE demo site", null, null, "data/base2.thep.lu.se.crt", null, null);
     49    int id2 = test_create("base.onk.lu.se", "BASE demo site", null, null, "data/base.onk.lu.se.crt", null, null);
    5050    test_load(id);
    5151    test_list(-1);
  • trunk/src/test/TestItemImporter.java

    r6520 r6576  
    8787    int childScanId = TestItemSubtype.test_create(Item.DERIVEDBIOASSAY, "ChildScan", SystemItems.getId(DerivedBioAssay.SCAN));
    8888    int allSamplesSubtypeId = TestItemSubtype.test_create(Item.SAMPLE, "All samples");
    89     int base2DemoServer = TestFileServer.test_create("base2.thep.lu.se", "BASE demo site", null, null,
    90         "data/base2.thep.lu.se.crt", null, null);
     89    int base2DemoServer = TestFileServer.test_create("base.onk.lu.se", "BASE demo site", null, null,
     90        "data/base.onk.lu.se.crt", null, null);
    9191
    9292    TestProject.test_defaultItem(projectId, Item.PROTOCOL, defaultSamplingProtocolId);
     
    103103    ok = ok & TestFile.test_list("/file-import", 1);  // 'reporters.txt'
    104104    ok = ok & TestFile.test_list("/file-import/raw", 2);  // 'file1.txt' and 'file2.txt'
    105     ok = ok & TestFile.test_list("/file-import/ext", 2);  // 'robots.txt' and '2.17.md5'
     105    ok = ok & TestFile.test_list("/file-import/ext", 2);  // 'robots.txt' and 'baselogo.png'
    106106   
    107107    // Import bioplates
  • trunk/src/test/data/test.batchimport.files.txt

    r6520 r6576  
    44raw/file2.txt     Raw data    Raw data #2
    55/file-import/ext/robots.txt http://base.thep.lu.se/robots.txt     text/plain  Robots file for BASE
    6 /file-import/ext/2.17.md5 https://base2.thep.lu.se/base/base-2.17.2.tar.gz.MD5  base2.thep.lu.se   
     6/file-import/ext/baselogo.png https://base.onk.lu.se/onk/images/baselogo.png  base.onk.lu.se   
  • trunk/www/biomaterials/extracts/extracts.js

    r6497 r6576  
    481481    event.detail.name += ' [-]';
    482482    Link.addItem('extracts', 'EXTRACT', event.detail);
    483     frm.parentType[0].checked = false;
    484     frm.parentType[1].checked = true;
    485     extracts.parentTypeOnClick();
     483    if (event.detail.remaining == 0)
     484    {
     485      frm.parentType[0].checked = false;
     486      frm.parentType[1].checked = true;
     487      extracts.parentTypeOnClick();
     488    }
    486489  }
    487490
  • trunk/www/biomaterials/samples/samples.js

    r6497 r6576  
    411411    event.detail.name += ' [-]';
    412412    Link.addItem('samples', 'SAMPLE', event.detail);
    413     frm.parentType[0].checked = false;
    414     frm.parentType[1].checked = true;
    415     samples.parentTypeOnClick();
     413    if (event.detail.remaining == 0)
     414    {
     415      frm.parentType[0].checked = false;
     416      frm.parentType[1].checked = true;
     417      samples.parentTypeOnClick();
     418    }
    416419  }
    417420
  • trunk/www/common/import/select_file.jsp

    r6305 r6576  
    158158          <th>Character set</th>
    159159          <td>
    160             <select name="charset">
     160            <select name="charset" style="max-width: 98%;">
    161161            <%
    162162            String defaultCharset = Config.getCharset();
     
    183183            <th>Data files</th>
    184184            <td>
    185               <select name="dataFile" id="dataFile">
     185              <select name="dataFile" id="dataFile" style="width: 98%;">
    186186              <option value="">
    187187              <%
     
    225225            <th>Recently used</th>
    226226            <td>
    227               <select name="recentFile" id="recentFile">
     227              <select name="recentFile" id="recentFile" style="width: 98%;">
    228228              <option value="">
    229229              <%
  • trunk/www/common/plugin/configure.jsp

    r6393 r6576  
    231231  if (helpText == null) helpText = plugin.getDescription();
    232232  List<File> recentFiles = currentContext == null ? null : (List<File>)currentContext.getRecent(dc, Item.FILE);
    233  
    234   recentFiles = File.getQuery().list(dc);
    235233 
    236234  JSONArray jsonParameters = JsonUtil.toArray(parameters, new JsonConverter<PluginParameter>()
     
    747745                        id="<%=fieldName%>:recent"
    748746                        name="<%=fieldName%>:recent"
    749                         data-field="<%=fieldName %>">
     747                        data-field="<%=fieldName %>"
     748                        style="width: 98%;">
    750749                      <option value="">
    751750                      <%
  • trunk/www/common/share/share.js

    r6412 r6576  
    144144   
    145145    Link.addItem('members', 'USER', event.detail);
    146     share.membersOnChange();
     146    if (event.detail.remaining == 0)
     147    {
     148      share.membersOnChange();
     149    }
    147150  }
    148151
     
    174177   
    175178    Link.addItem('members', 'GROUP', event.detail);
    176     share.membersOnChange();
     179    if (event.detail.remaining == 0)
     180    {
     181      share.membersOnChange();
     182    }
    177183  }
    178184
     
    199205   
    200206    Link.addItem('members', 'PROJECT', event.detail);
    201     share.membersOnChange();
     207    if (event.detail.remaining == 0)
     208    {
     209      share.membersOnChange();
     210    }
    202211  }
    203212 
     
    218227  {
    219228    Link.addItem('members', 'PERMISSIONTEMPLATE', event.detail);
    220     share.membersOnChange();
     229    if (event.detail.remaining == 0)
     230    {
     231      share.membersOnChange();
     232    }
    221233  }
    222234
  • trunk/www/filemanager/files/files.js

    r6400 r6576  
    148148    else if (autoInit == 'file-check')
    149149    {
    150       Events.addEventHandler(element, 'click', fileManager.onFileChecked);
     150      Events.addEventHandler(element, 'change', fileManager.onFileChecked);
    151151    }
    152152    else if (autoInit == 'directory-item')
     
    172172      url += '&directory_id='+directoryId;
    173173    }
    174     Dialogs.openPopup(url, 'UploadFile', 600, 400);
     174    var controller = Items.getController('FILE');
     175    Dialogs.openPopup(url, 'UploadFile', controller.width, controller.height);
    175176  }
    176177 
  • trunk/www/filemanager/select_file.js

    r6400 r6576  
    3535  selectFile.setSelectedFile = function(fileId, path)
    3636  {
    37     selected[0] = {'id': fileId, 'path': path};
     37    selected[0] = {'id': fileId, 'name': path};
    3838    selectFile.updatePath();
    3939  }
     
    4646    if (selectFile.getSelectedFileIndex(fileId) == -1)
    4747    {
    48       selected[selected.length] = {'id': fileId, 'path': path};
     48      selected[selected.length] = {'id': fileId, 'name': path};
    4949    }
    5050    selectFile.updatePath();
     
    7373    {
    7474      if (path != '') path += ', ';
    75       path += selected[i].path;
     75      path += selected[i].name;
    7676    }
    7777    Doc.element('files').innerHTML = path;
     
    8484    var callbackMethod = window.opener[callback];
    8585   
     86    var remaining = selected.length-1;
    8687    for (var i = 0; i < selected.length; i++)
    8788    {
     89      var s = selected[i];
     90      s.remaining = remaining--;
    8891      if (notifyTarget)
    8992      {
    9093        // Send event to the target in the opener window
    91         Events.sendCustomEvent(notifyTarget, 'base-selected', {'id': selected[i].id, 'name': selected[i].path});
     94        Events.sendCustomEvent(notifyTarget, 'base-selected', s);
    9295      }
    9396      else if (callbackMethod)
    9497      {
    9598        // Call the callback method in the opener window
    96         callbackMethod.call(null, selected[i].id, selected[i].path);
     99        callbackMethod.call(null, s.id, s.path);
    97100      }
    98101    }
  • trunk/www/footnote.js

    r6540 r6576  
    3838    Buttons.addClickHandler('multiMessages', footnote.showAllMessages);
    3939   
    40     // Reload the footnote in 60 seconds
    41     Footnote.startReloadTimer();
    42   }
    43  
    44   /**
    45     Start the reload timer. Timeout parameter (in seconds) is optional.
    46     If not given, the default timout is used (60 seconds).
    47   */
    48   footnote.startReloadTimer = function(timeout)
    49   {
    50     setTimeout(Footnote.reload, (timeout || pAutoReload) * 1000);
     40    Footnote.loadMessages();
    5141  }
    5242 
     
    5444    Reload the footnote page.
    5545  */
    56   footnote.reload = function()
     46  footnote.loadMessages = function()
    5747  {
    58     location.reload(false);
     48    var url = 'ajax.jsp?ID='+App.getSessionId();
     49    url += '&cmd=GetFootnoteMessages';
     50    var request = Ajax.getXmlHttpRequest();
     51    request.open("GET", url, true);
     52    Ajax.setReadyStateHandler(request, footnote.messagesLoaded, footnote.messagesNotLoaded);
     53    request.send(null);
     54  }
     55 
     56  footnote.messagesLoaded = function(request)
     57  {
     58    var messages = JSON.parse(request.responseText);
     59   
     60    Doc.hide('broadcast');
     61    Doc.hide('credit');
     62    Doc.hide('singleMessage');
     63    Doc.hide('multiMessages');
     64    if (messages.broadcast)
     65    {
     66      Doc.show('broadcast');
     67      Doc.element('broadcast-title').innerHTML = Strings.encodeTags(messages.broadcast);
     68    }
     69    else if (messages.newMessages > 1)
     70    {
     71      Doc.show('multiMessages');
     72      Doc.element('num-messages').innerHTML = messages.newMessages;
     73    }
     74    else if (messages.newMessages == 1)
     75    {
     76      var msg = messages.message;
     77      Doc.show('singleMessage');
     78      Data.set('singleMessage', 'message-id', msg.id);
     79      Doc.element('message-name').innerHTML = Strings.encodeTags(msg.name);
     80      Doc.element('message-from').innerHTML = Strings.encodeTags(msg.from);
     81    }
     82    else
     83    {
     84      Doc.show('credit');
     85    }
     86    setTimeout(footnote.loadMessages, pAutoReload * 1000);
     87  }
     88
     89  footnote.messagesNotLoaded = function(request)
     90  {
     91    App.debug('Footnote not updated: ' + request.responseText);
     92    setTimeout(footnote.loadMessages, pAutoReload * 1000);
    5993  }
    6094 
  • trunk/www/footnote.jsp

    r6167 r6576  
    4545<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
    4646<%
    47 String broadcastTitle = (String)application.getAttribute("broadcast.title");
    4847SessionControl sc = Base.getSessionControl(pageContext, false);
    4948String ID = "";
     
    5655  serverAdminName = Values.getStringOrNull(sc.getClientDefaultSetting("server.admin.name"));
    5756  serverAdminEmail = Values.getStringOrNull(sc.getClientDefaultSetting("server.admin.email"));
    58   dc = sc.newDbControl();
    5957}
    60 long numNewMessages = 0;
    6158try
    6259{
    63   if (sc != null && sc.isLoggedIn()) numNewMessages = Message.countUnreadMessages(dc, null, false);
    6460  %>
    6561  <base:page type="iframe" title="">
     
    6864  <div class="footer">
    6965  <table style="width: 100%; height: 100%;"><tr><td>
    70   <%
    71   if (broadcastTitle != null)
    72   {
    73     String broadcastMessage = (String)application.getAttribute("broadcast.message");
    74     %>
    75     <div class="message">
     66
     67    <div class="message" id="broadcast" style="display: none;">
    7668    <base:icon id="broadcast" image="warning.png" tooltip="Read more&hellip;"
    77       style="font-weight: bold;">&nbsp;<%=HTML.encodeTags(broadcastTitle) %></base:icon>
     69      style="font-weight: bold;">
     70      <span id="broadcast-title"></span>
     71    </base:icon>
    7872    </div>
    79     <%
    80   }
    81   else if (numNewMessages == 0)
    82   {
    83     %>
    84     <div class="credit">
     73   
     74    <div class="credit" id="credit">
    8575      The development of BASE is currently supported by Lund
    8676      University through SCIBLU. Previous patrons of the BASE project
     
    10898      %>
    10999    </div>
    110     <%
    111   }
    112   else if (numNewMessages == 1)
    113   {
    114     User user = User.getById(dc, sc.getLoggedInUserId());
    115     ItemQuery<Message> query = Message.getQuery(user);
    116     query.restrict(
    117       Restrictions.eq(
    118         Hql.property("read"),
    119         Expressions.parameter("read")
    120       )
    121     );
    122     query.setParameter("read", false, Type.BOOLEAN);
    123     ItemResultList<Message> messages = query.list(dc);
    124     Message message = messages.get(0);
    125     %>
    126     <base:icon id="singleMessage" image="message.png" tooltip="Read the message"
    127       data-message-id="<%=message.getId()%>"
    128       >&nbsp;<%=HTML.encodeTags(message.getName())%> (From: <%=HTML.encodeTags(message.getFrom())%>)
     100
     101    <base:icon id="singleMessage" style="display: none;" image="message.png" tooltip="Read the message">
     102      <span id="message-name"></span> (From: <span id="message-from"></span>)
    129103    </base:icon>
    130     <%
    131   }
    132   else
    133   {
    134     %>
    135     <base:icon id="multiMessages" image="message.png" tooltip="Read the messages"
    136       >&nbsp;<b>You have <%=numNewMessages%> new messages</b></base:icon>
    137     <%
    138   }
    139   %>
     104    <base:icon id="multiMessages" style="display: none;" image="message.png" tooltip="Read the messages">
     105      <b>You have <span id="num-messages"></span> new messages</b>
     106    </base:icon>
    140107  </td></tr></table>
    141108  </div>
  • trunk/www/include/menu.jsp

    r6426 r6576  
    12241224        else if (action.getType() == MenuItemAction.MenuType.MENUITEM)
    12251225        {
    1226           %>
    1227           <m:menuitem
    1228             id="<%=action.getId() %>"
    1229             subclass="<%=action.getClazz() %>"
    1230             style="<%=action.getStyle()%>"
    1231             title="<%=action.getTitle()%>"
    1232             icon="<%=action.getIcon()%>"
    1233             tooltip="<%=action.getTooltip()%>"
    1234             enabled="<%=action.isEnabled()%>"
    1235             visible="<%=action.isVisible()%>"
    1236             onclick="<%=action.getOnClick()%>"
    1237             dynamic="<%=dynamicAttributes%>"
    1238           />
    1239           <%
     1226          if (action.getOnClick() != null)
     1227          {
     1228            %>
     1229            <m:menuitem
     1230              id="<%=action.getId() %>"
     1231              subclass="<%=action.getClazz() %>"
     1232              style="<%=action.getStyle()%>"
     1233              title="<%=action.getTitle()%>"
     1234              icon="<%=action.getIcon()%>"
     1235              tooltip="<%=action.getTooltip()%>"
     1236              enabled="<%=action.isEnabled()%>"
     1237              visible="<%=action.isVisible()%>"
     1238              onclick="<%=action.getOnClick()%>"
     1239              dynamic="<%=dynamicAttributes%>"
     1240            />
     1241            <%
     1242          }
     1243          else
     1244          {
     1245            %>
     1246            <m:menuitem
     1247              id="<%=action.getId() %>"
     1248              subclass="<%=action.getClazz() %>"
     1249              style="<%=action.getStyle()%>"
     1250              title="<%=action.getTitle()%>"
     1251              icon="<%=action.getIcon()%>"
     1252              tooltip="<%=action.getTooltip()%>"
     1253              enabled="<%=action.isEnabled()%>"
     1254              visible="<%=action.isVisible()%>"
     1255              dynamic="<%=dynamicAttributes%>"
     1256            />
     1257            <%
     1258          }
    12401259        }
    12411260        else if (action.getType() == MenuItemAction.MenuType.SUBMENU)
  • trunk/www/include/scripts/main-2.js

    r6540 r6576  
    7575  app.getScale = function()
    7676  {
    77     return Data.int(document.body, 'gui-scale');
     77    return Data.float(document.body, 'gui-scale');
    7878  }
    7979 
     
    226226  {
    227227    console.log(message);
     228  }
     229 
     230  /**
     231    Log usage of a deprecated method. A call to this method
     232    should be included as the first line in a deprecated method.
     233    @param method The name of the method (eg. Main.openPopup())
     234    @param voidVersion The version number of BASE in which the method will be removed
     235   */
     236  app.deprecatedMethod = function(method, voidVersion)
     237  {
     238    var msg = 'Deprecated method "' + method + '" will be removed in BASE ' + voidVersion;
     239    console.error(msg);
    228240  }
    229241 
     
    755767  events.integerOnly = function(event)
    756768  {
    757     var charCode = event.charCode || event.keyCode;
     769    var charCode = event.charCode;
    758770    // <31 for tab, delete, etc. 48-57=key 0-9, 45= '-'
    759771    var allow = charCode <= 31 || (charCode >= 48 && charCode <= 57) || charCode == 45;
     
    767779  events.numberOnly = function(event)
    768780  {
    769     var charCode = event.charCode || event.keyCode;
     781    var charCode = event.charCode;
    770782    // <31 for tab, delete, etc. 48-57=key 0-9, 45= '-', 46='.', 69/101=E/e
    771783    var allow = charCode <= 31 || (charCode >= 48 && charCode <= 57) || charCode == 45 || charCode == 46 || charCode == 69 || charCode == 101;
     
    12611273      // If no last position is know, use the specified settings
    12621274      position = {};
    1263       // Rescale according to user settings
     1275      // Rescale according to user settings -- but not larger than current screen
    12641276      var scale = App.getScale();
    1265       position.width = width * scale;
    1266       position.height = height * scale;
     1277      position.width = Math.ceil(Math.min(width * scale, screen.availWidth));
     1278      position.height = Math.ceil(Math.min(height * scale, screen.availHeight));
    12671279     
    12681280      //  Try to position the popup window in the center of the parent window.
    12691281      var pos = App.getWindowPosition(window.top);
    1270       var top = Math.ceil(pos.top+(pos.height-height) / 2);
    1271       var left = Math.ceil(pos.left+(pos.width-width) / 2);
     1282      var top = Math.ceil(pos.top+(pos.height-position.height) / 2);
     1283      var left = Math.ceil(pos.left+(pos.width-position.width) / 2);
    12721284      position.top = (top < 0 && pos.top >= 0) ? 0 : top;
    12731285      position.left = (left < 0 && pos.left >= 0) ? 0 : left;
     
    19381950    controllers['EXTRAVALUETYPE'] = { url:'admin/extravaluetypes/index.jsp', width:600, height:400 };
    19391951    controllers['FEATURE'] = { url:'lims/arraydesigns/features/index.jsp', width:750, height:500, popup:true, edit:false, noAnyToAny:true };
    1940     controllers['FILE'] = { url:'filemanager/index.jsp', iframe:true, width:600, height:400 };
     1952    controllers['FILE'] = { url:'filemanager/index.jsp', iframe:true, width:750, height:500 };
    19411953    controllers['FILESERVER'] = { url:'filemanager/fileservers/index.jsp', width:750, height:500 };
    1942     controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:750, height:500 };
     1954    controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:900, height:600 };
    19431955    controllers['GROUP'] = { url:'admin/groups/index.jsp', width:600, height:400 };
    19441956    controllers['HARDWARE'] = { url:'admin/hardware/index.jsp', width:800, height:500 };
     
    22162228 
    22172229  // Kept for backwards compatibility
     2230  // @Deprecated
    22182231  forms.createHidden = function(frm, name, value, doc)
    22192232  {
     2233    App.deprecatedMethod('Forms.createHidden()', '3.5');
    22202234    Forms.addHidden(frm, name, value);
    22212235  }
     
    23022316      if (element.type == 'checkbox' && !element.disabled && element.name.match(nameRegexp))
    23032317      {
     2318        var was = element.checked;
    23042319        if (first == null)
    23052320        {
     
    23112326          element.checked = first.checked;
    23122327        }
     2328        if (was != element.checked) Events.sendChangeEvent(element);
    23132329      }
    23142330    }
     
    28832899
    28842900  // Kept for backwards compatibility
     2901  // @Deprecated
    28852902  numbers.numberOnly = function(event)
    28862903  {
     2904    App.deprecatedMethod('Numbers.numberOnly()', '3.5');
    28872905    Events.numberOnly(event);
    28882906  }
    28892907 
    28902908  // Kept for backwards compatibility
     2909  // @Deprecated
    28912910  numbers.integerOnly = function(event)
    28922911  {
     2912    App.deprecatedMethod('Numbers.integerOnly()', '3.5');
    28932913    Events.integerOnly(event);
    28942914  }
     
    33613381    @param callback Deprecated, onchange event is sent instead
    33623382  */
     3383  // @Deprecated
    33633384  dates.selectDate = function(title, form, input, callback, format)
    33643385  {
     3386    App.deprecatedMethod('Dates.selectDate()', '3.5');
    33653387    var textarea = document.forms[form][input];
    33663388    if (!textarea.id) textarea.id = 't'+(new Date()).getTime();
     
    33783400    @param callback Deprecated, onchange event is sent instead
    33793401  */
     3402  // @Deprecated
    33803403  dates.selectDateTime = function(title, form, input, callback, format)
    33813404  {
     3405    App.deprecatedMethod('Dates.selectDateTime()', '3.5');
    33823406    var textarea = document.forms[form][input];
    33833407    if (!textarea.id) textarea.id = 't'+(new Date()).getTime();
  • trunk/www/include/scripts/main.js

    r6419 r6576  
    2929*/
    3030
     31
    3132/**
    3233  Get the root URL path of this BASE installation. Always ends with a '/' (eg. /base/)
    3334*/
     35// @Deprecated
    3436function getRoot()
    3537{
     38  App.deprecatedMethod('getRoot()', '3.5');
    3639  return App.getRoot();
    3740}
     
    4144  (should only happen on the top frameset of the login page)
    4245*/
     46//@Deprecated
    4347function getSessionId()
    4448{
     49  App.deprecatedMethod('getSessionId()', '3.5');
    4550  return App.getSessionId();
    4651}
     
    5055  require scaling to fit).
    5156*/
     57//@Deprecated
    5258function getScale()
    5359{
     60  App.deprecatedMethod('getScale()', '3.5');
    5461  return App.getScale();
    5562}
     
    6067  value of '0' disable the rewriting.
    6168*/
     69//@Deprecated
    6270function getMaxUrlLength()
    6371{
     72  App.deprecatedMethod('getMaxUrlLength()', '3.5');
    6473  return App.getMaxUrlLength();
    6574}
     
    7786    in the reverse order as they were added to this method.
    7887  */
     88  // @Deprecated
    7989  this.onLoad = function(f)
    8090  {
     91    App.deprecatedMethod('Main.onLoad()', '3.5');
    8192    Doc.onLoad(f);
    8293  }
     
    95106    @see http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1202731
    96107  */
     108  // @Deprecated
    97109  this.openPopup = function(url, name, width, height, options, parentWin)
    98110  {
     111    App.deprecatedMethod('Main.openPopup()', '3.5');
    99112    Dialogs.openPopup(url, name, width, height);
    100113  }
     
    103116    Brings a named window to focus.
    104117  */
     118  // @Deprecated
    105119  this.focusWindow = function(windowName)
    106120  {
     121    App.deprecatedMethod('Main.focusWindow()', '3.5');
    107122    var win = this.getWindow(windowName);
    108123    if (win) win.focus();
     
    114129    the current window is returned.
    115130   */
     131  // @Deprecated
    116132  this.getWindow = function(windowName)
    117133  {
     134    App.deprecatedMethod('Main.getWindow()', '3.5');
    118135    var win = Dialogs.getDialog(windowName);
    119136    if (!win || win.closed) win = window;
     
    130147    @param textarea The name of the textarea to zoom
    131148  */
     149  // @Deprecated
    132150  this.zoom = function(title, form, textarea, disabled, callback)
    133151  {
     152    App.deprecatedMethod('Main.zoom()', '3.5');
    134153    var tmp = document.forms[form][textarea];
    135154    if (!tmp.id) tmp.id = 'z'+(new Date()).getTime();
     
    148167      instead of by setting the form field
    149168  */
     169  // @Deprecated
    150170  this.selectColor = function(title, form, input, callback)
    151171  {
     172    App.deprecatedMethod('Main.selectColor()', '3.5');
    152173    var tmp = document.forms[form][input];
    153174    if (!tmp.id) tmp.id = 'z'+(new Date()).getTime();
     
    161182      @param helpid The id of the helptext to be displayed.
    162183  */
     184  // @Deprecated
    163185  this.openHelp = function(ID, helpid) 
    164186  {
     187    App.deprecatedMethod('Main.openHelp()', '3.5');
    165188    Dialogs.openHelp(helpid);
    166189  }
     
    175198        used if the current tab doesn't specify a help id
    176199  */
     200  // @Deprecated
    177201  this.openTabControlHelp = function(ID, tabcontrol, helpId) 
    178202  {
     203    App.deprecatedMethod('Main.openTabControlHelp()', '3.5');
    179204    Dialogs.openTabControlHelp(tabcontrol, helpId);
    180205  }
     
    189214    @param maxLength The maximum length
    190215  */
     216  // @Deprecated
    191217  this.cutString = function(value, maxLength)
    192218  {
     219    App.deprecatedMethod('Main.cutString()', '3.5');
    193220    return Strings.cut(value, maxLength);
    194221  }
     
    199226    @return The trimmed string
    200227  */
     228  // @Deprecated
    201229  this.trimString = function(value)
    202230  {
     231    App.deprecatedMethod('Main.trimString()', '3.5');
    203232    return Strings.trim(value);
    204233  }
    205234 
    206235  // Show or hide an element with the given ID attribute as a block element
     236  // @Deprecated
    207237  this.showHide = function(id, show)
    208238  {
     239    App.deprecatedMethod('Main.showHide()', '3.5');
    209240    Doc.showHide(id, show);
    210241  }
    211242 
    212243  // Shows an element with the given ID attribute as a block element
     244  // @Deprecated
    213245  this.show = function(id)
    214246  {
     247    App.deprecatedMethod('Main.show()', '3.5');
    215248    Doc.show(id);
    216249  }
    217250  // Shows an element with the given ID attribute as an inline element
     251  // @Deprecated
    218252  this.showInline = function(id)
    219253  {
     254    App.deprecatedMethod('Main.showInline()', '3.5');
    220255    Doc.show(id, 'inline');
    221256  }
    222257  // Hides an element with the given ID attribute
     258  // @Deprecated
    223259  this.hide = function(id)
    224260  {
     261    App.deprecatedMethod('Main.hide()', '3.5');
    225262    Doc.hide(id);
    226263  }
    227264 
     265  // @Deprecated
    228266  this.addClass = function(obj, className)
    229267  {
     268    App.deprecatedMethod('Main.addClass()', '3.5');
    230269    Doc.addClass(obj, className);
    231270  }
    232271 
     272  // @Deprecated
    233273  this.removeClass = function(obj, className)
    234274  {
     275    App.deprecatedMethod('Main.removeClass()', '3.5');
    235276    Doc.removeClass(obj, className);
    236277  }
    237278 
     279  // @Deprecated
    238280  this.addOrRemoveClass = function(obj, className, addIfTrue)
    239281  {
     282    App.deprecatedMethod('Main.addOrRemoveClass()', '3.5');
    240283    Doc.addOrRemoveClass(obj, className, addIfTrue);
    241284  }
    242285 
     286  // @Deprecated
    243287  this.toggleClass = function(obj, className)
    244288  {
     289    App.deprecatedMethod('Main.toggleClass()', '3.5');
    245290    Doc.addOrRemoveClass(obj, className);
    246291  }
     
    248293  // Get the character code of an event that invloves a key, returns 0 if no code can be found
    249294  // Use this method for onKeyPress events only. See also: getEventKeyCode()
     295  // @Deprecated
    250296  this.getEventCharCode = function(event)
    251297  {
     298    App.deprecatedMethod('Main.getEventCharCode()', '3.5');
    252299    var charCode = event.charCode;
    253300    if (event.ctrlKey)
     
    273320  // Get the key code of an event that invloves a key, returns 0 if no code can be found
    274321  // Use this method for onKeyDown and onKeyUp events only. See also: getEventCharCode();
     322  // @Deprecated
    275323  this.getEventKeyCode = function(event)
    276324  {
     325    App.deprecatedMethod('Main.getEventKeyCode()', '3.5');
    277326    return event.keyCode;
    278327  }
     
    280329  // Handle keypress events on focused elements:
    281330  //  * Send a 'click' event to the same target if the 'ENTER' key was pressed
     331  // @Deprecated
    282332  this.handleFocusedKeypress = function(event)
    283333  {
     334    App.deprecatedMethod('Main.handleFocusedKeypress()', '3.5');
    284335    Events.handleFocusedKeypress(event);
    285336  }
    286337 
    287338  // Try to get the window height
     339  // @Deprecated
    288340  this.getWindowHeight = function(theWin)
    289341  {
     342    App.deprecatedMethod('Main.getWindowHeight()', '3.5');
    290343    return App.getWindowPosition(theWin).height;
    291344  }
    292345 
    293346  // Try to get the window width
     347  // @Deprecated
    294348  this.getWindowWidth = function(theWin)
    295349  {
     350    App.deprecatedMethod('Main.getWindowWidth()', '3.5');
    296351    return App.getWindowPosition(theWin).width;
    297352  }
     
    300355  // returns an object with 'left', 'top', 'width' and 'height' properties
    301356  // If 'rightAndBottom' is true, then 'right' and 'bottom' properties are also calculated
     357  // @Deprecated
    302358  this.getElementPosition = function(theElement, rightAndBottom)
    303359  {
     360    App.deprecatedMethod('Main.getElementPosition()', '3.5');
    304361    return Doc.getElementPosition(theElement);
    305362  }
    306363 
    307364 
     365  // @Deprecated
    308366  this.encodeURI = function(value)
    309367  {
     368    App.deprecatedMethod('Main.encodeURI()', '3.5');
    310369    return encodeURIComponent(value);
    311370  }
    312371
     372  // @Deprecated
    313373  this.encodeTags = function(value)
    314374  {
     375    App.deprecatedMethod('Main.encodeTags()', '3.5');
    315376    return Strings.encodeTags(value);
    316377  }
    317378 
     379  // @Deprecated
    318380  this.viewFile = function(ID, fileId)
    319381  {
     382    App.deprecatedMethod('Main.viewFile()', '3.5');
    320383    Files.viewFile(fileId);
    321384  }
    322385
     386  // @Deprecated
    323387  this.downloadFile = function(ID, fileId)
    324388  {
     389    App.deprecatedMethod('Main.downloadFile()', '3.5');
    325390    Files.downloadFile(fileId);
    326391  }
    327392 
    328393 
     394  // @Deprecated
    329395  this.getController = function(itemType)
    330396  {
     397    App.deprecatedMethod('Main.getController()', '3.5');
    331398    return Items.getController(itemType);
    332399  }
    333400 
     401  // @Deprecated
    334402  this.listItems = function(ID, itemType, extraUrl)
    335403  {
     404    App.deprecatedMethod('Main.listeItems()', '3.5');
    336405    Items.list(itemType, extraUrl);
    337406  }
    338407   
     408  // @Deprecated
    339409  this.viewOrEditItem = function(ID, itemType, itemId, edit, extraUrl, popupOptions)
    340410  {
     411    App.deprecatedMethod('Main.viewOrEditItem()', '3.5');
    341412    if (edit)
    342413    {
     
    350421  }
    351422 
     423  // @Deprecated
    352424  this.selectItem = function(ID, itemType, mode, callback, extraUrl, popupOptions)
    353425  {
     426    App.deprecatedMethod('Main.selectItem()', '3.5');
    354427    Dialogs.selectItem(itemType, callback, mode.indexOf('ultiple') > 0, extraUrl);
    355428  }
    356429 
     430  // @Deprecated
    357431  this.deleteItemPermanently = function(ID, ask, itemType, itemId, extraUrl, popupOptions)
    358432  {
     433    App.deprecatedMethod('Main.deleteItemPermanently()', '3.5');
    359434    Items.deleteItemPermanently(itemType, itemId, ask);
    360435  }
    361436
     437  // @Deprecated
    362438  this.showUsingItems = function(ID, itemType, itemId, extraUrl)
    363439  {
     440    App.deprecatedMethod('Main.showUsingItems()', '3.5');
    364441    Items.showUsingItems(itemType, itemId);
    365442  }
     
    369446    @return A request object or null if the browser doesn't support ajax
    370447  */
     448  // @Deprecated
    371449  this.getAjaxRequest = function()
    372450  {
     451    App.deprecatedMethod('Main.getAjaxRequest()', '3.5');
    373452    return Ajax.getXmlHttpRequest();
    374453  }
     
    388467      (only if url is not too long)
    389468  */
     469  // @Deprecated
    390470  this.safeSetLocation = function(url, win, replace)
    391471  {
     472    App.deprecatedMethod('Main.safeSetLocation()', '3.5');
    392473    App.safeSetLocation(url, win, replace);
    393474  }
     
    396477    Check if the URL is longer than the configured max URL length.
    397478  */
     479  // @Deprecated
    398480  this.isTooLongURL = function(url)
    399481  {
     482    App.deprecatedMethod('Main.isTooLongURL()', '3.5');
    400483    return App.isTooLongUrl(url);
    401484  }
     
    412495      window.
    413496  */
     497  // @Deprecated
    414498  this.convertToPostForm = function(url, win)
    415499  {
     500    App.deprecatedMethod('Main.convertToPostForm()', '3.5');
    416501    return Forms.convertUrlToForm(url, win);
    417502  }
     
    420505    Save a key-value pair for a page.
    421506  */
     507  // @Deprecated
    422508  this.setPageValue = function(page, key, value)
    423509  {
     510    App.deprecatedMethod('Main.setPageValue()', '3.5');
    424511    Data.setPageValue(key, value, page);
    425512  }
     
    428515    Get the saved value for the given key on a page
    429516  */
     517  // @Deprecated
    430518  this.getPageValue = function(page, key)
    431519  {
     520    App.deprecatedMethod('Main.getPageValue()', '3.5');
    432521    return Data.getPageValue(key,  page);
    433522  }
    434523
    435524
     525  // @Deprecated
    436526  this.debug = function(message, clearOutput)
    437527  {
     528    App.deprecatedMethod('Main.debug()', '3.5');
    438529    App.debug(message);
    439530  }
    440531 
     532  // @Deprecated
    441533  this.hideDebug = function()
    442   {}
     534  {
     535    App.deprecatedMethod('Main.hideDebug()', '3.5');
     536  }
    443537 
    444538}
  • trunk/www/include/scripts/popup.js

    r6540 r6576  
    4242  {
    4343    saveDialogPosition = window.top.name && App.rememberDialogPositions();
    44     if (saveDialogPosition) setTimeout(internal.initPosition, 500);
     44    if (saveDialogPosition) setTimeout(internal.initPosition, 200);
    4545  }
    4646 
     
    5151    var key = 'dialog-position-req:'+window.top.name;
    5252    var rpos = JSON.parse(App.getLocal(key));
    53 //    alert('['+window.screenX+', '+window.screenY+'], ['+rpos.width+', ' + rpos.height+'], ['+window.innerWidth+', ' + window.innerHeight+'], [' + window.outerWidth+', '+window.outerHeight+']');
    5453    if (rpos)
    5554    {
    5655      App.removeLocal(key);
    5756      var cpos = App.getWindowPosition(window.top);
    58       dx = rpos.width-cpos.width;
    59       dy = rpos.height-cpos.height;
     57      dx = Math.min(rpos.width, screen.availWidth) - cpos.width;
     58      dy = Math.min(rpos.height, screen.availHeight) - cpos.height;
     59//      window.top.opener.App.debug('requested:'+JSON.stringify(rpos));
     60//      window.top.opener.App.debug('actual:'+JSON.stringify(cpos));
     61//      window.top.opener.App.debug('delta:'+dx+','+dy);
     62//      window.top.opener.App.debug('screen:'+screen.availWidth+','+screen.availHeight);
    6063    }
    6164  }
  • trunk/www/include/scripts/table.js

    r6372 r6576  
    422422    url += '&table_id='+tableDiv.id+'&item_type='+itemType+'&subcontext='+subContext;
    423423    if (settingName) url += '&settingName='+settingName;
    424     Dialogs.openPopup(url, 'ConfigureColumns', 600, 400);
     424    Dialogs.openPopup(url, 'ConfigureColumns', 750, 450);
    425425  }
    426426
     
    658658      {
    659659        element.checked = !element.checked;
     660        Events.sendChangeEvent(element);
    660661        return element;
    661662      }
     
    736737    }
    737738   
    738     var numSelected = 0;
     739    var selected = [];
    739740    if (frm.item_id)
    740741    {
     
    744745      {
    745746        var id = element.value.match(/^\d+$/) ? parseInt(element.value) : element.value;
    746         if (notifyTarget)
    747         {
    748           // Send event to the target in the opener window
    749           Events.sendCustomEvent(notifyTarget, 'base-selected', {'id': id, 'name': element.title, 'itemType': itemType});
    750         }
    751         else if (callbackMethod)
    752         {
    753           // Call the callback method in the opener window
    754           callbackMethod.call(null, id, element.title);
    755         }
    756         numSelected = 1;
     747        selected[selected.length] = {'id': id, 'name': element.title, 'itemType': itemType};
    757748      }
    758749    }
     
    766757        {
    767758          var id = element.value.match(/^\d+$/) ? parseInt(element.value) : element.value;
    768           if (notifyTarget)
    769           {
    770             // Send event to the target in the opener window
    771             Events.sendCustomEvent(notifyTarget, 'base-selected', {'id': id, 'name': element.title, 'itemType': itemType});
    772           }
    773           else if (callbackMethod)
    774           {
    775             // Call the callback method in the opener window
    776             callbackMethod.call(null, id, element.title);
    777           }
    778           numSelected++;
     759          selected[selected.length] = {'id': id, 'name': element.title, 'itemType': itemType};
    779760        }
    780761      }
    781762    }
    782     return numSelected;
     763   
     764    var remaining = selected.length-1;
     765    for (var i = 0; i < selected.length; i++)
     766    {
     767      var s = selected[i];
     768      s.remaining = remaining--;
     769      if (notifyTarget)
     770      {
     771        // Send event to the target in the opener window
     772        Events.sendCustomEvent(notifyTarget, 'base-selected', s);
     773      }
     774      else if (callbackMethod)
     775      {
     776        // Call the callback method in the opener window
     777        callbackMethod.call(null, s.id, s.name);
     778      }
     779    }
     780
     781    return selected.length;
    783782  }
    784783
  • trunk/www/login.js

    r6540 r6576  
    4848    login.initForm();
    4949   
     50    var footNoteFrame = App.topWindow().frames['footnote'];
     51    if (footNoteFrame)
     52    {
     53      footNoteFrame.location.reload();     
     54    }
     55   
    5056    if (Exception) Exception.fixWindow();
    5157  }
  • trunk/www/views/jobs/view_job.jsp

    r6520 r6576  
    239239        <th>Plugin</th>
    240240        <td>
    241           <base:propertyvalue item="<%=job%>" property="pluginDefinition.name" />
     241          <base:propertyvalue item="<%=job%>" property="pluginDefinition.name" nulltext="<i>External</i>"/>
    242242          <%=job.getPluginVersion() == null ?
    243             "" : "(version " + HTML.encodeTags(job.getPluginVersion()) + ")"%>
     243            "" : "(" + HTML.encodeTags(job.getPluginVersion()) + ")"%>
    244244        </td>
    245245      </tr>
  • trunk/www/views/physicalbioassays/bioassays.js

    r6400 r6576  
    353353    event.detail.value = ':1';
    354354    Link.addItem('extracts', 'EXTRACT', event.detail);
    355     bioassays.extractsOnChange();
     355    if (event.detail.remaining == 0)
     356    {
     357      bioassays.extractsOnChange();
     358    }
    356359  }
    357360
Note: See TracChangeset for help on using the changeset viewer.