Posted By

nazymko on 07/10/13


Tagged


Versions (?)

going to trash


 / Published in: Java
 

It will be deleted... sad

  1. if (TargetObjectType.IT_ASSET_SET.equals(selected.getValue().getType())) {
  2.  
  3. // Check if this IT ASSET contains other selected elements
  4. hasCheckedChilds(selected);
  5. hasChild(selected);
  6.  
  7.  
  8. Collection<DataListItem<BaseDataItem>> checkedChildren = selected.getCheckedChildren();
  9. if (checkedChildren.size() > 0) {
  10. //Okay, only chosen , it must be TOs
  11. for (DataListItem<BaseDataItem> checkedChild : checkedChildren) {
  12. isChildrenIsModule(checkedChildren);
  13.  
  14. //It must be modules for displaying
  15. if (checkedChild.getCheckedChildren().size() > 0) {
  16. //Add only checked
  17. Collection<DataListItem<BaseDataItem>> checkedModules = checkedChild.getCheckedChildren();
  18. addNodesToReport(instance, toList, result, modules, checkedModules);
  19. } else {
  20. //Add all
  21. Collection<DataListItem<BaseDataItem>> allChildren = checkedChild.getAllChildren();
  22. addNodesToReport(instance, toList, result, modules, allChildren);
  23. }
  24. }
  25.  
  26.  
  27. } else {
  28. //Add to the report all children
  29. //It is TOs
  30. Collection<DataListItem<BaseDataItem>> allChildren = selected.getAllChildren();
  31.  
  32. for (DataListItem<BaseDataItem> child : allChildren) {
  33. if (UserReportDataListItemFactory.FOLDER_FOR_IC_MODULES.equals(child.getValue().getType())) {
  34. //It is modules (name of this component is Universal applicable aspect)
  35. Collection<DataListItem<BaseDataItem>> modulesFromAspect = child.getAllChildren();
  36. addNodesToReport(instance, toList, result, modules, modulesFromAspect);
  37. } else {
  38. //It TOs with children which must be added in the report
  39. Collection<DataListItem<BaseDataItem>> allChildren1 = child.getAllChildren();
  40. for (DataListItem<BaseDataItem> TO : allChildren1) {
  41. Collection<DataListItem<BaseDataItem>> modulesFromTO = TO.getAllChildren();
  42. addNodesToReport(instance, toList, result, modules, modulesFromTO);
  43. }
  44. }
  45. }
  46.  
  47. }
  48. } else if (UserReportDataListItemFactory.FOLDER_FOR_IC_MODULES.equals(selected.getValue().getType())) {
  49. //Add selected element from Universal applicable aspect
  50. if (selected.getCheckedChildren().size() > 0) {
  51. addNodesToReport(instance, toList, result, modules, selected.getCheckedChildren());
  52. } else {
  53. //All from aspect
  54. addNodesToReport(instance, toList, result, modules, selected.getAllChildren());
  55. }
  56. } else if (ModuleBaseDataItem.TYPE_MODULE.equals(selected.getValue().getType())) {
  57. //It is module
  58. ArrayList<DataListItem<BaseDataItem>> modulesSelectedByUser = new ArrayList<DataListItem<BaseDataItem>>();
  59. modulesSelectedByUser.add(selected);
  60. addNodesToReport(instance, toList, result, modules, modulesSelectedByUser);
  61. } else {
  62. //In this case it is TO
  63. if (selected.getCheckedChildren().size() > 0) {
  64. for (DataListItem<BaseDataItem> baseDataItemDataListItem : selected.getCheckedChildren()) {
  65. if (baseDataItemDataListItem.getCheckedChildren().size() > 0) {
  66. addNodesToReport(instance, toList, result, modules, baseDataItemDataListItem.getCheckedChildren());
  67. } else {
  68. addNodesToReport(instance, toList, result, modules, baseDataItemDataListItem.getAllChildren());
  69. }
  70. }
  71. } else {
  72. for (DataListItem<BaseDataItem> baseDataItemDataListItem : selected.getAllChildren()) {
  73. if (baseDataItemDataListItem.getCheckedChildren().size() > 0) {
  74. addNodesToReport(instance, toList, result, modules, baseDataItemDataListItem.getCheckedChildren());
  75. } else {
  76. addNodesToReport(instance, toList, result, modules, baseDataItemDataListItem.getAllChildren());
  77. }
  78. }
  79. }
  80. }
  81. }

Report this snippet  

You need to login to post a comment.