1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import java.net.URLEncoder ; 27 import java.util.ArrayList ; 28 import java.util.HashMap ; 29 import java.util.List ; 30 31 import org.apache.log4j.Logger; 32 import org.infoglue.cms.applications.common.ImageButton; 33 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 34 import org.infoglue.cms.controllers.kernel.impl.simple.AvailableServiceBindingController; 35 import org.infoglue.cms.controllers.kernel.impl.simple.ContentTypeDefinitionController; 36 import org.infoglue.cms.controllers.kernel.impl.simple.GroupControllerProxy; 37 import org.infoglue.cms.controllers.kernel.impl.simple.GroupPropertiesController; 38 import org.infoglue.cms.controllers.kernel.impl.simple.InterceptionPointController; 39 import org.infoglue.cms.controllers.kernel.impl.simple.InterceptorController; 40 import org.infoglue.cms.controllers.kernel.impl.simple.LanguageController; 41 import org.infoglue.cms.controllers.kernel.impl.simple.RedirectController; 42 import org.infoglue.cms.controllers.kernel.impl.simple.RoleControllerProxy; 43 import org.infoglue.cms.controllers.kernel.impl.simple.RolePropertiesController; 44 import org.infoglue.cms.controllers.kernel.impl.simple.ServiceDefinitionController; 45 import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeTypeDefinitionController; 46 import org.infoglue.cms.controllers.kernel.impl.simple.UserControllerProxy; 47 import org.infoglue.cms.controllers.kernel.impl.simple.UserPropertiesController; 48 import org.infoglue.cms.controllers.kernel.impl.simple.WorkflowDefinitionController; 49 import org.infoglue.cms.entities.management.InterceptionPointVO; 50 import org.infoglue.cms.entities.workflow.WorkflowDefinitionVO; 51 import org.infoglue.cms.security.InfoGlueGroup; 52 import org.infoglue.cms.security.InfoGluePrincipal; 53 import org.infoglue.cms.security.InfoGlueRole; 54 import org.infoglue.cms.util.CmsPropertyHandler; 55 56 61 62 public class ViewManagementToolToolBarAction extends InfoGlueAbstractAction 63 { 64 private final static Logger logger = Logger.getLogger(ViewManagementToolToolBarAction.class.getName()); 65 66 private static final long serialVersionUID = 1L; 67 68 private String title = ""; 69 private String name = ""; 70 private String toolbarKey = ""; 71 private String url = ""; 72 73 private Integer repositoryId = null; 75 private String userName = null; 76 private Integer extranetUserId = null; 77 private String roleName = null; 78 private String groupName = null; 79 private Integer extranetRoleId = null; 80 private Integer languageId = null; 81 private Integer functionId = null; 82 private Integer serviceDefinitionId = null; 83 private Integer availableServiceBindingId = null; 84 private Integer siteNodeTypeDefinitionId = null; 85 private Integer contentTypeDefinitionId = null; 86 private Integer interceptionPointId = null; 87 private Integer interceptorId = null; 88 private Integer categoryId = null; 89 private Integer workflowDefinitionId = null; 90 private Integer redirectId = null; 91 private Integer serverNodeId = null; 92 93 private String URIEncoding = CmsPropertyHandler.getURIEncoding(); 94 95 private InterceptionPointVO interceptionPointVO = null; 96 97 private static HashMap buttonsMap = new HashMap (); 98 99 public String doExecute() throws Exception 100 { 101 if(this.interceptionPointId != null) 102 this.interceptionPointVO = InterceptionPointController.getController().getInterceptionPointVOWithId(this.interceptionPointId); 103 104 return "success"; 105 } 106 107 public Integer getInterceptionPointId() 108 { 109 return this.interceptionPointId; 110 } 111 112 public void setInterceptionPointId(Integer interceptionPointId) 113 { 114 this.interceptionPointId = interceptionPointId; 115 } 116 117 public Integer getInterceptorId() 118 { 119 return this.interceptorId; 120 } 121 122 public void setInterceptorId(Integer interceptorId) 123 { 124 this.interceptorId = interceptorId; 125 } 126 127 public Integer getRepositoryId() 128 { 129 return this.repositoryId; 130 } 131 132 public void setRepositoryId(Integer repositoryId) 133 { 134 this.repositoryId = repositoryId; 135 } 136 137 public Integer getExtranetUserId() 138 { 139 return extranetUserId; 140 } 141 142 public void setExtranetUserId(Integer integer) 143 { 144 extranetUserId = integer; 145 } 146 147 public Integer getLanguageId() 148 { 149 return this.languageId; 150 } 151 152 public void setLanguageId(Integer languageId) 153 { 154 this.languageId = languageId; 155 } 156 157 public String getRoleName() 158 { 159 return this.roleName; 160 } 161 162 public void setRoleName(String roleName) 163 { 164 this.roleName = roleName; 165 } 166 167 public String getGroupName() 168 { 169 return groupName; 170 } 171 public void setGroupName(String groupName) 172 { 173 this.groupName = groupName; 174 } 175 176 public Integer getFunctionId() 177 { 178 return this.functionId; 179 } 180 181 public void setFunctionId(Integer functionId) 182 { 183 this.functionId = functionId; 184 } 185 186 public Integer getServiceDefinitionId() 187 { 188 return this.serviceDefinitionId; 189 } 190 191 public void setServiceDefinitionId(Integer serviceDefinitionId) 192 { 193 this.serviceDefinitionId = serviceDefinitionId; 194 } 195 196 public Integer getAvailableServiceBindingId() 197 { 198 return this.availableServiceBindingId; 199 } 200 201 public void setAvailableServiceBindingId(Integer availableServiceBindingId) 202 { 203 this.availableServiceBindingId = availableServiceBindingId; 204 } 205 206 public Integer getSiteNodeTypeDefinitionId() 207 { 208 return this.siteNodeTypeDefinitionId; 209 } 210 211 public void setSiteNodeTypeDefinitionId(Integer siteNodeTypeDefinitionId) 212 { 213 this.siteNodeTypeDefinitionId = siteNodeTypeDefinitionId; 214 } 215 216 public Integer getContentTypeDefinitionId() 217 { 218 return this.contentTypeDefinitionId; 219 } 220 221 public void setContentTypeDefinitionId(Integer contentTypeDefinitionId) 222 { 223 this.contentTypeDefinitionId = contentTypeDefinitionId; 224 } 225 226 public Integer getServerNodeId() 227 { 228 return serverNodeId; 229 } 230 231 public void setServerNodeId(Integer serverNodeId) 232 { 233 this.serverNodeId = serverNodeId; 234 } 235 236 public Integer getCategoryId() 237 { 238 return this.categoryId; 239 } 240 241 public void setCategoryId(Integer categoryId) 242 { 243 this.categoryId = categoryId; 244 } 245 246 public String getTitle() 247 { 248 return this.title; 249 } 250 251 public void setTitle(String title) 252 { 253 this.title = title; 254 } 255 256 public String getName() 257 { 258 return this.name; 259 } 260 261 public void setName(String name) 262 { 263 this.name = name; 264 } 265 266 public String getToolbarKey() 267 { 268 return this.toolbarKey; 269 } 270 271 public void setToolbarKey(String toolbarKey) 272 { 273 this.toolbarKey = toolbarKey; 274 } 275 276 public void setUrl(String url) 277 { 278 this.url = url; 279 } 280 281 public String getUrl() 282 { 283 return this.url; 284 } 285 286 public Integer getExtranetRoleId() 287 { 288 return extranetRoleId; 289 } 290 291 public void setExtranetRoleId(Integer extranetRoleId) 292 { 293 this.extranetRoleId = extranetRoleId; 294 } 295 296 public String getUserName() 297 { 298 return userName; 299 } 300 301 public void setUserName(String userName) 302 { 303 this.userName = userName; 304 } 305 306 public Integer getWorkflowDefinitionId() 307 { 308 return workflowDefinitionId; 309 } 310 311 public void setWorkflowDefinitionId(Integer workflowDefinitionId) 312 { 313 this.workflowDefinitionId = workflowDefinitionId; 314 } 315 316 public Integer getRedirectId() 317 { 318 return redirectId; 319 } 320 321 public void setRedirectId(Integer redirectId) 322 { 323 this.redirectId = redirectId; 324 } 325 326 public List getButtons() 327 { 328 logger.info("Title:" + this.title); 329 logger.info("toolbarKey:" + this.toolbarKey); 330 331 try 332 { 333 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.repositoryList.header")) 334 return getRepositoriesButtons(); 335 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewRepository.header")) 336 return getRepositoryDetailsButtons(); 337 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewSystemUserList.header")) 338 return getSystemUsersButtons(); 339 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewSystemUser.header")) 340 return getSystemUserDetailsButtons(); 341 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewRoleList.header")) 342 return getRolesButtons(); 343 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewRole.header")) 344 return getRoleDetailsButtons(); 345 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewGroupList.header")) 346 return getGroupsButtons(); 347 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewGroup.header")) 348 return getGroupDetailsButtons(); 349 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewLanguageList.header")) 350 return getLanguagesButtons(); 351 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewLanguage.header")) 352 return getLanguageDetailsButtons(); 353 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewInterceptionPointList.header")) 354 return getInterceptionPointsButtons(); 355 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewInterceptionPoint.header")) 356 return getInterceptionPointButtons(); 357 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewInterceptorList.header")) 358 return getInterceptorsButtons(); 359 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewInterceptor.header")) 360 return getInterceptorButtons(); 361 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewServiceDefinitionList.header")) 362 return getServiceDefinitionsButtons(); 363 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewServiceDefinition.header")) 364 return getServiceDefinitionDetailsButtons(); 365 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewAvailableServiceBindingList.header")) 366 return getAvailableServiceBindingsButtons(); 367 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewAvailableServiceBinding.header")) 368 return getAvailableServiceBindingDetailsButtons(); 369 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewSiteNodeTypeDefinitionList.header")) 370 return getSiteNodeTypeDefinitionsButtons(); 371 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewSiteNodeTypeDefinition.header")) 372 return getSiteNodeTypeDefinitionDetailsButtons(); 373 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewContentTypeDefinitionList.header")) 374 return getContentTypeDefinitionsButtons(); 375 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewContentTypeDefinition.header")) 376 return getContentTypeDefinitionDetailsButtons(); 377 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewCategoryList.header") || this.toolbarKey.equalsIgnoreCase("tool.managementtool.editCategory.header")) 378 return getCategoryButtons(); 379 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewUp2DateList.header")) 380 return getAvailablePackagesButtons(); 381 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewWorkflowDefinitionList.header")) 382 return getWorkflowDefinitionsButtons(); 383 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewWorkflowDefinition.header")) 384 return getWorkflowDefinitionDetailsButtons(); 385 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.portletList.header")) 386 return getPortletsButtons(); 387 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.redirectList.header")) 390 return getRedirectsButtons(); 391 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewRedirect.header")) 392 return getRedirectDetailsButtons(); 393 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.serverNodeList.header")) 394 return getServerNodesButtons(); 395 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewServerNode.header")) 396 return getServerNodeDetailsButtons(); 397 if(this.toolbarKey.equalsIgnoreCase("tool.managementtool.viewMessageCenter.header")) 398 return getMessageCenterButtons(); 399 400 } 401 catch(Exception e) {e.printStackTrace();} 402 403 return null; 404 } 405 406 407 private List getRepositoriesButtons() throws Exception 408 { 409 List buttons = new ArrayList (); 410 buttons.add(new ImageButton("CreateRepository!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newRepository"), "tool.managementtool.createRepository.header")); 411 buttons.add(new ImageButton(true, "javascript:submitListForm('repository');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteRepository"), "tool.managementtool.deleteRepositories.header")); 412 buttons.add(new ImageButton(true, "javascript:openPopup('ImportRepository!input.action', 'Import', 'width=400,height=250,resizable=no');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.importRepository"), getLocalizedString(getSession().getLocale(), "tool.managementtool.importRepository.header"))); 413 414 return buttons; 415 } 416 417 private List getRepositoryDetailsButtons() throws Exception 418 { 419 List buttons = new ArrayList (); 420 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteRepository.header&yesDestination=" + URLEncoder.encode("DeleteRepository.action?repositoryId=" + this.repositoryId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListRepository.action?title=Repositories", "UTF-8") + "&message=tool.managementtool.deleteRepository.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteRepository"), "tool.managementtool.deleteRepository.header")); 421 buttons.add(new ImageButton(true, "javascript:openPopup('ExportRepository!input.action?repositoryId=" + this.repositoryId + "', 'Export', 'width=400,height=200,resizable=no');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.exportRepository"), getLocalizedString(getSession().getLocale(), "tool.managementtool.exportRepository.header"))); 422 buttons.add(new ImageButton("ViewRepositoryProperties.action?repositoryId=" + this.repositoryId, getLocalizedString(getSession().getLocale(), "images.global.buttons.editProperties"), "Edit Properties", new Integer (22), new Integer (80))); 423 424 String returnAddress = URLEncoder.encode(URLEncoder.encode("ViewRepository.action?repositoryId=" + this.repositoryId, "UTF-8"), "UTF-8"); 425 buttons.add(new ImageButton("ViewAccessRights.action?interceptionPointCategory=Repository&extraParameters=" + this.repositoryId +"&colorScheme=ManagementTool&returnAddress=" + returnAddress, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.accessRights"), "tool.managementtool.accessRights.header")); 426 buttons.add(new ImageButton("ViewListRepositoryLanguage.action?repositoryId=" + this.repositoryId +"&returnAddress=" + returnAddress, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.repositoryLanguages"), "tool.managementtool.repositoryLanguages.header")); 427 428 buttons.add(new ImageButton(true, "javascript:openPopup('RebuildRegistry!input.action?repositoryId=" + this.repositoryId + "', 'Registry', 'width=400,height=200,resizable=no');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.rebuildRegistry"), getLocalizedString(getSession().getLocale(), "tool.managementtool.rebuildRegistry.header"))); 429 430 return buttons; 431 } 432 433 private List getAvailablePackagesButtons() throws Exception 434 { 435 List buttons = new ArrayList (); 436 buttons.add(new ImageButton("RefreshUpdates.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.refreshUpdates"), "Refresh Updates")); 437 buttons.add(new ImageButton(true, "javascript:submitListForm('updatePackage');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.installUpdate"), "Install update")); 438 return buttons; 439 } 440 441 private List getSystemUsersButtons() throws Exception 442 { 443 List buttons = new ArrayList (); 444 if(UserControllerProxy.getController().getSupportCreate()) 445 buttons.add(new ImageButton("CreateSystemUser!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newSystemUser"), "New System User")); 446 buttons.add(new ImageButton(true, "javascript:toggleSearchForm();", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.searchButton"), "Search Form")); 449 return buttons; 450 } 451 452 private List getSystemUserDetailsButtons() throws Exception 453 { 454 List buttons = new ArrayList (); 455 if(!this.userName.equals(CmsPropertyHandler.getAnonymousUser())) 456 { 457 InfoGluePrincipal user = UserControllerProxy.getController().getUser(this.userName); 458 if(user.getAutorizationModule().getSupportDelete()) 459 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteSystemUser.header&yesDestination=" + URLEncoder.encode("DeleteSystemUser.action?userName=" + URLEncoder.encode(this.userName, URIEncoding), URIEncoding) + "&noDestination=" + URLEncoder.encode("ViewListSystemUser.action?title=SystemUsers", URIEncoding) + "&message=tool.managementtool.deleteSystemUser.text&extraParameters=" + URLEncoder.encode(this.userName, URIEncoding), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteSystemUser"), "tool.managementtool.deleteSystemUser.header")); 460 461 if(user.getAutorizationModule().getSupportUpdate()) 462 buttons.add(new ImageButton("UpdateSystemUserPassword!input.action?userName=" + URLEncoder.encode(URLEncoder.encode(this.userName, URIEncoding), URIEncoding), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.updateSystemUserPassword"), "Update user password")); 463 } 464 465 List contentTypeDefinitionVOList = UserPropertiesController.getController().getContentTypeDefinitionVOList(this.userName); 466 if(contentTypeDefinitionVOList.size() > 0) 467 buttons.add(new ImageButton("ViewUserProperties.action?userName=" + URLEncoder.encode(URLEncoder.encode(this.userName, URIEncoding), URIEncoding), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.viewSystemUserProperties"), "View User Properties")); 468 469 if(this.getInfoGluePrincipal().getIsAdministrator()) 470 buttons.add(new ImageButton("AuthorizationSwitchManagement!inputUser.action?userName=" + URLEncoder.encode(URLEncoder.encode(this.userName, URIEncoding)), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.transferUserAccessRights"), "Transfer Users Access Rights")); 471 472 return buttons; 473 } 474 475 private List getRolesButtons() throws Exception 476 { 477 List buttons = new ArrayList (); 478 if(UserControllerProxy.getController().getSupportCreate()) 479 buttons.add(new ImageButton("CreateRole!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newRole"), "New Role")); 480 483 return buttons; 484 } 485 486 private List getRoleDetailsButtons() throws Exception 487 { 488 List buttons = new ArrayList (); 489 490 String yesDestination = URLEncoder.encode("DeleteRole.action?roleName=" + URLEncoder.encode(this.roleName, URIEncoding), URIEncoding); 491 String noDestination = URLEncoder.encode("ViewListRole.action?title=Roles", URIEncoding); 492 String message = URLEncoder.encode("Do you really want to delete the role " + URLEncoder.encode(this.roleName, URIEncoding), URIEncoding); 493 494 InfoGlueRole role = RoleControllerProxy.getController().getRole(this.roleName); 495 if(role.getAutorizationModule().getSupportDelete()) 496 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteRole.header&yesDestination=" + yesDestination + "&noDestination=" + noDestination + "&message=tool.managementtool.deleteRole.text&extraParameters=" + URLEncoder.encode(this.roleName, URIEncoding), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteRole"), "tool.managementtool.deleteRole.header")); 497 498 List contentTypeDefinitionVOList = RolePropertiesController.getController().getContentTypeDefinitionVOList(this.roleName); 499 if(contentTypeDefinitionVOList.size() > 0) 500 buttons.add(new ImageButton("ViewRoleProperties.action?roleName=" + URLEncoder.encode(URLEncoder.encode(this.roleName, URIEncoding)), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.viewRoleProperties"), "View Role Properties")); 501 502 if(this.getInfoGluePrincipal().getIsAdministrator()) 503 buttons.add(new ImageButton("AuthorizationSwitchManagement!inputRole.action?roleName=" + URLEncoder.encode(URLEncoder.encode(this.roleName, URIEncoding)), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.transferRoleAccessRights"), "Transfer Roles Access Rights")); 504 505 return buttons; 506 } 507 508 private List getGroupsButtons() throws Exception 509 { 510 List buttons = new ArrayList (); 511 if(UserControllerProxy.getController().getSupportCreate()) 512 buttons.add(new ImageButton("CreateGroup!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newGroup"), "New Group")); 513 516 return buttons; 517 } 518 519 private List getGroupDetailsButtons() throws Exception 520 { 521 List buttons = new ArrayList (); 522 523 String yesDestination = URLEncoder.encode("DeleteGroup.action?groupName=" + URLEncoder.encode(this.groupName, URIEncoding), URIEncoding); 524 String noDestination = URLEncoder.encode("ViewListGroup.action?title=Groups", URIEncoding); 525 String message = URLEncoder.encode("Do you really want to delete the group " + URLEncoder.encode(this.groupName, URIEncoding), URIEncoding); 526 527 InfoGlueGroup group = GroupControllerProxy.getController().getGroup(this.groupName); 528 if(group.getAutorizationModule().getSupportDelete()) 529 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteGroup.header&yesDestination=" + yesDestination + "&noDestination=" + noDestination + "&message=tool.managementtool.deleteGroup.text&extraParameters=" + URLEncoder.encode(this.groupName, URIEncoding), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteGroup"), "tool.managementtool.deleteGroup.header")); 530 531 List contentTypeDefinitionVOList = GroupPropertiesController.getController().getContentTypeDefinitionVOList(this.groupName); 532 if(contentTypeDefinitionVOList.size() > 0) 533 buttons.add(new ImageButton("ViewGroupProperties.action?groupName=" + URLEncoder.encode(URLEncoder.encode(this.groupName, URIEncoding)), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.viewGroupProperties"), "View Group Properties")); 534 535 if(this.getInfoGluePrincipal().getIsAdministrator()) 536 buttons.add(new ImageButton("AuthorizationSwitchManagement!inputGroup.action?groupName=" + URLEncoder.encode(URLEncoder.encode(this.groupName, URIEncoding)), getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.transferGroupAccessRights"), "Transfer Groups Access Rights")); 537 538 return buttons; 539 } 540 541 private List getLanguagesButtons() throws Exception 542 { 543 List buttons = new ArrayList (); 544 buttons.add(new ImageButton("CreateLanguage!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newLanguage"), "New Language")); 545 buttons.add(new ImageButton(true, "javascript:submitListForm('language');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteLanguage"), "tool.managementtool.deleteLanguages.header")); 546 return buttons; 547 } 548 549 private List getLanguageDetailsButtons() throws Exception 550 { 551 List buttons = new ArrayList (); 552 this.name = LanguageController.getController().getLanguageVOWithId(this.languageId).getName(); 553 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteLanguage.header&yesDestination=" + URLEncoder.encode("DeleteLanguage.action?languageId=" + this.languageId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListLanguage.action?title=Languages", "UTF-8") + "&message=tool.managementtool.deleteLanguage.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteLanguage"), "tool.managementtool.deleteLanguage.header")); 554 return buttons; 555 } 556 557 private List getInterceptionPointsButtons() throws Exception 558 { 559 List buttons = new ArrayList (); 560 buttons.add(new ImageButton("CreateInterceptionPoint!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newInterceptionPoint"), "New InterceptionPoint")); 561 buttons.add(new ImageButton(true, "javascript:submitListForm('interceptionPoint');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteInterceptionPoint"), "tool.managementtool.deleteInterceptionPoints.header")); 562 return buttons; 563 } 564 565 private List getInterceptionPointButtons() throws Exception 566 { 567 List buttons = new ArrayList (); 568 this.name = InterceptionPointController.getController().getInterceptionPointVOWithId(this.interceptionPointId).getName(); 569 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteInterceptionPoint.header&yesDestination=" + URLEncoder.encode("DeleteInterceptionPoint.action?interceptionPointId=" + this.interceptionPointId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListInterceptionPoint.action?title=InterceptionPoints", "UTF-8") + "&message=tool.managementtool.deleteInterceptionPoint.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteInterceptionPoint"), "tool.managementtool.deleteInterceptionPoint.header")); 570 if(this.interceptionPointVO.getUsesExtraDataForAccessControl().booleanValue() == false) 571 buttons.add(new ImageButton("ViewAccessRights.action?interceptionPointCategory=" + this.interceptionPointVO.getCategory() + "&interceptionPointId=" + this.interceptionPointId + "&returnAddress=ViewInterceptionPoint.action?interceptionPointId=" + this.interceptionPointId + "&colorScheme=ManagementTool", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.accessRights"), "InterceptionPoint Access Rights")); 572 573 return buttons; 574 } 575 576 private List getInterceptorsButtons() throws Exception 577 { 578 List buttons = new ArrayList (); 579 buttons.add(new ImageButton("CreateInterceptor!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newInterceptor"), "New Interceptor")); 580 buttons.add(new ImageButton(true, "javascript:submitListForm('interceptor');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteInterceptor"), "tool.managementtool.deleteInterceptors.header")); 581 return buttons; 582 } 583 584 private List getInterceptorButtons() throws Exception 585 { 586 List buttons = new ArrayList (); 587 this.name = InterceptorController.getController().getInterceptorVOWithId(this.interceptorId).getName(); 588 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteInterceptor.header&yesDestination=" + URLEncoder.encode("DeleteInterceptor.action?interceptorId=" + this.interceptorId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListInterceptor.action?title=Interceptors", "UTF-8") + "&message=tool.managementtool.deleteInterceptor.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteInterceptor"), "tool.managementtool.deleteInterceptor.header")); 589 return buttons; 590 } 591 592 private List getServiceDefinitionsButtons() throws Exception 593 { 594 List buttons = new ArrayList (); 595 buttons.add(new ImageButton("CreateServiceDefinition!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newServiceDefinition"), "New ServiceDefinition")); 596 buttons.add(new ImageButton(true, "javascript:submitListForm('serviceDefinition');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteServiceDefinition"), "tool.managementtool.deleteServiceDefinitions.header")); 597 return buttons; 598 } 599 600 private List getServiceDefinitionDetailsButtons() throws Exception 601 { 602 List buttons = new ArrayList (); 603 this.name = ServiceDefinitionController.getController().getServiceDefinitionVOWithId(this.serviceDefinitionId).getName(); 604 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteServiceDefinition.header&yesDestination=" + URLEncoder.encode("DeleteServiceDefinition.action?serviceDefinitionId=" + this.serviceDefinitionId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListServiceDefinition.action?title=ServiceDefinitions", "UTF-8") + "&message=tool.managementtool.deleteServiceDefinition.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteServiceDefinition"), "tool.managementtool.deleteServiceDefinition.header")); 605 return buttons; 606 } 607 608 private List getAvailableServiceBindingsButtons() throws Exception 609 { 610 List buttons = new ArrayList (); 611 buttons.add(new ImageButton("CreateAvailableServiceBinding!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newAvailableServiceBinding"), "New AvailableServiceBinding")); 612 buttons.add(new ImageButton(true, "javascript:submitListForm('availableServiceBinding');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteAvailableServiceBinding"), "tool.managementtool.deleteAvailableServiceBindings.header")); 613 return buttons; 614 } 615 616 private List getAvailableServiceBindingDetailsButtons() throws Exception 617 { 618 List buttons = new ArrayList (); 619 this.name = AvailableServiceBindingController.getController().getAvailableServiceBindingVOWithId(this.availableServiceBindingId).getName(); 620 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteAvailableServiceBinding.header&yesDestination=" + URLEncoder.encode("DeleteAvailableServiceBinding.action?availableServiceBindingId=" + this.availableServiceBindingId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListAvailableServiceBinding.action?title=AvailableServiceBindings", "UTF-8") + "&message=tool.managementtool.deleteAvailableServiceBinding.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteAvailableServiceBinding"), "tool.managementtool.deleteAvailableServiceBinding.header")); 621 return buttons; 622 } 623 624 private List getSiteNodeTypeDefinitionsButtons() throws Exception 625 { 626 List buttons = new ArrayList (); 627 buttons.add(new ImageButton("CreateSiteNodeTypeDefinition!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newSiteNodeTypeDefinition"), "New SiteNodeTypeDefinition")); 628 buttons.add(new ImageButton(true, "javascript:submitListForm('siteNodeTypeDefinition');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteSiteNodeTypeDefinition"), "tool.managementtool.deleteSiteNodeTypeDefinitions.header")); 629 return buttons; 630 } 631 632 private List getSiteNodeTypeDefinitionDetailsButtons() throws Exception 633 { 634 List buttons = new ArrayList (); 635 this.name = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionVOWithId(this.siteNodeTypeDefinitionId).getName(); 636 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteSiteNodeTypeDefinition.header&yesDestination=" + URLEncoder.encode("DeleteSiteNodeTypeDefinition.action?siteNodeTypeDefinitionId=" + this.siteNodeTypeDefinitionId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListSiteNodeTypeDefinition.action?title=SiteNodeTypeDefinitions", "UTF-8") + "&message=tool.managementtool.deleteSiteNodeTypeDefinition.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteSiteNodeTypeDefinition"), "tool.managementtool.deleteSiteNodeTypeDefinition.header")); 637 return buttons; 638 } 639 640 641 private List getContentTypeDefinitionsButtons() throws Exception 642 { 643 List buttons = new ArrayList (); 644 buttons.add(new ImageButton("CreateContentTypeDefinition!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newContentTypeDefinition"), "New ContentTypeDefinition")); 645 buttons.add(new ImageButton(true, "javascript:submitListForm('contentTypeDefinition');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteContentTypeDefinition"), "tool.managementtool.deleteContentTypeDefinitions.header")); 646 return buttons; 647 } 648 649 private List getContentTypeDefinitionDetailsButtons() throws Exception 650 { 651 List buttons = new ArrayList (); 652 this.name = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(this.contentTypeDefinitionId).getName(); 653 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteContentTypeDefinition.header&yesDestination=" + URLEncoder.encode("DeleteContentTypeDefinition.action?contentTypeDefinitionId=" + this.contentTypeDefinitionId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListContentTypeDefinition.action?title=ContentTypeDefinitions", "UTF-8") + "&message=tool.managementtool.deleteContentTypeDefinition.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteContentTypeDefinition"), "tool.managementtool.deleteContentTypeDefinition.header")); 654 655 String protectContentTypes = CmsPropertyHandler.getProtectContentTypes(); 656 if(protectContentTypes != null && protectContentTypes.equalsIgnoreCase("true")) 657 { 658 String returnAddress = URLEncoder.encode(URLEncoder.encode("ViewContentTypeDefinition.action?contentTypeDefinitionId=" + this.contentTypeDefinitionId, "UTF-8"), "UTF-8"); 659 buttons.add(getAccessRightsButton("ContentTypeDefinition", this.contentTypeDefinitionId.toString(), returnAddress)); 660 } 661 662 return buttons; 663 } 664 665 private List getCategoryButtons() throws Exception 666 { 667 String url = "CategoryManagement!new.action"; 668 if(getCategoryId() != null) 669 url += "?model/parentId=" + getCategoryId(); 670 671 List buttons = new ArrayList (); 672 buttons.add(new ImageButton(url, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newCategory"), "New Category")); 673 674 if(getCategoryId() != null) 675 buttons.add(new ImageButton(true, "javascript:openPopup('CategoryManagement!displayTreeForMove.action?categoryId=" + getCategoryId() + "', 'Category', 'width=400,height=600,resizable=no,status=yes');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.moveCategory"), "Move Category")); 676 677 buttons.add(new ImageButton(true, "javascript:submitListForm('category');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteCategory"), "Delete Category")); 678 679 if(getCategoryId() != null) 680 { 681 String returnAddress = URLEncoder.encode(URLEncoder.encode("CategoryManagement!edit.action?categoryId=" + getCategoryId() + "&title=Category%20Details", "UTF-8"), "UTF-8"); 682 buttons.add(getAccessRightsButton("Category", getCategoryId().toString(), returnAddress)); 683 } 684 685 return buttons; 686 } 687 688 private ImageButton getAccessRightsButton(String interceptionPointCategory, String extraParameter, String returnAddress) throws Exception 689 { 690 return new ImageButton("ViewAccessRights.action?interceptionPointCategory=" + interceptionPointCategory + "&extraParameters=" + extraParameter +"&colorScheme=ManagementTool&returnAddress=" + returnAddress, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.accessRights"), "tool.managementtool.accessRights.header"); 691 } 692 693 private List getRedirectsButtons() throws Exception 694 { 695 696 List buttons = new ArrayList (); 697 buttons.add(new ImageButton("CreateRedirect!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newRedirect"), "New Redirect")); 698 buttons.add(new ImageButton(true, "javascript:submitListForm('redirect');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteRedirect"), "tool.managementtool.deleteRedirects.header")); 699 return buttons; 700 } 701 702 private List getRedirectDetailsButtons() throws Exception 703 { 704 List buttons = new ArrayList (); 705 this.name = RedirectController.getController().getRedirectVOWithId(this.redirectId).getUrl(); 706 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteRedirect.header&yesDestination=" + URLEncoder.encode("DeleteRedirect.action?redirectId=" + this.redirectId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListWorkflowDefinition.action", "UTF-8") + "&message=tool.managementtool.deleteWorkflowDefinition.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteWorkflowDefinition"), "tool.managementtool.deleteWorkflowDefinition.header")); 707 return buttons; 708 } 709 710 private List getPortletsButtons() throws Exception 711 { 712 List buttons = new ArrayList (); 713 buttons.add(new ImageButton("UploadPortlet.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newPortlet"), "New Portlet")); 714 return buttons; 716 } 717 718 719 private List getWorkflowDefinitionsButtons() throws Exception 720 { 721 722 List buttons = new ArrayList (); 723 buttons.add(new ImageButton("CreateWorkflowDefinition!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newWorkflowDefinition"), "New WorkflowDefinition")); 724 buttons.add(new ImageButton(true, "javascript:submitListForm('workflowDefinition');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteWorkflowDefinition"), "tool.managementtool.deleteWorkflowDefinitions.header")); 725 return buttons; 726 } 727 728 private List getWorkflowDefinitionDetailsButtons() throws Exception 729 { 730 List buttons = new ArrayList (); 731 this.name = WorkflowDefinitionController.getController().getWorkflowDefinitionVOWithId(this.workflowDefinitionId).getName(); 732 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteWorkflowDefinition.header&yesDestination=" + URLEncoder.encode("DeleteWorkflowDefinition.action?workflowDefinitionId=" + this.workflowDefinitionId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListWorkflowDefinition.action", "UTF-8") + "&message=tool.managementtool.deleteWorkflowDefinition.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteWorkflowDefinition"), "tool.managementtool.deleteWorkflowDefinition.header")); 733 final String protectWorkflows = CmsPropertyHandler.getProtectWorkflows(); 734 if(protectWorkflows != null && protectWorkflows.equalsIgnoreCase("true")) 735 { 736 String returnAddress = URLEncoder.encode(URLEncoder.encode("ViewWorkflowDefinition.action?workflowDefinitionId=" + this.workflowDefinitionId, "UTF-8"), "UTF-8"); 737 final WorkflowDefinitionVO workflowDefinition = WorkflowDefinitionController.getController().getWorkflowDefinitionVOWithId(this.workflowDefinitionId); 738 buttons.add(new ImageButton("ViewAccessRights.action?interceptionPointCategory=Workflow&extraParameters=" + workflowDefinition.getName() +"&colorScheme=ManagementTool&returnAddress=" + returnAddress, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.accessRights"), "tool.managementtool.accessRights.header")); 739 } 740 return buttons; 741 } 742 743 private List getServerNodesButtons() throws Exception 744 { 745 List buttons = new ArrayList (); 746 buttons.add(new ImageButton("CreateServerNode!input.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newServerNode"), "tool.managementtool.createServerNode.header")); 747 buttons.add(new ImageButton(true, "javascript:submitListForm('serverNode');", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteServerNode"), "tool.managementtool.deleteServerNodes.header")); 748 buttons.add(new ImageButton("ViewServerNodeProperties.action?serverNodeId=-1", getLocalizedString(getSession().getLocale(), "images.global.buttons.editProperties"), "Edit Properties", new Integer (22), new Integer (80))); 749 750 return buttons; 751 } 752 753 private List getServerNodeDetailsButtons() throws Exception 754 { 755 List buttons = new ArrayList (); 756 buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteServerNode.header&yesDestination=" + URLEncoder.encode("DeleteServerNode.action?serverNodeId=" + this.serverNodeId, "UTF-8") + "&noDestination=" + URLEncoder.encode("ViewListServerNode.action?title=ServerNodes", "UTF-8") + "&message=tool.managementtool.deleteServerNode.text&extraParameters=" + this.name, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteServerNode"), "tool.managementtool.deleteServerNode.header")); 757 buttons.add(new ImageButton("ViewServerNodeProperties.action?serverNodeId=" + this.serverNodeId, getLocalizedString(getSession().getLocale(), "images.global.buttons.editProperties"), "Edit Properties", new Integer (22), new Integer (80))); 758 759 return buttons; 760 } 761 762 private List getMessageCenterButtons() throws Exception 763 { 764 List buttons = new ArrayList (); 765 buttons.add(new ImageButton("CreateEmail!inputChooseRecipients.action", getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.newEmail"), "tool.managementtool.createEmail.header")); 766 767 return buttons; 768 } 769 770 } 771 | Popular Tags |