Package org.jabusuite.address.employee.session

Examples of org.jabusuite.address.employee.session.JobGroupsRemote


    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.");
                    }
                }
View Full Code Here


    @Override
    public void doSave() throws EJbsObject {
        logger.debug("Saving data...");
        try {
            JobGroupsRemote jobGroups = (JobGroupsRemote)ClientTools.getRemoteBean(JobGroupsRemote.class);

            super.doSave();

            if (this.getDlgState() == DlgState.dsInsert) {
                logger.debug("Adding new entity");
                jobGroups.createDataset(this.getJobGroup(), ClientGlobals.getUser(), ClientGlobals.getCompany());
            } else if (this.getDlgState() == DlgState.dsEdit) {
                logger.debug("Saving exisiting entity.");
                jobGroups.updateDataset(this.getJobGroup(),ClientGlobals.getUser());
            }
            logger.debug("Entity saved.");

        } catch (NamingException e) {
            logger.error("Error saving entity",e);
View Full Code Here

TOP

Related Classes of org.jabusuite.address.employee.session.JobGroupsRemote

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.