Example usage for javax.ejb TransactionAttributeType REQUIRED

List of usage examples for javax.ejb TransactionAttributeType REQUIRED

Introduction

In this page you can find the example usage for javax.ejb TransactionAttributeType REQUIRED.

Prototype

TransactionAttributeType REQUIRED

To view the source code for javax.ejb TransactionAttributeType REQUIRED.

Click Source Link

Document

If a client invokes the enterprise bean's method while the client is associated with a transaction context, the container invokes the enterprise bean's method in the client's transaction context.

Usage

From source file:com.sfs.ucm.controller.SpecificationAction.java

/**
 * Add action//from w  w w .  j  a  v  a2  s  .c  om
 * 
 * @return outcome
 */
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void add() {
    this.specification = new Specification(ModelUtils.getNextIdentifier(this.specifications));
}

From source file:com.sfs.ucm.controller.ProjectPackageAction.java

/**
 * save action//  w w  w  .j a va  2s.  c  o  m
 * 
 * @throws UCMException
 */
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void save() throws UCMException {
    try {
        if (validate()) {
            if (this.projectPackage.getId() == null) {
                this.project.addProjectPackage(this.projectPackage);
            }

            try {
                em.persist(this.project);
            } catch (javax.ejb.EJBException e) {
                if (e.getCausedByException().equals(OptimisticLockException.class)) {
                    logger.error("OptimisticLockException {}", e.getMessage());
                    this.facesContextMessage.warningMessage("Another user is modifying this Artifact");
                }
                throw new UCMException(e);
            }

            logger.info("saved {}", this.projectPackage.getName());
            this.facesContextMessage.infoMessage("{0} saved successfully",
                    StringUtils.abbreviate(this.projectPackage.getName(), 25));

            // refresh list
            loadList();
            this.selected = true;
        }
    } catch (Exception e) {
        throw new UCMException(e);
    }
}

From source file:fr.ortolang.diffusion.bootstrap.BootstrapServiceBean.java

@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void bootstrap() throws BootstrapServiceException {
    LOGGER.log(Level.INFO, "Starting bootstrap...");

    Map<String, List<String>> anonReadRules = new HashMap<String, List<String>>();
    anonReadRules.put(MembershipService.UNAUTHENTIFIED_IDENTIFIER, Collections.singletonList("read"));

    try {//  ww  w.  j  a v  a  2  s .co  m

        if (!registry.exists(MembershipService.SUPERUSER_IDENTIFIER)) {
            LOGGER.log(Level.FINE, "creating root profile");
            membership.createProfile(MembershipService.SUPERUSER_IDENTIFIER, "Super", "User",
                    "root@ortolang.org", ProfileStatus.ACTIVE);
        }

        if (!registry.exists(MembershipService.UNAUTHENTIFIED_IDENTIFIER)) {
            LOGGER.log(Level.FINE, "creating anonymous profile");
            membership.createProfile(MembershipService.UNAUTHENTIFIED_IDENTIFIER, "Anonymous", "User",
                    "anon@ortolang.org", ProfileStatus.ACTIVE);
            LOGGER.log(Level.FINE, "change owner of anonymous profile to root and set anon read rules");
            authorisation.updatePolicyOwner(MembershipService.UNAUTHENTIFIED_IDENTIFIER,
                    MembershipService.SUPERUSER_IDENTIFIER);
            authorisation.setPolicyRules(MembershipService.UNAUTHENTIFIED_IDENTIFIER, anonReadRules);
        }

        if (!registry.exists(MembershipService.MODERATORS_GROUP_KEY)) {
            LOGGER.log(Level.FINE, "creating moderators group");
            membership.createGroup(MembershipService.MODERATORS_GROUP_KEY, "Publication Moderators",
                    "Moderators of the platform check technical aspect of publication");
            membership.addMemberInGroup(MembershipService.MODERATORS_GROUP_KEY,
                    MembershipService.SUPERUSER_IDENTIFIER);
            authorisation.setPolicyRules(MembershipService.MODERATORS_GROUP_KEY, anonReadRules);
        }

        if (!registry.exists(MembershipService.PUBLISHERS_GROUP_KEY)) {
            LOGGER.log(Level.FINE, "creating publishers group");
            membership.createGroup(MembershipService.PUBLISHERS_GROUP_KEY, "Publishers",
                    "Publishers of the platform validates final publication");
            membership.addMemberInGroup(MembershipService.PUBLISHERS_GROUP_KEY,
                    MembershipService.SUPERUSER_IDENTIFIER);
            authorisation.setPolicyRules(MembershipService.PUBLISHERS_GROUP_KEY, anonReadRules);
        }

        if (!registry.exists(MembershipService.REVIEWERS_GROUP_KEY)) {
            LOGGER.log(Level.FINE, "creating reviewers group");
            membership.createGroup(MembershipService.REVIEWERS_GROUP_KEY, "Reviewers",
                    "Reviewers of the platform rate content");
            membership.addMemberInGroup(MembershipService.REVIEWERS_GROUP_KEY,
                    MembershipService.SUPERUSER_IDENTIFIER);
            authorisation.setPolicyRules(MembershipService.REVIEWERS_GROUP_KEY, anonReadRules);
        }

        if (!registry.exists(MembershipService.ESR_GROUP_KEY)) {
            LOGGER.log(Level.FINE, "creating esr group");
            membership.createGroup(MembershipService.ESR_GROUP_KEY, "ESR Members",
                    "People from Superior Teaching and Research Group");
            authorisation.setPolicyRules(MembershipService.ESR_GROUP_KEY, anonReadRules);
        }

        if (!registry.exists(MembershipService.ADMINS_GROUP_KEY)) {
            LOGGER.log(Level.FINE, "creating admins group");
            membership.createGroup(MembershipService.ADMINS_GROUP_KEY, "Administrators",
                    "Administrators of the platform");
            authorisation.setPolicyRules(MembershipService.ADMINS_GROUP_KEY, anonReadRules);
        }

        if (!registry.exists(BootstrapService.WORKSPACE_KEY)) {
            LOGGER.log(Level.FINE, "create system workspace");
            core.createWorkspace(BootstrapService.WORKSPACE_KEY, "system", "System Workspace",
                    WorkspaceType.SYSTEM.toString());
            Properties props = new Properties();
            props.setProperty("bootstrap.status", "done");
            props.setProperty("bootstrap.timestamp", System.currentTimeMillis() + "");
            props.setProperty("bootstrap.version", BootstrapService.VERSION);
            String hash = core.put(new ByteArrayInputStream(props.toString().getBytes()));
            core.createDataObject(BootstrapService.WORKSPACE_KEY, "/bootstrap.txt", hash);
        }

        if (!authorisation.isPolicyTemplateExists(AuthorisationPolicyTemplate.DEFAULT)) {
            LOGGER.log(Level.FINE,
                    "create [" + AuthorisationPolicyTemplate.DEFAULT + "] authorisation policy template");
            String pid = UUID.randomUUID().toString();
            authorisation.createPolicy(pid, MembershipService.SUPERUSER_IDENTIFIER);
            Map<String, List<String>> defaultPolicyRules = new HashMap<String, List<String>>();
            defaultPolicyRules.put(MembershipService.UNAUTHENTIFIED_IDENTIFIER,
                    Arrays.asList("read", "download"));
            authorisation.setPolicyRules(pid, defaultPolicyRules);
            authorisation.createPolicyTemplate(AuthorisationPolicyTemplate.DEFAULT,
                    "Default template allows all users to read and download content", pid);
        }

        if (!authorisation.isPolicyTemplateExists(AuthorisationPolicyTemplate.FORALL)) {
            LOGGER.log(Level.FINE,
                    "create [" + AuthorisationPolicyTemplate.FORALL + "] authorisation policy template");
            String pid = UUID.randomUUID().toString();
            authorisation.createPolicy(pid, MembershipService.SUPERUSER_IDENTIFIER);
            Map<String, List<String>> forallPolicyRules = new HashMap<String, List<String>>();
            forallPolicyRules.put(MembershipService.UNAUTHENTIFIED_IDENTIFIER,
                    Arrays.asList("read", "download"));
            authorisation.setPolicyRules(pid, forallPolicyRules);
            authorisation.createPolicyTemplate(AuthorisationPolicyTemplate.FORALL,
                    "All users can read and download this content", pid);
        }

        if (!authorisation.isPolicyTemplateExists(AuthorisationPolicyTemplate.AUTHENTIFIED)) {
            LOGGER.log(Level.FINE,
                    "create [" + AuthorisationPolicyTemplate.AUTHENTIFIED + "] authorisation policy template");
            String pid = UUID.randomUUID().toString();
            authorisation.createPolicy(pid, MembershipService.SUPERUSER_IDENTIFIER);
            Map<String, List<String>> authentifiedPolicyRules = new HashMap<String, List<String>>();
            authentifiedPolicyRules.put(MembershipService.UNAUTHENTIFIED_IDENTIFIER,
                    Collections.singletonList("read"));
            authentifiedPolicyRules.put(MembershipService.ALL_AUTHENTIFIED_GROUP_KEY,
                    Arrays.asList("read", "download"));
            authorisation.setPolicyRules(pid, authentifiedPolicyRules);
            authorisation.createPolicyTemplate(AuthorisationPolicyTemplate.AUTHENTIFIED,
                    "All users can read this content but download is restricted to authentified users only",
                    pid);
        }

        if (!authorisation.isPolicyTemplateExists(AuthorisationPolicyTemplate.ESR)) {
            LOGGER.log(Level.FINE,
                    "create [" + AuthorisationPolicyTemplate.ESR + "] authorisation policy template");
            String pid = UUID.randomUUID().toString();
            authorisation.createPolicy(pid, MembershipService.SUPERUSER_IDENTIFIER);
            Map<String, List<String>> esrPolicyRules = new HashMap<String, List<String>>();
            esrPolicyRules.put(MembershipService.UNAUTHENTIFIED_IDENTIFIER, Collections.singletonList("read"));
            esrPolicyRules.put(MembershipService.ESR_GROUP_KEY, Arrays.asList("read", "download"));
            esrPolicyRules.put("${workspace.privileged}", Arrays.asList("read", "download"));
            authorisation.setPolicyRules(pid, esrPolicyRules);
            authorisation.createPolicyTemplate(AuthorisationPolicyTemplate.ESR,
                    "All users can read this content but download is restricted to ESR users only", pid);
        }

        if (!authorisation.isPolicyTemplateExists(AuthorisationPolicyTemplate.PRIVILEGED)) {
            LOGGER.log(Level.FINE,
                    "create [" + AuthorisationPolicyTemplate.PRIVILEGED + "] authorisation policy template");
            String pid = UUID.randomUUID().toString();
            authorisation.createPolicy(pid, MembershipService.SUPERUSER_IDENTIFIER);
            Map<String, List<String>> privilegedPolicyRules = new HashMap<String, List<String>>();
            privilegedPolicyRules.put(MembershipService.UNAUTHENTIFIED_IDENTIFIER,
                    Collections.singletonList("read"));
            privilegedPolicyRules.put(MembershipService.ESR_GROUP_KEY, Collections.singletonList("read"));
            privilegedPolicyRules.put("${workspace.privileged}", Arrays.asList("read", "download"));
            authorisation.setPolicyRules(pid, privilegedPolicyRules);
            authorisation.createPolicyTemplate(AuthorisationPolicyTemplate.PRIVILEGED,
                    "Only privileged users can read and download this content", pid);
        }

        if (!authorisation.isPolicyTemplateExists(AuthorisationPolicyTemplate.RESTRICTED)) {
            LOGGER.log(Level.FINE,
                    "create [" + AuthorisationPolicyTemplate.RESTRICTED + "] authorisation policy template");
            String pid = UUID.randomUUID().toString();
            authorisation.createPolicy(pid, MembershipService.SUPERUSER_IDENTIFIER);
            Map<String, List<String>> restrictedPolicyRules = new HashMap<String, List<String>>();
            restrictedPolicyRules.put("${workspace.members}", Arrays.asList("read", "download"));
            authorisation.setPolicyRules(pid, restrictedPolicyRules);
            authorisation.createPolicyTemplate(AuthorisationPolicyTemplate.RESTRICTED,
                    "Only workspace members can read and download this content, all other users cannot see this content",
                    pid);
        }

        InputStream is = getClass().getClassLoader()
                .getResourceAsStream("forms/" + FormService.IMPORT_ZIP_FORM + ".json");
        String json = IOUtils.toString(is, "UTF-8");
        if (!registry.exists(FormService.IMPORT_ZIP_FORM)) {
            LOGGER.log(Level.FINE, "create form : " + FormService.IMPORT_ZIP_FORM);
            form.createForm(FormService.IMPORT_ZIP_FORM, "Import Zip Process Start Form", json);
        } else {
            LOGGER.log(Level.FINE, "update form : " + FormService.IMPORT_ZIP_FORM);
            form.updateForm(FormService.IMPORT_ZIP_FORM, "Import Zip Process Start Form", json);
        }
        is.close();

        is = getClass().getClassLoader()
                .getResourceAsStream("forms/" + FormService.REVIEW_SNAPSHOT_FORM + ".json");
        json = IOUtils.toString(is, "UTF-8");
        if (!registry.exists(FormService.REVIEW_SNAPSHOT_FORM)) {
            LOGGER.log(Level.FINE, "create form : " + FormService.REVIEW_SNAPSHOT_FORM);
            form.createForm(FormService.REVIEW_SNAPSHOT_FORM, "Workspace publication's review form", json);
        } else {
            LOGGER.log(Level.FINE, "update form : " + FormService.REVIEW_SNAPSHOT_FORM);
            form.updateForm(FormService.REVIEW_SNAPSHOT_FORM, "Workspace publication's review form", json);
        }
        is.close();

        is = getClass().getClassLoader()
                .getResourceAsStream("forms/" + FormService.MODERATE_SNAPSHOT_FORM + ".json");
        json = IOUtils.toString(is, "UTF-8");
        if (!registry.exists(FormService.MODERATE_SNAPSHOT_FORM)) {
            LOGGER.log(Level.FINE, "create form : " + FormService.MODERATE_SNAPSHOT_FORM);
            form.createForm(FormService.MODERATE_SNAPSHOT_FORM, "Workspace publication's moderation form",
                    json);
        } else {
            LOGGER.log(Level.FINE, "update form : " + FormService.MODERATE_SNAPSHOT_FORM);
            form.updateForm(FormService.MODERATE_SNAPSHOT_FORM, "Workspace publication's moderation form",
                    json);
        }
        is.close();

        is = getClass().getClassLoader()
                .getResourceAsStream("forms/" + FormService.PUBLISH_SNAPSHOT_FORM + ".json");
        json = IOUtils.toString(is, "UTF-8");
        if (!registry.exists(FormService.PUBLISH_SNAPSHOT_FORM)) {
            LOGGER.log(Level.FINE, "create form : " + FormService.PUBLISH_SNAPSHOT_FORM);
            form.createForm(FormService.PUBLISH_SNAPSHOT_FORM, "Workspace publication's form", json);
        } else {
            LOGGER.log(Level.FINE, "update form : " + FormService.MODERATE_SNAPSHOT_FORM);
            form.updateForm(FormService.PUBLISH_SNAPSHOT_FORM, "Workspace publication's form", json);
        }
        is.close();

        is = getClass().getClassLoader().getResourceAsStream("forms/" + FormService.ITEM_FORM + ".json");
        json = IOUtils.toString(is, "UTF-8");
        if (!registry.exists(FormService.ITEM_FORM)) {
            LOGGER.log(Level.FINE, "create form : " + FormService.ITEM_FORM);
            form.createForm(FormService.ITEM_FORM, "Schema Form for an ORTOLANG item", json);
        } else {
            LOGGER.log(Level.FINE, "update form : " + FormService.ITEM_FORM);
            form.updateForm(FormService.ITEM_FORM, "Schema Form for an ORTOLANG item", json);
        }
        is.close();

        LOGGER.log(Level.FINE, "import metadataformat schemas");
        InputStream schemaItemInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/ortolang-item-schema-0.16-with-parts.json");
        String schemaItemHash = core.put(schemaItemInputStream);
        core.createMetadataFormat(MetadataFormat.ITEM,
                "Les mtadonnes de prsentation permettent de paramtrer l\'affichage de la ressource dans la partie consultation du site. Nouvelle fonctionnalit : les sous-parties.",
                schemaItemHash, "ortolang-item-form", true, true);

        InputStream schemaInputStream2 = getClass().getClassLoader()
                .getResourceAsStream("schema/ortolang-acl-schema.json");
        String schemaHash2 = core.put(schemaInputStream2);
        core.createMetadataFormat(MetadataFormat.ACL,
                "Les mtadonnes de contrle d'accs permettent de paramtrer la visibilit d'une ressource lors de sa publication.",
                schemaHash2, "", true, false);

        InputStream schemaWorkspaceInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/ortolang-workspace-schema.json");
        String schemaWorkspaceHash = core.put(schemaWorkspaceInputStream);
        core.createMetadataFormat(MetadataFormat.WORKSPACE,
                "Les mtadonnes associes  un espace de travail.", schemaWorkspaceHash, "", true, true);

        InputStream schemaPidInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/ortolang-pid-schema.json");
        String schemaPidHash = core.put(schemaPidInputStream);
        core.createMetadataFormat(MetadataFormat.PID, "Les mtadonnes associes aux pids d'un object.",
                schemaPidHash, "", true, false);

        InputStream schemaThumbInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/ortolang-thumb-schema.json");
        String schemaThumbHash = core.put(schemaThumbInputStream);
        core.createMetadataFormat(MetadataFormat.THUMB, "Schema for ORTOLANG objects thumbnail",
                schemaThumbHash, "", false, false);

        InputStream schemaTemplateInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/ortolang-template-schema.json");
        String schemaTemplateHash = core.put(schemaTemplateInputStream);
        core.createMetadataFormat(MetadataFormat.TEMPLATE, "Schema for ORTOLANG collection template",
                schemaTemplateHash, "", false, false);

        InputStream schemaTrustRankInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-trustrank-schema.json");
        String schemaTrustRankHash = core.put(schemaTrustRankInputStream);
        core.createMetadataFormat(MetadataFormat.TRUSTRANK, "Schema for applying a trusted notation on item",
                schemaTrustRankHash, "", true, true);

        InputStream schemaRatingInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-rating-schema.json");
        String schemaRatingHash = core.put(schemaRatingInputStream);
        core.createMetadataFormat(MetadataFormat.RATING, "Schema for applying a rating on item",
                schemaRatingHash, "", true, true);

        InputStream schemaAudioInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-audio.json");
        String schemaAudioHash = core.put(schemaAudioInputStream);
        core.createMetadataFormat(MetadataFormat.AUDIO, "Schema for ORTOLANG audio metadata", schemaAudioHash,
                "", false, false);

        InputStream schemaVideoInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-video.json");
        String schemaVideoHash = core.put(schemaVideoInputStream);
        core.createMetadataFormat(MetadataFormat.VIDEO, "Schema for ORTOLANG video metadata", schemaVideoHash,
                "", false, false);

        InputStream schemaImageInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-image.json");
        String schemaImageHash = core.put(schemaImageInputStream);
        core.createMetadataFormat(MetadataFormat.IMAGE, "Schema for ORTOLANG image metadata", schemaImageHash,
                "", false, false);

        InputStream schemaXMLInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-xml.json");
        String schemaXmlHash = core.put(schemaXMLInputStream);
        core.createMetadataFormat(MetadataFormat.XML, "Schema for ORTOLANG XML metadata", schemaXmlHash, "",
                false, false);

        InputStream schemaPDFInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-pdf.json");
        String schemaPDFHash = core.put(schemaPDFInputStream);
        core.createMetadataFormat(MetadataFormat.PDF, "Schema for ORTOLANG PDF metadata", schemaPDFHash, "",
                false, false);

        InputStream schemaTextInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-text.json");
        String schemaTextHash = core.put(schemaTextInputStream);
        core.createMetadataFormat(MetadataFormat.TEXT, "Schema for ORTOLANG text metadata", schemaTextHash, "",
                false, false);

        InputStream schemaOfficeInputStream = getClass().getClassLoader()
                .getResourceAsStream("schema/system-x-office.json");
        String schemaOfficeHash = core.put(schemaOfficeInputStream);
        core.createMetadataFormat(MetadataFormat.OFFICE, "Schema for ORTOLANG Office metadata",
                schemaOfficeHash, "", false, false);

        loadMetadataFormat(MetadataFormat.OAI_DC, "Schema for Dublin Core elements in JSON format", "", true,
                true);
        loadMetadataFormat(MetadataFormat.OLAC, "Schema for OLAC elements in JSON format", "", true, true);
        loadMetadataFormat(MetadataFormat.TCOF, "Schema for TCOF elements in JSON format", "", true, true);

        LOGGER.log(Level.INFO, "reimport process types");
        runtime.importProcessTypes();

    } catch (Exception e) {
        LOGGER.log(Level.SEVERE, "error during bootstrap", e);
        throw new BootstrapServiceException("error during bootstrap", e);
    }

}

From source file:com.flexive.ejb.beans.search.SearchEngineBean.java

/**
 * {@inheritDoc}// w  w  w. j a v  a 2  s  . c  o  m
 */
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public QueryRootNode load(ResultLocation location, String name) throws FxApplicationException {
    return check(configuration.get(getConfigurationParameter(location), name));
}

From source file:com.sfs.ucm.controller.SpecificationAction.java

/**
 * Add business rule action//from  w  ww. j a v a2s . c om
 * 
 * @return outcome
 */
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void addBusinessRule() {
    Long cnt = getSpecificationRuleCount();
    this.specificationRule = new SpecificationRule(cnt.intValue() + 1);
}

From source file:be.fedict.trust.service.bean.TrustServiceBean.java

@TransactionAttribute(TransactionAttributeType.REQUIRED)
@SNMP(oid = SnmpConstants.VALIDATE)//from  w ww . j  a  v a2s.  co  m
public ValidationResult validate(String trustDomainName, List<X509Certificate> certificateChain,
        boolean returnRevocationData) throws TrustDomainNotFoundException {

    if (null == certificateChain) {
        throw new IllegalArgumentException("certificate chain should not be null");
    }
    for (X509Certificate certificate : certificateChain) {
        if (null == certificate) {
            throw new IllegalArgumentException("certificate chain entry should not be null");
        }
    }
    LOG.debug("isValid: " + certificateChain.get(0).getSubjectX500Principal());

    TrustLinkerResult lastResult = null;
    RevocationData lastRevocationData = null;
    for (TrustDomainEntity trustDomain : getTrustDomains(trustDomainName)) {

        TrustValidator trustValidator = getTrustValidator(trustDomain, returnRevocationData);
        try {
            trustValidator.isTrusted(certificateChain);
        } catch (CertPathValidatorException ignored) {
            LOG.debug("cert path validation error: " + ignored.getMessage(), ignored);
        }

        if (trustValidator.getResult().isValid()) {
            LOG.debug("valid for trust domain: " + trustDomain.getName());
            harvest(trustDomain, certificateChain);
            return new ValidationResult(trustValidator.getResult(), trustValidator.getRevocationData());
        }

        lastResult = trustValidator.getResult();
        lastRevocationData = trustValidator.getRevocationData();
    }

    return new ValidationResult(lastResult, lastRevocationData);
}

From source file:com.sfs.ucm.controller.HelpContentAction.java

/**
 * File Upload Handler//ww w .  j ava  2 s  .co m
 * 
 * @param event
 * @throws UCMException
 */
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void handleHelpContentUpload(FileUploadEvent event) throws UCMException {

    try {
        extractHelpContent(event.getFile().getContents());

        updateProducer();

        logger.info("Help Content File {} uploaded successfully", event.getFile().getFileName());
        facesContextMessage.infoMessage("importMessages", "Help Content File {0} uploaded successfully",
                event.getFile().getFileName());

        // refresh list
        loadList();
    } catch (UCMException e) {
        logger.error("An error occurred importing help content {}", e.getMessage());
        throw new UCMException("An error occurred importing help content" + e.getMessage());
    }
}

From source file:com.sfs.ucm.controller.UseCaseFlowAction.java

/**
 * Add basic flow step//from  w w  w  . jav a2s .c  om
 * 
 * @throws UCMException
 */
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void addFlowStep() throws UCMException {
    try {
        Integer stepNumber = this.useCase.getBasicFlow().getFlowSteps().size() + 1;
        this.basicFlowStep = new FlowStep(stepNumber.shortValue());

        if (stepNumber.intValue() % 2 == 0) {
            // test for previous actor
        } else {
            // system is actor for odd numbered steps
            Actor system = this.projectService.findSystemActor(this.project);
            this.basicFlowStep.setActor(system);
        }
    } catch (Exception e) {
        throw new UCMException(e);
    }
}

From source file:gov.medicaid.screening.dao.impl.OIGDAOBean.java

/**
 * Verifies SSN if valid.//  www  .j  a v a  2 s.co  m
 *
 * @param entityId the entity id
 * @param ssn the ssn
 * @return true if valid, false if not
 * @throws ParsingException if any parsing errors are encountered
 * @throws ServiceException for any other exceptions encountered
 *
 * @deprecated not updated in new site layout.
 */
@TransactionAttribute(TransactionAttributeType.REQUIRED)
@Deprecated
public boolean verifySSN(String entityId, String ssn) throws ParsingException, ServiceException {
    String signature = "OIGDataAccessImpl#verifySSN";
    LogUtil.traceEntry(getLog(), signature, new String[] { "entityId", "ssn" }, new Object[] { entityId, ssn });

    if (Util.isBlank(entityId) && Util.isBlank(ssn)) {
        throw new ServiceException(ErrorCode.MITA10005.getDesc());
    }

    try {
        return LogUtil.traceExit(getLog(), signature, checkSSN(entityId, ssn));
    } catch (ClientProtocolException e) {
        LogUtil.traceError(getLog(), signature, e);
        throw new ServiceException(ErrorCode.MITA50001.getDesc(), e);
    } catch (IOException e) {
        LogUtil.traceError(getLog(), signature, e);
        throw new ServiceException(ErrorCode.MITA50001.getDesc(), e);
    }
}

From source file:com.flexive.ejb.beans.structure.TypeEngineBean.java

/**
 * {@inheritDoc}/* w  w w.  ja v  a  2s .  co  m*/
 */
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public long save(FxTypeEdit type) throws FxApplicationException {
    if (type.isNew())
        return this.create(type);
    return this.update(type);
}