Search in sources :

Example 1 with BaseValueObject

use of ubic.gemma.model.BaseValueObject in project Gemma by PavlidisLab.

the class DiffExMetaAnalyzerController method findDetailMetaAnalysisById.

public BaseValueObject findDetailMetaAnalysisById(Long id) {
    BaseValueObject baseValueObject = new BaseValueObject();
    try {
        GeneDifferentialExpressionMetaAnalysisDetailValueObject analysisVO = this.geneDiffExMetaAnalysisHelperService.findDetailMetaAnalysisById(id);
        if (analysisVO == null) {
            baseValueObject.setErrorFound(true);
            baseValueObject.setObjectAlreadyRemoved(true);
        } else {
            baseValueObject.setValueObject(analysisVO);
        }
    } catch (Throwable throwable) {
        log.error(throwable.getMessage(), throwable);
        baseValueObject = generateBaseValueObject(throwable);
    }
    return baseValueObject;
}
Also used : BaseValueObject(ubic.gemma.model.BaseValueObject) GeneDifferentialExpressionMetaAnalysisDetailValueObject(ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysisDetailValueObject)

Example 2 with BaseValueObject

use of ubic.gemma.model.BaseValueObject in project Gemma by PavlidisLab.

the class DiffExMetaAnalyzerController method generateBaseValueObject.

private BaseValueObject generateBaseValueObject(Throwable throwable) {
    final BaseValueObject baseValueObject = new BaseValueObject();
    baseValueObject.setErrorFound(true);
    if (throwable instanceof AccessDeniedException) {
        if (this.userManager.loggedIn()) {
            baseValueObject.setAccessDenied(true);
        } else {
            baseValueObject.setUserNotLoggedIn(true);
        }
    } else {
        // If type of throwable is not known, log it.
        log.error(throwable.getMessage(), throwable);
    }
    return baseValueObject;
}
Also used : AccessDeniedException(org.springframework.security.access.AccessDeniedException) BaseValueObject(ubic.gemma.model.BaseValueObject)

Example 3 with BaseValueObject

use of ubic.gemma.model.BaseValueObject in project Gemma by PavlidisLab.

the class GeneDiffExMetaAnalysisServiceImpl method delete.

@Override
@Transactional
public BaseValueObject delete(Long id) {
    GeneDifferentialExpressionMetaAnalysis metaAnalysis = this.load(id);
    BaseValueObject baseValueObject = new BaseValueObject();
    if (metaAnalysis == null) {
        baseValueObject.setErrorFound(true);
        baseValueObject.setObjectAlreadyRemoved(true);
    } else {
        this.remove(metaAnalysis);
    }
    return baseValueObject;
}
Also used : BaseValueObject(ubic.gemma.model.BaseValueObject) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

BaseValueObject (ubic.gemma.model.BaseValueObject)3 AccessDeniedException (org.springframework.security.access.AccessDeniedException)1 Transactional (org.springframework.transaction.annotation.Transactional)1 GeneDifferentialExpressionMetaAnalysisDetailValueObject (ubic.gemma.model.analysis.expression.diff.GeneDifferentialExpressionMetaAnalysisDetailValueObject)1