Changeset 2149
- Timestamp:
- Apr 4, 2006, 3:50:40 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Install.java
r2142 r2149 1771 1771 if (pd != null) 1772 1772 { 1773 log.info("createPluginDefinition: EXISTS [className="+className+"; jarPath="+jarPath+"]"); 1773 pd.loadPluginInformation(className, jarPath); 1774 dc.commit(); 1775 log.info("createPluginDefinition: UPDATED [className="+className+"; jarPath="+jarPath+"]"); 1774 1776 } 1775 1777 else -
trunk/src/core/net/sf/basedb/core/ItemModifiedException.java
r841 r2149 61 61 public ItemModifiedException(org.hibernate.StaleStateException ex) 62 62 { 63 this(findWhat(ex));63 super("The item "+findWhat(ex)+" was modified by another transaction.", ex); 64 64 } 65 65 -
trunk/src/core/net/sf/basedb/core/PermissionDeniedException.java
r966 r2149 76 76 super("Permission denied: "+message); 77 77 } 78 /** 79 Creates a new <code>PermissionDeniedException</code>. The error 80 message produced will look like: 81 <code>Permission denied: <i>message</i></code> 82 83 @param message The message explaining why permission was denied 84 @param cause The original cause of the exception 85 */ 86 public PermissionDeniedException(String message, Throwable cause) 87 { 88 super("Permission denied: "+message, cause); 89 } 78 90 79 91 } -
trunk/src/core/net/sf/basedb/core/ReporterBatcher.java
r1594 r2149 202 202 } 203 203 204 public boolean isInInsertQueue(String externalId) 205 { 206 return batchedExternalIds.contains(externalId); 207 } 208 204 209 /** 205 210 Get a reporter when you know the external id. This method only checks the database, -
trunk/src/core/net/sf/basedb/core/ReporterList.java
r1795 r2149 27 27 import net.sf.basedb.core.data.ReporterListData; 28 28 import net.sf.basedb.core.data.ReporterData; 29 import net.sf.basedb.core.data.ReporterListScoreData; 29 30 import net.sf.basedb.core.DataQuery; 30 31 import net.sf.basedb.core.query.Restrictions; … … 184 185 checkPermission(Permission.WRITE); 185 186 if (reporter == null) throw new InvalidUseOfNullException("reporter"); 186 getData().getReporters().put(reporter, score); 187 ReporterListScoreData rlScore = getData().getReporterListScores().get(reporter); 188 if (rlScore == null) 189 { 190 rlScore = new ReporterListScoreData(); 191 rlScore.setReporterList(this.getData()); 192 rlScore.setReporter(reporter); 193 rlScore.setScore(score); 194 getData().getReporterListScores().put(reporter, rlScore); 195 } 196 else 197 { 198 rlScore.setScore(score); 199 } 187 200 } 188 201 … … 192 205 checkPermission(Permission.WRITE); 193 206 if (reporter == null) throw new InvalidUseOfNullException("reporter"); 194 getData().getReporter s().remove(reporter);207 getData().getReporterListScores().remove(reporter); 195 208 } 196 209 … … 199 212 { 200 213 if (reporter == null) throw new InvalidUseOfNullException("reporter"); 201 return getData().getReporters().get(reporter); 214 ReporterListScoreData score = getData().getReporterListScores().get(reporter); 215 return score == null ? null : score.getScore(); 202 216 } 203 217 … … 205 219 { 206 220 DataQuery<ReporterData> query = Reporter.getQuery(); 207 query.joinPermanent(Hql.innerJoin("reporterList s", Item.REPORTERLIST.getAlias()));221 query.joinPermanent(Hql.innerJoin("reporterListScores", Item.REPORTERLIST.getAlias())); 208 222 query.restrictPermanent( 209 223 Restrictions.eq( 210 Hql. alias(Item.REPORTERLIST.getAlias()),224 Hql.property(Item.REPORTERLIST.getAlias(), "reporterList"), 211 225 Hql.entity(this) 212 226 ) -
trunk/src/core/net/sf/basedb/core/data/ReporterData.java
r1795 r2149 175 175 } 176 176 177 private Set<ReporterList Data> reporterLists;177 private Set<ReporterListScoreData> reporterListScores; 178 178 /** 179 179 The lists this reporter is used in. This is the inverse end. 180 180 @see ReporterListData#getReporters() 181 @hibernate.set lazy="true" inverse="true" table="`ReporterListScores`"181 @hibernate.set lazy="true" inverse="true" 182 182 @hibernate.collection-key column="`reporter_id`" 183 @hibernate.collection- many-to-many column="`reporterlist_id`" class="net.sf.basedb.core.data.ReporterListData"183 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.ReporterListScoreData" 184 184 */ 185 Set<ReporterList Data> getReporterLists()185 Set<ReporterListScoreData> getReporterListScores() 186 186 { 187 return reporterList s;187 return reporterListScores; 188 188 } 189 void setReporterList s(Set<ReporterListData> reporterLists)189 void setReporterListScores(Set<ReporterListScoreData> reporterListScores) 190 190 { 191 this.reporterList s = reporterLists;191 this.reporterListScores = reporterListScores; 192 192 } 193 193 -
trunk/src/core/net/sf/basedb/core/data/ReporterListData.java
r1682 r2149 74 74 } 75 75 76 private Map<ReporterData, Float> reporters;76 private Map<ReporterData, ReporterListScoreData> reporters; 77 77 /** 78 78 The list of reporters and their scores. 79 @hibernate.map lazy="true" table="`ReporterListScores`"79 @hibernate.map lazy="true" inverse="true" cascade="all" 80 80 @hibernate.collection-key column="`reporterlist_id`" 81 81 @hibernate.index-many-to-many column="`reporter_id`" class="net.sf.basedb.core.data.ReporterData" 82 @hibernate.collection- element column="`score`" type="float"82 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.ReporterListScoreData" 83 83 */ 84 public Map<ReporterData, Float> getReporters()84 public Map<ReporterData, ReporterListScoreData> getReporterListScores() 85 85 { 86 86 if (reporters == null) 87 87 { 88 reporters = new HashMap<ReporterData, Float>();88 reporters = new HashMap<ReporterData, ReporterListScoreData>(); 89 89 } 90 90 return reporters; 91 91 } 92 void setReporter s(Map<ReporterData, Float> reporters)92 void setReporterListScores(Map<ReporterData, ReporterListScoreData> reporters) 93 93 { 94 94 this.reporters = reporters; -
trunk/src/core/net/sf/basedb/plugins/ReporterFlatFileImporter.java
r1789 r2149 25 25 package net.sf.basedb.plugins; 26 26 27 import net.sf.basedb.core. SessionControl;27 import net.sf.basedb.core.ReporterList; 28 28 import net.sf.basedb.core.RequestInformation; 29 29 import net.sf.basedb.core.PluginParameter; … … 42 42 import net.sf.basedb.core.ItemQuery; 43 43 import net.sf.basedb.core.Job; 44 import net.sf.basedb.core.Type; 44 45 import net.sf.basedb.core.query.Orders; 45 46 import net.sf.basedb.core.query.Hql; … … 50 51 import net.sf.basedb.core.plugin.Request; 51 52 import net.sf.basedb.core.plugin.Response; 52 import net.sf.basedb.core.plugin.ParameterValues;53 53 import net.sf.basedb.core.plugin.About; 54 54 import net.sf.basedb.core.plugin.AboutImpl; … … 57 57 import net.sf.basedb.util.FlatFileParser; 58 58 59 import java.util.HashSet; 59 60 import java.util.List; 60 61 import java.util.ArrayList; … … 63 64 import java.util.HashMap; 64 65 import java.util.Set; 65 import java.util.Collections;66 66 67 67 /** … … 90 90 91 91 private static final Set<GuiContext> guiContexts = 92 Collections.singleton(new GuiContext(Item.REPORTER, GuiContext.Type.LIST)); 92 new HashSet<GuiContext>(Arrays.asList( 93 new GuiContext(Item.REPORTER, GuiContext.Type.LIST), 94 new GuiContext(Item.REPORTERLIST, GuiContext.Type.ITEM) 95 )); 93 96 94 97 private static final StringParameterType requiredColumnMapping = new StringParameterType(255, null, true); 95 98 private static final StringParameterType optionalColumnMapping = new StringParameterType(255, null, false); 96 private static final BooleanParameterType updateExistingType = new BooleanParameterType( null, true);99 private static final BooleanParameterType updateExistingType = new BooleanParameterType(false, true); 97 100 98 101 private static final PluginParameter<String> nameColumnMapping = new PluginParameter<String>( … … 124 127 ); 125 128 129 private static final PluginParameter<String> scoreColumnMapping = new PluginParameter<String>( 130 "scoreColumnMapping", 131 "Score", 132 "Mapping that picks the reporter's score in some context. This mapping is only " + 133 "used when importing to a reporter list.", 134 optionalColumnMapping 135 ); 136 137 126 138 private static final PluginParameter<Boolean> updateExistingParameter = new PluginParameter<Boolean>( 127 139 "updateExisting", … … 132 144 ); 133 145 134 private ItemParameterType<ReporterType> reporterTypeType;135 146 private PluginParameter<ReporterType> reporterTypeParameter; 147 private PluginParameter<ReporterList> reporterListParameter; 136 148 137 149 private List<PluginParameter<String>> allColumnMappings; … … 157 169 return about; 158 170 } 159 160 @Override161 public void init(SessionControl sc, ParameterValues configuration, ParameterValues job)162 throws BaseException163 {164 super.init(sc, configuration, job);165 166 // Load reporter types and initialise the reporterTypeParameter167 DbControl dc = sc.newDbControl();168 ItemQuery<ReporterType> query = ReporterType.getQuery();169 query.order(Orders.asc(Hql.property("name")));170 List<ReporterType> reporterTypes = new ArrayList<ReporterType>(query.list(dc));171 172 reporterTypeType = new ItemParameterType<ReporterType>(ReporterType.class, null, false, 1, reporterTypes);173 // reporterTypes.add(null);174 // reporterTypes.addAll(ReporterType.getQuery().list(dc));175 // TODO - add as parameter in constructor176 //reporterTypeType.setItems(reporterTypes);177 dc.close();178 reporterTypeParameter = new PluginParameter<ReporterType>(179 "reporterType",180 "Reporter type",181 "The reporter type assigned to the imported reporters",182 reporterTypeType);183 184 // Column mappings185 allColumnMappings = new ArrayList<PluginParameter<String>>();186 allColumnMappings.add(nameColumnMapping);187 allColumnMappings.add(reporterIdColumnMapping);188 allColumnMappings.add(descriptionColumnMapping);189 allColumnMappings.add(symbolColumnMapping);190 for (ExtendedProperty ep : ExtendedProperties.getProperties("ReporterData"))191 {192 allColumnMappings.add(193 new PluginParameter<String>(194 "extendedColumnMapping."+ep.getName(),195 ep.getTitle(),196 ep.getDescription(),197 optionalColumnMapping198 )199 );200 }201 202 // RequestInformation object for CONFIGURE_PLUGIN203 List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>();204 205 // Reporter type206 parameters.add(reporterTypeParameter);207 208 // Parser regular expressions209 parameters.add(parserSection);210 parameters.add(headerRegexpParameter);211 parameters.add(dataHeaderRegexpParameter);212 parameters.add(dataSplitterRegexpParameter);213 parameters.add(ignoreRegexpParameter);214 parameters.add(dataFooterRegexpParameter);215 parameters.add(minDataColumnsParameter);216 parameters.add(maxDataColumnsParameter);217 218 // Column mappings219 parameters.add(mappingSection);220 parameters.addAll(allColumnMappings);221 222 configurePlugin = new RequestInformation223 (224 Request.COMMAND_CONFIGURE_PLUGIN,225 "File parser settings",226 "TODO - description",227 parameters228 );229 230 // RequestInformation for CONFIGURE_JOB231 parameters = new ArrayList<PluginParameter<?>>();232 parameters.add(fileParameter);233 parameters.add(updateExistingParameter);234 235 configureJob = new RequestInformation236 (237 Request.COMMAND_CONFIGURE_JOB,238 "Select file to import",239 "TODO - description",240 parameters241 );242 }243 171 // ------------------------------------------- 244 172 … … 256 184 } 257 185 /** 258 Always false, since plugin doesn't operate on individual items. 186 TRUE if the context is {@link Item#REPORTERLIST} and the 187 item is a {@link ReporterList}. 259 188 */ 260 189 public boolean isInContext(GuiContext context, Object item) 261 190 { 262 return false;191 return (context.getItem() == Item.REPORTERLIST) && (item instanceof ReporterList); 263 192 } 264 193 /** … … 274 203 if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN)) 275 204 { 276 requestInformation = configurePlugin;205 requestInformation = getConfigurePluginParameters(context); 277 206 } 278 207 else if (command.equals(Request.COMMAND_CONFIGURE_JOB)) 279 208 { 280 requestInformation = configureJob;209 requestInformation = getConfigureJobParameters(context); 281 210 } 282 211 return requestInformation; … … 293 222 if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN)) 294 223 { 295 List<Throwable> errors = validateRequestParameters( configurePlugin.getParameters(), request);224 List<Throwable> errors = validateRequestParameters(getConfigurePluginParameters(context).getParameters(), request); 296 225 if (errors != null) 297 226 { … … 310 239 311 240 // Column mappings 312 for (PluginParameter<?> pp : allColumnMappings)241 for (PluginParameter<?> pp : getAllColumnMappings()) 313 242 { 314 243 storeValue(configuration, request, pp); … … 321 250 else if (command.equals(Request.COMMAND_CONFIGURE_JOB)) 322 251 { 323 List<Throwable> errors = validateRequestParameters( configureJob.getParameters(), request);252 List<Throwable> errors = validateRequestParameters(getConfigureJobParameters(context).getParameters(), request); 324 253 if (errors != null) 325 254 { 326 255 response.setError(errors.size()+" invalid parameter(s) were found in the request", errors); 327 256 return; 257 } 258 if (context.getItem() == Item.REPORTERLIST) 259 { 260 storeValue(job, request, reporterListParameter); 328 261 } 329 262 storeValue(job, request, fileParameter); … … 346 279 private Map<String, String> columnMappings; 347 280 private ReporterType reporterType; 281 private ReporterList reporterList; 348 282 private boolean updateExisting; 349 283 private int numInserted; 350 284 private int numUpdated; 285 private int numAddedToList; 286 private Map<String, Float> deferred; 351 287 352 288 /** … … 362 298 batcher = ReporterBatcher.getNew(dc); 363 299 reporterType = (ReporterType)configuration.getValue("reporterType"); 300 reporterList = (ReporterList)job.getValue("reporterList"); 301 if (reporterList != null) 302 { 303 reporterList = ReporterList.getById(dc, reporterList.getId()); 304 deferred = new HashMap<String, Float>(); 305 numAddedToList = 0; 306 } 364 307 updateExisting = (Boolean)job.getValue("updateExisting"); 365 308 columnMappings = new HashMap<String, String>(); 366 for (PluginParameter<?> pp : allColumnMappings)309 for (PluginParameter<?> pp : getAllColumnMappings()) 367 310 { 368 311 columnMappings.put(pp.getName(), (String)configuration.getValue(pp.getName())); … … 381 324 try 382 325 { 326 batcher.flush(); 327 if (reporterList != null) 328 { 329 // Add newly inserted reporters to the reporter list 330 for (Map.Entry<String, Float> entry : deferred.entrySet()) 331 { 332 ReporterData reporter = batcher.getByExternalId(entry.getKey()); 333 reporterList.addReporter(reporter, entry.getValue()); 334 numAddedToList++; 335 } 336 } 383 337 batcher.close(); 384 338 if (success) … … 410 364 ReporterData reporter = null; 411 365 boolean useUpdate = false; 412 if (updateExisting && !batcher.exists(externalId, true, false)) 413 { 366 367 // Is the reporter already queued for insert? 368 if (!batcher.isInInsertQueue(externalId)) 369 { 370 // No, it's not... try to load it from the database 414 371 try 415 372 { 416 373 reporter = batcher.getByExternalId(externalId); 417 useUpdate = true;418 374 } 419 375 catch (ItemNotFoundException ex) 420 376 { 377 // It wasn't in the database either, create a new reporter 421 378 reporter = Reporter.getNew(externalId); 422 useUpdate = false; 423 } 424 } 425 else if (!batcher.exists(externalId, true, true)) 426 { 427 reporter = Reporter.getNew(externalId); 428 useUpdate = false; 429 } 379 } 380 } 381 382 // If we have a reporter object, we must set the properties or add it to a reporter list 430 383 if (reporter != null) 431 384 { 432 if (reporterType != null) Reporter.setReporterType(reporter, reporterType); 433 String name = data.map(columnMappings.get("nameColumnMapping")); 434 reporter.setName(name == null ? externalId : name); 435 reporter.setSymbol(data.map(columnMappings.get("symbolColumnMapping"))); 436 reporter.setDescription(data.map(columnMappings.get("descriptionColumnMapping"))); 385 int currentId = reporter.getId(); 386 if (reporterList != null) 387 { 388 // Add to reporter list 389 Float score = (Float)Type.FLOAT.parseString(data.map(columnMappings.get("scoreColumnMapping"))); 390 if (currentId == 0) 391 { 392 // It is a new reporter, we must wait to add it until the batcher has been flushed 393 deferred.put(externalId, score); 394 } 395 else 396 { 397 reporterList.addReporter(reporter, score); 398 numAddedToList++; 399 } 400 } 437 401 402 // The actual reporter needs updating or it is a new one 403 if ((updateExisting && currentId != 0) || currentId == 0) 404 { 405 406 if (reporterType != null) Reporter.setReporterType(reporter, reporterType); 407 String name = data.map(columnMappings.get("nameColumnMapping")); 408 reporter.setName(name == null ? externalId : name); 409 reporter.setSymbol(data.map(columnMappings.get("symbolColumnMapping"))); 410 reporter.setDescription(data.map(columnMappings.get("descriptionColumnMapping"))); 411 412 for (ExtendedProperty ep : ExtendedProperties.getProperties("ReporterData")) 413 { 414 reporter.setExtended(ep.getName(), ep.parseString(data.map(columnMappings.get("extendedColumnMapping."+ep.getName())))); 415 } 416 if (currentId != 0) 417 { 418 batcher.update(reporter); 419 numUpdated++; 420 } 421 else 422 { 423 batcher.insert(reporter); 424 numInserted++; 425 } 426 } 427 } 428 } 429 /** 430 Return <code>x new reporters; y updated reporters; z reporters added to list</code>. 431 */ 432 protected String getSuccessMessage() 433 { 434 String addedToList = ""; 435 if (reporterList != null) 436 { 437 addedToList = "; " + (numAddedToList == 1 ? 438 "1 reporter added to list" : 439 numAddedToList + " reporters added to list"); 440 } 441 return numInserted + (numInserted == 1 ? " new reporter; " : " new reporters; ") 442 + numUpdated + (numUpdated == 1 ? " updated reporter" : " updated reporters") 443 + addedToList; 444 } 445 // ------------------------------------------- 446 447 private List<PluginParameter<String>> getAllColumnMappings() 448 { 449 if (allColumnMappings == null) 450 { 451 // Column mappings 452 allColumnMappings = new ArrayList<PluginParameter<String>>(); 453 allColumnMappings.add(nameColumnMapping); 454 allColumnMappings.add(reporterIdColumnMapping); 455 allColumnMappings.add(descriptionColumnMapping); 456 allColumnMappings.add(symbolColumnMapping); 457 allColumnMappings.add(scoreColumnMapping); 438 458 for (ExtendedProperty ep : ExtendedProperties.getProperties("ReporterData")) 439 459 { 440 reporter.setExtended(ep.getName(), ep.parseString(data.map(columnMappings.get("extendedColumnMapping."+ep.getName())))); 441 } 442 if (useUpdate) 443 { 444 batcher.update(reporter); 445 numUpdated++; 446 } 447 else 448 { 449 batcher.insert(reporter); 450 numInserted++; 451 } 452 } 453 } 454 /** 455 Return <code>x new reporters; y updated reporters</code>. 456 */ 457 protected String getSuccessMessage() 458 { 459 return numInserted + (numInserted == 1 ? " new reporter; " : " new reporters; ") 460 + numUpdated + (numUpdated == 1 ? " updated reporter" : " updated reporters"); 461 } 462 // ------------------------------------------- 463 460 allColumnMappings.add( 461 new PluginParameter<String>( 462 "extendedColumnMapping."+ep.getName(), 463 ep.getTitle(), 464 ep.getDescription(), 465 optionalColumnMapping 466 ) 467 ); 468 } 469 470 } 471 return allColumnMappings; 472 } 473 474 475 private RequestInformation getConfigureJobParameters(GuiContext context) 476 { 477 if (configureJob == null) 478 { 479 // RequestInformation for CONFIGURE_JOB 480 List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>(); 481 if (context.getItem() == Item.REPORTERLIST) 482 { 483 ItemParameterType<ReporterList> reporterListType = new ItemParameterType<ReporterList>(ReporterList.class, null, true, 1, null); 484 reporterListParameter = new PluginParameter<ReporterList>( 485 "reporterList", 486 "Reporter list", 487 "The list to import reporters to", 488 reporterListType); 489 parameters.add(reporterListParameter); 490 } 491 parameters.add(fileParameter); 492 parameters.add(updateExistingParameter); 493 494 configureJob = new RequestInformation 495 ( 496 Request.COMMAND_CONFIGURE_JOB, 497 "Select a file to import reporter from", 498 "TODO - description", 499 parameters 500 ); 501 } 502 return configureJob; 503 } 504 505 private RequestInformation getConfigurePluginParameters(GuiContext context) 506 { 507 if (configurePlugin == null) 508 { 509 // Load reporter types and initialise the reporterTypeParameter 510 DbControl dc = sc.newDbControl(); 511 ItemQuery<ReporterType> query = ReporterType.getQuery(); 512 query.order(Orders.asc(Hql.property("name"))); 513 List<ReporterType> reporterTypes = new ArrayList<ReporterType>(query.list(dc)); 514 dc.close(); 515 516 ItemParameterType<ReporterType> reporterTypeType = new ItemParameterType<ReporterType>(ReporterType.class, null, false, 1, reporterTypes); 517 reporterTypeParameter = new PluginParameter<ReporterType>( 518 "reporterType", 519 "Reporter type", 520 "The reporter type assigned to the imported reporters", 521 reporterTypeType); 522 523 // RequestInformation object for CONFIGURE_PLUGIN 524 List<PluginParameter<?>> parameters = new ArrayList<PluginParameter<?>>(); 525 526 // Reporter type 527 parameters.add(reporterTypeParameter); 528 529 // Parser regular expressions 530 parameters.add(parserSection); 531 parameters.add(headerRegexpParameter); 532 parameters.add(dataHeaderRegexpParameter); 533 parameters.add(dataSplitterRegexpParameter); 534 parameters.add(ignoreRegexpParameter); 535 parameters.add(dataFooterRegexpParameter); 536 parameters.add(minDataColumnsParameter); 537 parameters.add(maxDataColumnsParameter); 538 539 // Column mappings 540 parameters.add(mappingSection); 541 parameters.addAll(getAllColumnMappings()); 542 543 configurePlugin = new RequestInformation 544 ( 545 Request.COMMAND_CONFIGURE_PLUGIN, 546 "File parser settings", 547 "TODO - description", 548 parameters 549 ); 550 551 } 552 return configurePlugin; 553 } 554 464 555 } -
trunk/src/test/TestReporterList.java
r1682 r2149 163 163 dc.deleteItem(rl); 164 164 dc.commit(); 165 write("--Delete reporter list sOK");166 } 167 catch (Throwable ex) 168 { 169 write("--Delete reporter list sFAILED");165 write("--Delete reporter list OK"); 166 } 167 catch (Throwable ex) 168 { 169 write("--Delete reporter list FAILED"); 170 170 ex.printStackTrace(); 171 171 ok = false; … … 211 211 write_item(0, rl); 212 212 DataQuery<ReporterData> query = Reporter.getQuery(); 213 query.setMaxResults(maxNumber); 213 214 DataResultIterator<ReporterData> reporters = query.iterate(dc); 214 215 int i = 0; … … 228 229 catch (Throwable ex) 229 230 { 230 write("-- Load reporters to list FAILED");231 write("--Add reporters to list FAILED"); 231 232 ex.printStackTrace(); 232 233 ok = false; -
trunk/www/include/menu.jsp
r2107 r2149 121 121 122 122 final boolean hasReporters = !sc.hasPermission(Permission.DENIED, Item.REPORTER); 123 final boolean hasReporterLists = !sc.hasPermission(Permission.DENIED, Item.REPORTERLIST); 123 124 final boolean createReporters = sc.hasPermission(Permission.CREATE, Item.REPORTER); 124 125 final boolean hasJobs = !sc.hasPermission(Permission.DENIED, Item.JOB); … … 328 329 enabled="<%=hasReporters%>" 329 330 /> 331 <m:menuitem 332 title="Reporter lists" 333 onclick="<%="Menu.openUrl('"+root+"views/reporterlists/index.jsp?ID="+ID+"')"%>" 334 tooltip="<%=hasReporterLists ? "Manage reporter lists" : "You do not have permission to manage reporter lists"%>" 335 enabled="<%=hasReporterLists%>" 336 /> 330 337 331 338 </m:menu>
Note: See TracChangeset
for help on using the changeset viewer.