1 package org.tigris.scarab.screens.admin; 2 3 48 49 import org.apache.turbine.RunData; 51 import org.apache.turbine.TemplateContext; 52 53 import org.tigris.scarab.tools.ScarabRequestTool; 55 import org.tigris.scarab.tools.ScarabLocalizationTool; 56 import org.tigris.scarab.screens.Default; 57 import org.tigris.scarab.om.Attribute; 58 import org.tigris.scarab.om.Module; 59 import org.tigris.scarab.om.IssueType; 60 import org.tigris.scarab.om.RModuleAttribute; 61 import org.tigris.scarab.util.Log; 62 63 69 public class ModuleAttributeEdit extends Default 70 { 71 protected String getTitle(ScarabRequestTool scarabR, 72 ScarabLocalizationTool l10n, 73 RunData data, TemplateContext context) 74 throws Exception 75 { 76 Attribute attribute = scarabR.getAttribute(); 77 Module module = scarabR.getCurrentModule(); 78 IssueType issueType = scarabR.getIssueType(); 79 80 String title; 81 if (attribute == null) 82 { 83 title = l10n.get("NoAttributeToEdit"); 84 Log.get().warn( 85 "No attribute id was specified for ModuleAttributeEdit."); 86 } 87 else 88 { 89 if (module == null || issueType == null) 90 { 91 title = attribute.getName(); 94 Log.get().warn("Current module or issue type id was not " + 95 "specified for ModuleAttributeEdit"); 96 } 97 else 98 { 99 RModuleAttribute rma = module 100 .getRModuleAttribute(attribute, issueType); 101 if (rma == null) 102 { 103 title = attribute.getName(); 106 Log.get().warn( 107 "rma is null in ModuleAttributeEdit."); 108 } 109 else 110 { 111 title = rma.getDisplayValue(); 112 } 113 } 114 } 115 116 return l10n.format("EditModuleAttribute", title); 117 } 118 } 119 | Popular Tags |