Changeset 2150


Ignore:
Timestamp:
Apr 5, 2006, 3:37:35 PM (18 years ago)
Author:
Nicklas Nordborg
Message:

Added page for viewing scores for reporters in reporter list.
Added new query to get the scores.

Location:
trunk
Files:
6 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/PresetSelector.java

    r1933 r2150  
    193193    int numOptions = 0;
    194194    Class dataClass = itemType.getDataClass();
    195     if (RemovableData.class.isAssignableFrom(dataClass))
    196     {
    197       boolean current = cc.getInclude().contains(Include.REMOVED);
    198       sb.append("<option value=\"option:removed:").append(current ? "0" : "1").append("\"");
    199       sb.append(" title=\"Show/hide removed items\">");
    200       sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Removed\n");
    201       table.addHidden("removed", Boolean.toString(current));
    202       numOptions++;
    203     }
    204     if (OwnableData.class.isAssignableFrom(dataClass))
    205     {
    206       boolean current = cc.getInclude().contains(Include.MINE);
    207       sb.append("<option value=\"option:owned:").append(current ? "0" : "1").append("\"");
    208       sb.append(" title=\"Show/hide items owned by me\">");
    209       sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Owned by me\n");
    210       table.addHidden("owned", Boolean.toString(current));
    211       numOptions++;
    212     }
    213     if (ShareableData.class.isAssignableFrom(dataClass)
    214         || ProjectData.class.isAssignableFrom(dataClass)
    215       )
    216     {
    217       boolean current = cc.getInclude().contains(Include.SHARED);
    218       sb.append("<option value=\"option:shared:").append(current ? "0" : "1").append("\"");
    219       sb.append(" title=\"Show/hide items shared to me\">");
    220       sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Shared to me\n");
    221       table.addHidden("shared", Boolean.toString(current));
    222       numOptions++;
    223      
    224       if (sc.getActiveProjectId() != 0 && !ProjectData.class.isAssignableFrom(dataClass))
    225       {
    226         current = cc.getInclude().contains(Include.IN_PROJECT);
    227         sb.append("<option value=\"option:inproject:").append(current ? "0" : "1").append("\"");
    228         sb.append(" title=\"Show/hide items in current project\">");
    229         sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("In current project\n");
    230         table.addHidden("inproject", Boolean.toString(current));
     195    if (dataClass != null)
     196    {
     197      if (RemovableData.class.isAssignableFrom(dataClass))
     198      {
     199        boolean current = cc.getInclude().contains(Include.REMOVED);
     200        sb.append("<option value=\"option:removed:").append(current ? "0" : "1").append("\"");
     201        sb.append(" title=\"Show/hide removed items\">");
     202        sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Removed\n");
     203        table.addHidden("removed", Boolean.toString(current));
    231204        numOptions++;
    232205      }
    233     }
    234 
    235     if (sc.hasPermission(Permission.READ, itemType) &&
    236         (
    237           OwnableData.class.isAssignableFrom(dataClass) ||
    238           SessionData.class.isAssignableFrom(dataClass)
     206      if (OwnableData.class.isAssignableFrom(dataClass))
     207      {
     208        boolean current = cc.getInclude().contains(Include.MINE);
     209        sb.append("<option value=\"option:owned:").append(current ? "0" : "1").append("\"");
     210        sb.append(" title=\"Show/hide items owned by me\">");
     211        sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Owned by me\n");
     212        table.addHidden("owned", Boolean.toString(current));
     213        numOptions++;
     214      }
     215      if (ShareableData.class.isAssignableFrom(dataClass)
     216          || ProjectData.class.isAssignableFrom(dataClass)
    239217        )
    240       )
    241     {
    242       boolean current = cc.getInclude().contains(Include.OTHERS);
    243       sb.append("<option value=\"option:others:").append(current ? "0" : "1").append("\"");
    244       sb.append(" title=\"Show/hide items owned by others\">");
    245       sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Owned by others\n");
    246       table.addHidden("others", Boolean.toString(current));
    247       numOptions++;
     218      {
     219        boolean current = cc.getInclude().contains(Include.SHARED);
     220        sb.append("<option value=\"option:shared:").append(current ? "0" : "1").append("\"");
     221        sb.append(" title=\"Show/hide items shared to me\">");
     222        sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Shared to me\n");
     223        table.addHidden("shared", Boolean.toString(current));
     224        numOptions++;
     225       
     226        if (sc.getActiveProjectId() != 0 && !ProjectData.class.isAssignableFrom(dataClass))
     227        {
     228          current = cc.getInclude().contains(Include.IN_PROJECT);
     229          sb.append("<option value=\"option:inproject:").append(current ? "0" : "1").append("\"");
     230          sb.append(" title=\"Show/hide items in current project\">");
     231          sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("In current project\n");
     232          table.addHidden("inproject", Boolean.toString(current));
     233          numOptions++;
     234        }
     235      }
     236 
     237      if (sc.hasPermission(Permission.READ, itemType) &&
     238          (
     239            OwnableData.class.isAssignableFrom(dataClass) ||
     240            SessionData.class.isAssignableFrom(dataClass)
     241          )
     242        )
     243      {
     244        boolean current = cc.getInclude().contains(Include.OTHERS);
     245        sb.append("<option value=\"option:others:").append(current ? "0" : "1").append("\"");
     246        sb.append(" title=\"Show/hide items owned by others\">");
     247        sb.append(current ? "×&nbsp;" : "&nbsp;&nbsp;").append("Owned by others\n");
     248        table.addHidden("others", Boolean.toString(current));
     249        numOptions++;
     250      }
    248251    }
    249252
  • trunk/src/core/net/sf/basedb/core/AbstractQuery.java

    r2031 r2150  
    181181  */
    182182  private List<String> thetaJoinConditions;
     183 
     184  /**
     185    If the {@link #count(DbControl)} method is executing or not.
     186  */
     187  private boolean isCounting;
    183188
    184189  /**
     
    427432    maxResults = 0;
    428433  }
     434  public boolean isCounting()
     435  {
     436    return isCounting;
     437  }
    429438  // -------------------------------------------
    430439
     440  /**
     441    Set the counting status of the query.
     442  */
     443  void setCounting(boolean isCounting)
     444  {
     445    this.isCounting = isCounting;
     446  }
     447 
    431448  void temporarySelect(Select select)
    432449    throws InvalidDataException, BaseException
     
    585602  {
    586603    StringBuilder ql = new StringBuilder();
     604    setCounting(true);
    587605    ql.append(isDistinct() ? "SELECT DISTINCT COUNT(*) " : "SELECT COUNT(*) ");
    588606    ql.append(" FROM ").append(rootEntity).append(" ").append(getRootAlias());
     
    618636    appended = appendHavings(ql, dc, permanentHavings, 0);
    619637    appended += appendHavings(ql, dc, havings, appended);
     638    setCounting(false);
    620639   
    621640    if (debugEnabled) logSql.debug("Count query(" + getQueryType()+ "): " +ql.toString());
  • trunk/src/core/net/sf/basedb/core/Item.java

    r2104 r2150  
    193193  */
    194194  REPORTERLIST(163, "Reporter list", "rpl", ReporterList.class, ReporterListData.class, DefinedPermissions.shareable),
     195  /**
     196    The item is a {@link ReporterScore}. This item is not a BasicItem.
     197  */
     198  REPORTERSCORE(164, "Reporter score", "rps", null, null, null),
    195199
    196200  /**
  • trunk/src/core/net/sf/basedb/core/ReporterList.java

    r2149 r2150  
    2828import net.sf.basedb.core.data.ReporterData;
    2929import net.sf.basedb.core.data.ReporterListScoreData;
    30 import net.sf.basedb.core.DataQuery;
    31 import net.sf.basedb.core.query.Restrictions;
    32 import net.sf.basedb.core.query.Hql;
     30
    3331
    3432/**
     
    180178  }
    181179
     180  /**
     181    Add or update the score for a reporter.
     182   
     183    @param reporter The reporter to add to the list
     184    @param score The score for the reporter, or null
     185    @throws PermissionDeniedException If the logged in user doesn't have
     186      write permission
     187    @throws InvalidDataException If the reporter is null
     188   */
    182189  public void addReporter(ReporterData reporter, Float score)
    183190    throws PermissionDeniedException, InvalidDataException
     
    185192    checkPermission(Permission.WRITE);
    186193    if (reporter == null) throw new InvalidUseOfNullException("reporter");
    187     ReporterListScoreData rlScore = getData().getReporterListScores().get(reporter);
     194    ReporterListScoreData rlScore = getData().getReporterListScores().get(reporter.getId());
    188195    if (rlScore == null)
    189196    {
     
    192199      rlScore.setReporter(reporter);
    193200      rlScore.setScore(score);
    194       getData().getReporterListScores().put(reporter, rlScore);
     201      getData().getReporterListScores().put(reporter.getId(), rlScore);
     202      getDbControl().getHibernateSession().save(rlScore);
    195203    }
    196204    else
     
    200208  }
    201209
     210  /**
     211    Remove a reporter from the reporter list.
     212    @param reporter The reporter to remove.
     213    @throws PermissionDeniedException If the logged in user doesn't have
     214      write permission
     215    @throws InvalidDataException If the reporter is null
     216   */
    202217  public void removeReporter(ReporterData reporter)
    203218    throws PermissionDeniedException, InvalidDataException
     
    205220    checkPermission(Permission.WRITE);
    206221    if (reporter == null) throw new InvalidUseOfNullException("reporter");
    207     getData().getReporterListScores().remove(reporter);
    208   }
    209  
     222    System.out.println(reporter.getId());
     223   
     224    System.out.println(getData().getReporterListScores().toString());
     225   
     226   
     227    ReporterListScoreData rlScore = getData().getReporterListScores().remove(reporter.getId());
     228    if (rlScore != null)
     229    {
     230      System.out.println("rlScore.reporterId=" + rlScore.getReporterId());
     231      System.out.println("rlScore.reporter.id=" + rlScore.getReporter().getId());
     232      getDbControl().getHibernateSession().delete(rlScore);
     233    }
     234  }
     235 
     236  /**
     237    Get the score for the specified reporter.
     238    @param reporter The reporter
     239    @return The score as a float value, or null if the reporter isn't found
     240      or hasn't been assigned a score
     241    @throws InvalidDataException
     242   */
    210243  public Float getScore(ReporterData reporter)
    211     throws InvalidDataException
    212   {
    213     if (reporter == null) throw new InvalidUseOfNullException("reporter");
    214     ReporterListScoreData score = getData().getReporterListScores().get(reporter);
     244  {
     245    ReporterListScoreData score = getData().getReporterListScores().get(reporter.getId());
    215246    return score == null ? null : score.getScore();
    216247  }
    217248
    218   public DataQuery<ReporterData> getReporters()
    219   {
    220     DataQuery<ReporterData> query = Reporter.getQuery();
    221     query.joinPermanent(Hql.innerJoin("reporterListScores", Item.REPORTERLIST.getAlias()));
    222     query.restrictPermanent(
    223       Restrictions.eq(
    224         Hql.property(Item.REPORTERLIST.getAlias(), "reporterList"),
    225         Hql.entity(this)
    226       )
    227     );
     249  /**
     250    Get a query returning {@link ReporterScore} objects.
     251  */
     252  public ReporterScoreQuery getReporterScores()
     253  {
     254    ReporterScoreQuery query = ReporterScore.getQuery(this);
    228255    return query;
    229256  }
     257 
    230258}
    231259
  • trunk/src/core/net/sf/basedb/core/data/ReporterListData.java

    r2149 r2150  
    3535  @see net.sf.basedb.core.ReporterList
    3636  @see <a href="../../../../../../../development/overview/data/reporters.html">Reporter overview</a>
    37   @hibernate.class table="`ReporterLists`" lazy="false"
     37  @hibernate.class table="`ReporterLists`" lazy="true"
    3838*/
    3939public class ReporterListData
     
    7474  }
    7575
    76   private Map<ReporterData, ReporterListScoreData> reporters;
     76  private Map<Integer, ReporterListScoreData> reporters;
    7777  /**
    7878    The list of reporters and their scores.
    79     @hibernate.map lazy="true" inverse="true" cascade="all"
     79    @hibernate.map lazy="true" inverse="true" cascade="delete"
    8080    @hibernate.collection-key column="`reporterlist_id`"
    81     @hibernate.index-many-to-many column="`reporter_id`" class="net.sf.basedb.core.data.ReporterData"
     81    hibernate.index-many-to-many column="`reporter_id`" class="net.sf.basedb.core.data.ReporterData"
     82    @hibernate.collection-index column="`reporter_id`" type="int"
    8283    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.ReporterListScoreData"
    8384  */
    84   public Map<ReporterData, ReporterListScoreData> getReporterListScores()
     85  public Map<Integer, ReporterListScoreData> getReporterListScores()
    8586  {
    8687    if (reporters == null)
    8788    {
    88       reporters = new HashMap<ReporterData, ReporterListScoreData>();
     89      reporters = new HashMap<Integer, ReporterListScoreData>();
    8990    }
    9091    return reporters;
    9192  }
    92   void setReporterListScores(Map<ReporterData, ReporterListScoreData> reporters)
     93  void setReporterListScores(Map<Integer, ReporterListScoreData> reporters)
    9394  {
    9495    this.reporters = reporters;
  • trunk/src/core/net/sf/basedb/core/data/ReporterListScoreData.hbm.xml

    r2149 r2150  
    77  $Id$
    88
    9   Copyright (C) 2006 Jari H&auml;kkinen, Nicklas Nordborg
     9  Copyright (C) 2006 Nicklas Nordborg
    1010 
    1111  This file is part of BASE - BioArray Software Environment.
     
    3838        class="net.sf.basedb.core.data.ReporterListData"
    3939        column="`reporterlist_id`"
     40        lazy="proxy"
    4041      />
    41       <key-many-to-one
    42         name="reporter"
    43         class="net.sf.basedb.core.data.ReporterData"
     42      <key-property
     43        name="reporterId"
     44        type="int"
    4445        column="`reporter_id`"
    4546      />
     
    5455      not-null="false"
    5556    />
     57    <many-to-one
     58      name="reporter"
     59      class="net.sf.basedb.core.data.ReporterData"
     60      column="`reporter_id`"
     61      lazy="proxy"
     62      update="false"
     63      insert="false"
     64    />
     65   
    5666  </class>
    5767</hibernate-mapping>
  • trunk/src/core/net/sf/basedb/core/data/ReporterListScoreData.java

    r2149 r2150  
    22  $Id$
    33
    4    Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
     4   Copyright (C) 2006 Nicklas Nordborg
    55 
    66  This file is part of BASE - BioArray Software Environment.
     
    2828/**
    2929  This class holds information about the score of a reporter in a
    30   reporter list
     30  reporter list. The mapping is defined in the external mapping
     31  file <code>ReporterListScoreData.hbm.xml</code> since
     32  XDoclet can't generate the <code>&lt;composite-id&gt;</code>
     33  tag for us.
    3134 
    3235  @author Nicklas
     
    4043{
    4144
     45  public ReporterListScoreData()
     46  {}
     47 
    4248  /*
    4349    From the Object class
     
    5056    if (getClass() != o.getClass()) return false;
    5157    ReporterListScoreData other = (ReporterListScoreData)o;
    52     return reporterList.equals(other.reporterList) && reporter.equals(other.reporter);
     58    return reporterList.equals(other.reporterList) && reporterId == other.reporterId;
    5359  }
    5460  @Override
     
    5763    return 23 * reporterList.hashCode() + 7 * reporter.hashCode();
    5864  }
     65  public String toString()
     66  {
     67    return "ReporterListScoreData: reporterId="+getReporterId()+"; score="+getScore();
     68  }
    5969  // -------------------------------------------
    6070 
    6171  private ReporterListData reporterList;
     72  /**
     73    The reporter list this reporter and score belongs to. Part
     74    of the composite id of this class.
     75  */
    6276  public ReporterListData getReporterList()
    6377  {
     
    6983  }
    7084 
     85  private int reporterId;
     86  /**
     87    The id of the reporter. This mapping is neccessary
     88    since the alternative <code>&lt;key-many-to-one&gt;</code>
     89    doesn't work with <code>INNER JOIN FETCH</code> queries.
     90    We have to use a regular <code>&lt;many-to-one&gt;</code>,
     91    which means that the reporter property must be outside the
     92    compiste id.
     93  */
     94  public int getReporterId()
     95  {
     96    return reporterId;
     97  }
     98  public void setReporterId(int reporterId)
     99  {
     100    this.reporterId = reporterId;
     101  }
     102 
    71103  private ReporterData reporter;
     104  /**
     105    Get the reporter.
     106  */
    72107  public ReporterData getReporter()
    73108  {
     
    77112  {
    78113    this.reporter = reporter;
     114    reporterId = reporter.getId();
    79115  }
    80116
    81117  private Float score;
     118  /**
     119    Get the score for the reporter, or null if no score has been set.
     120  */
    82121  public Float getScore()
    83122  {
     
    89128  }
    90129
    91  
    92130}
  • trunk/src/core/net/sf/basedb/core/query/Hql.java

    r1654 r2150  
    211211    throws InvalidDataException
    212212  {
    213     return innerJoin(null, property, joinedAlias);
     213    return innerJoin(null, property, joinedAlias, false);
    214214  }
    215215
     
    231231    throws InvalidDataException
    232232  {
     233    return innerJoin(alias, property, joinedAlias, false);
     234  }
     235
     236  /**
     237    Create an inner join query element and optionally
     238    prefetch the joined items in the same query. This is useful to
     239    avoid subsequent queries to the database when you know that you are
     240    going to access the joined items in your code. If you are joining a
     241    collection the {@link Query#setFirstResult(int)} and {@link Query#setMaxResults(int)}
     242    shouldn't be used since the join will create multiple rows for the same
     243    root item.
     244   
     245    @param alias The alias to resolve the property against, or null to resolve the
     246      property against the root entity
     247    @param property The property name of the associated entity (required)
     248    @param joinedAlias The alias to give the joined entity (required)
     249    @param fetch If the joined items should be prefetched or not
     250    @return A join query element
     251    @throws InvalidDataException If the property or joined alias parameter
     252      are null or if any of the parameters contains invalid characters
     253  */
     254  public static Join innerJoin(String alias, String property, String joinedAlias, boolean fetch)
     255    throws InvalidDataException
     256  {
    233257    if (property == null) throw new InvalidUseOfNullException("property");
    234258    if (joinedAlias == null) throw new InvalidUseOfNullException("alias");
     
    245269      throw new InvalidDataException("Alias '"+joinedAlias+"' has one or more invalid characters. Only a-z, A-Z and 0-9 is allowed.");
    246270    }
    247     return new HqlInnerJoin(alias, property, joinedAlias);
    248   }
    249 
     271    return new HqlInnerJoin(alias, property, joinedAlias, fetch);
     272  }
     273 
    250274  /**
    251275    Same as <code>leftJoin(null, propert, joinedAlias, null)</code>
  • trunk/src/core/net/sf/basedb/core/query/HqlInnerJoin.java

    r1922 r2150  
    4747  private final String property;
    4848  private final String joinedAlias;
     49  private final boolean fetch;
    4950
    50   HqlInnerJoin(String alias, String property, String joinedAlias)
     51  HqlInnerJoin(String alias, String property, String joinedAlias, boolean fetch)
    5152  {
    5253    assert property != null : "property == null";
     
    5556    this.property = property;
    5657    this.joinedAlias = joinedAlias;
     58    this.fetch = fetch;
    5759  }
    5860
     
    6668    if (query.getQueryType() == QueryType.HQL)
    6769    {
    68       return "JOIN "+(alias == null ? query.getRootAlias() : alias) + "." + property + " " + joinedAlias;
     70      // Count queries can't use the fetch parameter; they are not selecting the root item
     71      return "INNER JOIN " + (fetch && !query.isCounting() ? "FETCH " : "") +
     72        (alias == null ? query.getRootAlias() : alias) + "." + property + " " + joinedAlias;
    6973    }
    7074    else
     
    96100  public String toString()
    97101  {
    98     return "JOIN "+(alias == null ? "" : alias + ".") + property + " " + joinedAlias;
     102    return "INNER JOIN " + (fetch ? "FETCH " : "") +
     103      (alias == null ? "" : alias + ".") + property + " " + joinedAlias;
    99104  }
    100105  // -------------------------------------------
  • trunk/src/core/net/sf/basedb/core/query/Query.java

    r1979 r2150  
    329329    throws BaseException;
    330330
     331  /**
     332    Check if the query is executing the {@link #count(DbControl)} method or not
     333    @return TRUE if the query is currently executing the <code>count</code>
     334      method, FALSE otherwise
     335  */
     336  public boolean isCounting();
     337 
    331338}
  • trunk/src/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java

    r2149 r2150  
    9292    new HashSet<GuiContext>(Arrays.asList(
    9393      new GuiContext(Item.REPORTER, GuiContext.Type.LIST),
    94       new GuiContext(Item.REPORTERLIST, GuiContext.Type.ITEM)
     94      new GuiContext(Item.REPORTERLIST, GuiContext.Type.ITEM),
     95      new GuiContext(Item.REPORTERSCORE, GuiContext.Type.LIST)
    9596    ));
    9697
     
    256257          return;
    257258        }
    258         if (context.getItem() == Item.REPORTERLIST)
     259        if (context.getItem() == Item.REPORTERLIST || context.getItem() == Item.REPORTERSCORE)
    259260        {
    260261          storeValue(job, request, reporterListParameter);
     
    479480      // RequestInformation for CONFIGURE_JOB
    480481      List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>();
    481       if (context.getItem() == Item.REPORTERLIST)
     482      if (context.getItem() == Item.REPORTERLIST || context.getItem() == Item.REPORTERSCORE)
    482483      {
    483484        ItemParameterType<ReporterList> reporterListType = new ItemParameterType<ReporterList>(ReporterList.class, null, true, 1, null);
  • trunk/src/test/TestReporterList.java

    r2149 r2150  
    248248      ReporterList rl = ReporterList.getById(dc, id);
    249249     
    250       DataQuery<ReporterData> query = rl.getReporters();
    251       DataResultIterator<ReporterData> reporters = query.iterate(dc);
     250      ReporterScoreQuery query = rl.getReporterScores();
     251      ReporterScoreResultIterator reporters = query.iterate(dc);
    252252     
    253253      int i = 0;
    254254      while (reporters.hasNext())
    255255      {
    256         ReporterData r = reporters.next();
    257         write_item(i, r, rl.getScore(r));
     256        ReporterScore r = reporters.next();
     257        write_item(i, r.getReporter(), r.getScore());
    258258        i++;
    259259      }
  • trunk/www/views/reporterlists/view_reporterlist.jsp

    r2149 r2150  
    11<%-- $Id$
    22  ------------------------------------------------------------------
    3   BioArray Software Environment (BASE) - http://base.thep.lu.se/
    4   Copyright (C) 2002-2004 Lao Saal, Carl Troein,
    5   Johan Vallon-Christersson, Jari Häkkinen, Nicklas Nordborg
    6 
    7   This file is part of BASE.
    8 
    9   BASE is free software; you can redistribute it and/or
    10   modify it under the terms of the GNU General Public License
    11   as published by the Free Software Foundation; either version 2
    12   of the License, or (at your option) any later version.
    13 
    14   BASE is distributed in the hope that it will be useful,
    15   but WITHOUT ANY WARRANTY; without even the implied warranty of
    16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17   GNU General Public License for more details.
    18 
     3  Copyright (C) 2006 Nicklas Nordborg
     4 
     5  This file is part of BASE - BioArray Software Environment.
     6  Available at http://base.thep.lu.se/
     7 
     8  BASE is free software; you can redistribute it and/or modify it
     9  under the terms of the GNU General Public License as published by
     10  the Free Software Foundation; either version 2 of the License, or
     11  (at your option) any later version.
     12 
     13  BASE is distributed in the hope that it will be useful, but
     14  WITHOUT ANY WARRANTY; without even the implied warranty of
     15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     16  General Public License for more details.
     17 
    1918  You should have received a copy of the GNU General Public License
    2019  along with this program; if not, write to the Free Software
    21   Foundation, Inc., 59 Temple Place - Suite 330,
    22   Boston, MA  02111-1307, USA.
     20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     21  02111-1307, USA.
    2322  ------------------------------------------------------------------
    2423
     
    108107      Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540);
    109108    }
     109    function viewReporters()
     110    {
     111      location.href = 'reporters/index.jsp?ID=<%=ID%>&cmd=List&reporterlist_id=<%=itemId%>';
     112    }
     113    function switchTab(tabControlId, tabId)
     114    {
     115      if (tabId == 'reporters')
     116      {
     117        viewReporters();
     118      }
     119      else
     120      {
     121        TabControl.setActiveTab(tabControlId, tabId);
     122      }
     123    }
    110124    </script>
    111125  </base:head>
     
    117131    </p:path>
    118132   
    119     <t:tabcontrol id="main" active="properties">
     133    <t:tabcontrol id="main" active="properties" switch="switchTab">
    120134    <t:tab id="properties" title="Properties">
    121135    <tbl:toolbar
Note: See TracChangeset for help on using the changeset viewer.