/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
import sailpoint.tools.*;
import sailpoint.tools.xml.*;
import sailpoint.object.Schema;
import sailpoint.connector.Connector;
import sailpoint.connector.DelimitedFileConnector;
import sailpoint.tools.RFC4180LineIterator;
import sailpoint.object.CustomGlobal;
import java.lang.Integer;
import java.lang.String;
import java.lang.Boolean;
import java.util.*;
public static HashMap readinVisibleDescriptions
() {
String myfile
= "/SailPoint/Data/LPSWebDirectDescriptions.txt";
if (lines2 != null)
{
lines2.readLine();
while ((profileLine2 = lines2.readLine())!= null && profileLine2 != "")
{ String[] profileValues
= profileLine2.
split("\t"); if(!(profileMap2.containsKey(profileValues[0])))
{ profileMap2.put(profileValues[0],profileValues[1]);
}
}
}
return profileMap2;
}
public static HashMap readinDescriptions
() {
String myfile
= application.
getAttributeValue("referencedescriptionfile"); visibleDescriptionsMap = CustomGlobal.get("visibleDescriptionsMap");
Application app = context.getObjectByName(Class.forName("sailpoint.object.Application"),application.getAttributeValue("referencefileapplicationame"));
if (lines2 != null)
{
lines2.readLine();
while ((profileLine2 = lines2.readLine())!= null && profileLine2 != "")
{ profileLine2 = profileLine2.replace("\"", "");
String[] profileValues
= profileLine2.
split("\\|"); profileMap2.put(profileValues[2],profileValues[3]);
if (newrecord[3].startsWith("BI_") ){
attributeName = "Business Intelligence";
} else if (newrecord[3].startsWith("DLV_") ){
attributeName = "Dynamic Loan View (DLV)";
} else if (newrecord[3].startsWith("eMSP_")){
attributeName = "eMSP";
} else if (newrecord[3].startsWith("SA_")){
attributeName = "Suspense SweepFunds Processing";
} else if (newrecord[3].startsWith("WIT_")) {
attributeName = "WIT";
} else if (newrecord[3].startsWith("PIF_")) {
attributeName = "Paid in Full";
} else if (newrecord[3].startsWith("LWD")) {
attributeName = "LWD Black Knight";
} else {
attributeName = "LWD Role";
}
ManagedAttribute managedAttrExisting = ManagedAttributer.get(context,application.getId(),false, attributeName, profileValues[2]);
ManagedAttribute managedAttr = new ManagedAttribute(app, attributeName, profileValues[2]);
if (managedAttrExisting != null)
{ managedAttr = managedAttrExisting;
}
managedAttr.addDescription("en_US", visibleDescriptionsMap(profileValues[2]));
managedAttr.addDescription("Privilege", profileValues[3]);
managedAttr.setDisplayName(profileValues[2]);
managedAttr.setRequestable(false);
managedAttr.setGroup(true);
context.saveObject(managedAttr);
context.commitTransaction();
System.
out.
println("KGP4death got here 2014 before" + profileLine2
);
}
}
return profileMap2;
}
//Create uuid to put in Custom Global
String id
= application.
getId(); //int sd = now.get(Calendar.DAY_OF_YEAR);
roleMap = CustomGlobal.get(application.getAttributeValue("referencefiledescriptionsmapname"));
//read in the file, create account groups for each group then store in db
//Runs first time. Parses translation table, stores into database
//Runs if CommercialCustomerPortalMap is cleared from CustomGlobal, or its the first time being run, or if data is old
if ((roleMap == null)|| (CustomGlobal.get("uuid") == null) || (!CustomGlobal.get("uuid").equals(uuid)))
visibleDescriptionsMap = readinVisibleDescriptions();
CustomGlobal.put("visibleDescriptionsMap", visibleDescriptionsMap);
roleMap = readinDescriptions();
CustomGlobal.put(application.getAttributeValue("referencefiledescriptionsmapname"), roleMap);
CustomGlobal.put("uuid",uuid);
}
List cols
= schema.
getAttributeNames(); String GrabledData
= record.
get(0); GrabledData = GrabledData.replace("\"", "");
String[] newrecord
= GrabledData.
split("\\|"); int j = 0;
for (String Xstring
: newrecord
){ j = j + 1;
}
int i = 0;
if (j == 9){
map.put("User ID", newrecord[1].trim());
if (newrecord[1].trim().length() >= 7) {
map.put("Enumber", newrecord[1].trim().substring(0,7));
} else
{ map.put("Enumber", newrecord[1].trim());
}
map.put("Name", newrecord[2].trim());
if (newrecord[3].trim() == "") {
} else if (newrecord[3].startsWith("BI_")) {
map.put("Business Intelligence", newrecord[3].trim());
} else if (newrecord[3].startsWith("DLV_")) {
map.put("Dynamic Loan View (DLV)", newrecord[3].trim());
} else if (newrecord[3].startsWith("eMSP_")) {
map.put("eMSP", newrecord[3].trim());
} else if (newrecord[3].startsWith("SA_")) {
map.put("Suspense SweepFunds Processing", newrecord[3].trim());
} else if (newrecord[3].startsWith("WIT_")) {
map.put("WIT", newrecord[3].trim());
} else if (newrecord[3].startsWith("PIF_")) {
map.put("Paid in Full", newrecord[3].trim());
} else if (newrecord[3].startsWith("LWD")) {
map.put("LWD Black Knight", newrecord[3].trim());
} else {
map.put("LWD Role", newrecord[3].trim());
}
map.put("Last Account Activity", newrecord[5].trim());
map.put("Last Password Change", newrecord[6].trim());
map.put("Account Creation Date", newrecord[7].trim());
map.put("Status", newrecord[8].trim());
if ((newrecord[3].trim() == "") || (newrecord[8].trim() != "Active") || (newrecord[2].trim().contains("DELETED")) || (newrecord[2].trim().contains("DISABLED"))){
}
}
return map;
}
}