fork(5) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12.  
  13. import sailpoint.tools.*;
  14. import sailpoint.tools.xml.*;
  15. import sailpoint.object.Schema;
  16. import sailpoint.connector.Connector;
  17. import sailpoint.connector.DelimitedFileConnector;
  18. import sailpoint.tools.RFC4180LineIterator;
  19. import sailpoint.object.CustomGlobal;
  20. import java.lang.Integer;
  21. import java.lang.String;
  22. import java.lang.Boolean;
  23. import java.util.*;
  24.  
  25. public static HashMap readinVisibleDescriptions()
  26. {
  27. String myfile = "/SailPoint/Data/LPSWebDirectDescriptions.txt";
  28. HashMap profileMap2 = new HashMap();
  29.  
  30. RFC4180LineIterator lines2 = new RFC4180LineIterator(new BufferedReader(new InputStreamReader(bis2)));
  31. if (lines2 != null)
  32. {
  33. String profileLine2 = null;
  34. lines2.readLine();
  35. while ((profileLine2 = lines2.readLine())!= null && profileLine2 != "")
  36. { String[] profileValues= profileLine2.split("\t");
  37. if(!(profileMap2.containsKey(profileValues[0])))
  38. { profileMap2.put(profileValues[0],profileValues[1]);
  39. }
  40. }
  41. }
  42. return profileMap2;
  43. }
  44.  
  45.  
  46. public static HashMap readinDescriptions()
  47. {
  48. String myfile = application.getAttributeValue("referencedescriptionfile");
  49. HashMap profileMap2 = new HashMap();
  50. HashMap visibleDescriptionsMap= new HashMap();
  51. visibleDescriptionsMap = CustomGlobal.get("visibleDescriptionsMap");
  52. RFC4180LineIterator lines2 = new RFC4180LineIterator(new BufferedReader(new InputStreamReader(bis2)));
  53. Application app = context.getObjectByName(Class.forName("sailpoint.object.Application"),application.getAttributeValue("referencefileapplicationame"));
  54. if (lines2 != null)
  55. {
  56. String profileLine2 = null;
  57. lines2.readLine();
  58. while ((profileLine2 = lines2.readLine())!= null && profileLine2 != "")
  59. { profileLine2 = profileLine2.replace("\"", "");
  60. String[] profileValues = profileLine2.split("\\|");
  61. profileMap2.put(profileValues[2],profileValues[3]);
  62. String attributeName = "";
  63. if (newrecord[3].startsWith("BI_") ){
  64. attributeName = "Business Intelligence";
  65. } else if (newrecord[3].startsWith("DLV_") ){
  66. attributeName = "Dynamic Loan View (DLV)";
  67. } else if (newrecord[3].startsWith("eMSP_")){
  68. attributeName = "eMSP";
  69. } else if (newrecord[3].startsWith("SA_")){
  70. attributeName = "Suspense SweepFunds Processing";
  71. } else if (newrecord[3].startsWith("WIT_")) {
  72. attributeName = "WIT";
  73. } else if (newrecord[3].startsWith("PIF_")) {
  74. attributeName = "Paid in Full";
  75. } else if (newrecord[3].startsWith("LWD")) {
  76. attributeName = "LWD Black Knight";
  77. } else {
  78. attributeName = "LWD Role";
  79. }
  80. ManagedAttribute managedAttrExisting = ManagedAttributer.get(context,application.getId(),false, attributeName, profileValues[2]);
  81. ManagedAttribute managedAttr = new ManagedAttribute(app, attributeName, profileValues[2]);
  82. if (managedAttrExisting != null)
  83. { managedAttr = managedAttrExisting;
  84. }
  85. managedAttr.addDescription("en_US", visibleDescriptionsMap(profileValues[2]));
  86. managedAttr.addDescription("Privilege", profileValues[3]);
  87. managedAttr.setDisplayName(profileValues[2]);
  88. managedAttr.setRequestable(false);
  89. managedAttr.setGroup(true);
  90. context.saveObject(managedAttr);
  91. context.commitTransaction();
  92.  
  93. System.out.println("KGP4death got here 2014 before" + profileLine2);
  94.  
  95. }
  96. }
  97. return profileMap2;
  98. }
  99.  
  100.  
  101. //Create uuid to put in Custom Global
  102. String id = application.getId();
  103. Calendar now = Calendar.getInstance();
  104. //int sd = now.get(Calendar.DAY_OF_YEAR);
  105. int sd = now.get(Calendar.MINUTE);
  106. String uuid = id + "_" + sd;
  107. HashMap roleMap = new HashMap();
  108. roleMap = CustomGlobal.get(application.getAttributeValue("referencefiledescriptionsmapname"));
  109.  
  110. //read in the file, create account groups for each group then store in db
  111. //Runs first time. Parses translation table, stores into database
  112. //Runs if CommercialCustomerPortalMap is cleared from CustomGlobal, or its the first time being run, or if data is old
  113. if ((roleMap == null)|| (CustomGlobal.get("uuid") == null) || (!CustomGlobal.get("uuid").equals(uuid)))
  114. { HashMap visibleDescriptionsMap = new HashMap();
  115. visibleDescriptionsMap = readinVisibleDescriptions();
  116. CustomGlobal.put("visibleDescriptionsMap", visibleDescriptionsMap);
  117. roleMap = readinDescriptions();
  118. CustomGlobal.put(application.getAttributeValue("referencefiledescriptionsmapname"), roleMap);
  119. CustomGlobal.put("uuid",uuid);
  120. }
  121.  
  122. HashMap map = new HashMap();
  123. List cols = schema.getAttributeNames();
  124. String GrabledData = record.get(0);
  125. GrabledData = GrabledData.replace("\"", "");
  126. String[] newrecord = GrabledData.split("\\|");
  127. int j = 0;
  128. for (String Xstring : newrecord){
  129. j = j + 1;
  130. }
  131. int i = 0;
  132. if (j == 9){
  133. map.put("User ID", newrecord[1].trim());
  134. if (newrecord[1].trim().length() >= 7) {
  135. map.put("Enumber", newrecord[1].trim().substring(0,7));
  136. } else
  137. { map.put("Enumber", newrecord[1].trim());
  138.  
  139. }
  140. map.put("Name", newrecord[2].trim());
  141. if (newrecord[3].trim() == "") {
  142. } else if (newrecord[3].startsWith("BI_")) {
  143. map.put("Business Intelligence", newrecord[3].trim());
  144. } else if (newrecord[3].startsWith("DLV_")) {
  145. map.put("Dynamic Loan View (DLV)", newrecord[3].trim());
  146. } else if (newrecord[3].startsWith("eMSP_")) {
  147. map.put("eMSP", newrecord[3].trim());
  148. } else if (newrecord[3].startsWith("SA_")) {
  149. map.put("Suspense SweepFunds Processing", newrecord[3].trim());
  150. } else if (newrecord[3].startsWith("WIT_")) {
  151. map.put("WIT", newrecord[3].trim());
  152. } else if (newrecord[3].startsWith("PIF_")) {
  153. map.put("Paid in Full", newrecord[3].trim());
  154. } else if (newrecord[3].startsWith("LWD")) {
  155. map.put("LWD Black Knight", newrecord[3].trim());
  156. } else {
  157. map.put("LWD Role", newrecord[3].trim());
  158. }
  159.  
  160. map.put("Last Account Activity", newrecord[5].trim());
  161. map.put("Last Password Change", newrecord[6].trim());
  162. map.put("Account Creation Date", newrecord[7].trim());
  163. map.put("Status", newrecord[8].trim());
  164.  
  165. if ((newrecord[3].trim() == "") || (newrecord[8].trim() != "Active") || (newrecord[2].trim().contains("DELETED")) || (newrecord[2].trim().contains("DISABLED"))){
  166. map = new HashMap();
  167. }
  168. }
  169.  
  170. return map;
  171.  
  172. }
  173. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:13: error: illegal start of expression
        import sailpoint.tools.*;
        ^
Main.java:13: error: <identifier> expected
        import sailpoint.tools.*;
                               ^
Main.java:13: error: illegal start of expression
        import sailpoint.tools.*;
                                ^
Main.java:14: error: illegal start of expression
        import sailpoint.tools.xml.*;
        ^
Main.java:14: error: <identifier> expected
        import sailpoint.tools.xml.*;
                                   ^
Main.java:14: error: illegal start of expression
        import sailpoint.tools.xml.*;
                                    ^
Main.java:15: error: illegal start of expression
        import sailpoint.object.Schema;
        ^
Main.java:15: error: not a statement
        import sailpoint.object.Schema;
                               ^
Main.java:16: error: illegal start of expression
        import sailpoint.connector.Connector;
        ^
Main.java:16: error: not a statement
        import sailpoint.connector.Connector;
                                  ^
Main.java:17: error: illegal start of expression
        import sailpoint.connector.DelimitedFileConnector;
        ^
Main.java:17: error: not a statement
        import sailpoint.connector.DelimitedFileConnector;
                                  ^
Main.java:18: error: illegal start of expression
        import sailpoint.tools.RFC4180LineIterator;
        ^
Main.java:18: error: not a statement
        import sailpoint.tools.RFC4180LineIterator;
                              ^
Main.java:19: error: illegal start of expression
        import sailpoint.object.CustomGlobal;
        ^
Main.java:19: error: not a statement
        import sailpoint.object.CustomGlobal;
                               ^
Main.java:20: error: illegal start of expression
        import java.lang.Integer;
        ^
Main.java:20: error: not a statement
        import java.lang.Integer;
                        ^
Main.java:21: error: illegal start of expression
        import java.lang.String;
        ^
Main.java:21: error: not a statement
        import java.lang.String;
                        ^
Main.java:22: error: illegal start of expression
        import java.lang.Boolean;
        ^
Main.java:22: error: not a statement
        import java.lang.Boolean;
                        ^
Main.java:23: error: illegal start of expression
        import java.util.*;
        ^
Main.java:23: error: <identifier> expected
        import java.util.*;
                         ^
Main.java:23: error: illegal start of expression
        import java.util.*;
                          ^
Main.java:25: error: illegal start of expression
public static HashMap readinVisibleDescriptions()
^
Main.java:25: error: illegal start of expression
public static HashMap readinVisibleDescriptions()
       ^
Main.java:25: error: ';' expected
public static HashMap readinVisibleDescriptions()
                     ^
Main.java:25: error: ';' expected
public static HashMap readinVisibleDescriptions()
                                                 ^
Main.java:36: error: ')' expected
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                     ^
Main.java:36: error: illegal start of expression
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                      ^
Main.java:36: error: not a statement
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                                         ^
Main.java:36: error: ';' expected
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                                              ^
Main.java:47: error: illegal start of expression
public static HashMap readinDescriptions()
^
Main.java:47: error: illegal start of expression
public static HashMap readinDescriptions()
       ^
Main.java:47: error: ';' expected
public static HashMap readinDescriptions()
                     ^
Main.java:47: error: ';' expected
public static HashMap readinDescriptions()
                                          ^
Main.java:60: error: ')' expected
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                     ^
Main.java:60: error: illegal start of expression
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                      ^
Main.java:60: error: not a statement
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                                         ^
Main.java:60: error: ';' expected
                while ((profileLine2 = lines2.readLine())!= null &amp;&amp; profileLine2 != "")
                                                                                              ^
41 errors
stdout
Standard output is empty