protected void importJobs(String fileName) {
try {
JbsUserGroupsRemote userGroups = (JbsUserGroupsRemote)ClientTools.getRemoteBean(JbsUserGroupsRemote.class);
JbsUserGroup group = userGroups.findGroup("users");
JobGroupsRemote jobGroups = (JobGroupsRemote)ClientTools.getRemoteBean(JobGroupsRemote.class);
BufferedReader in = new BufferedReader(new FileReader(fileName));
String zeile = null;
while ((zeile = in.readLine()) != null) {
if (zeile.startsWith("<a href=\"/berufe")) {
String jobName = getJobName(zeile);
JobGroup jobGroup = new JobGroup();
jobGroup.setName(ClientGlobals.getMainDbLanguage(), jobName);
try {
long groupCount = jobGroups.getDatasetCount("UPPER(n.name) LIKE '"+jobName.toUpperCase()+"'", ClientGlobals.getUser(), ClientGlobals.getCompany());
if (groupCount==0) {
logger.info(jobName);
jobGroups.createDataset(jobGroup, ClientGlobals.getUser(), group, ClientGlobals.getCompany());
}
} catch (Exception e) {
logger.warn("Job \""+jobName+"\" not added due to errors withe the name.");
}
}