当前位置: 首页>>代码示例>>Java>>正文


Java Utilities.unmarshallObject方法代码示例

本文整理汇总了Java中framework.utils.Utilities.unmarshallObject方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.unmarshallObject方法的具体用法?Java Utilities.unmarshallObject怎么用?Java Utilities.unmarshallObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在framework.utils.Utilities的用法示例。


在下文中一共展示了Utilities.unmarshallObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reload

import framework.utils.Utilities; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
/**
 * Reload the audit configuration
 */
public synchronized void reload() {
    synchronized (this.auditableEntities) {
        this.auditableEntities.clear();
        try {
            File auditableEntitiesFile = new File(getAuditableEntitiesFilePath());
            if (!auditableEntitiesFile.exists() || !auditableEntitiesFile.isFile()) {
                log.warn("Auditable entities file " + auditableEntitiesFilePath + " not found, will be created next time an item is edited");
                return;
            }
            byte[] data = FileUtils.readFileToByteArray(auditableEntitiesFile);
            Map<String, Boolean> temp = (Map<String, Boolean>) Utilities.unmarshallObject(data);
            this.auditableEntities.putAll(temp);
        } catch (Exception e) {
            log.error("Exception while reading the auditable entities file", e);
        }
    }
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:23,代码来源:AuditLoggerServiceImpl.java

示例2: getStructuredDocumentAttachmentContent

import framework.utils.Utilities; //导入方法依赖的package包/类
@Override
public Object getStructuredDocumentAttachmentContent(Long attachmentId) throws IOException {
    Attachment existingAttachment = Attachment.getAttachmentFromId(attachmentId);
    if (existingAttachment == null) {
        throw new IOException(String.format("Unknow object %s cannot create a link", String.valueOf(attachmentId)));
    }
    log.debug(String.format("Existing attachment to link %s found", String.valueOf(attachmentId)));
    if (existingAttachment.isFile()) {
        throw new IllegalArgumentException(String.format("The attachment must be a structured data attachment %s", String.valueOf(attachmentId)));
    }
    if (existingAttachment.structuredDocument == null || existingAttachment.structuredDocument.content == null) {
        throw new IOException(String.format("Attachment object %s is not linked to a file nor a structured document", String.valueOf(attachmentId)));
    }
    return Utilities.unmarshallObject(existingAttachment.structuredDocument.content);
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:16,代码来源:DefaultAttachmentManagerPlugin.java

示例3: processMilestoneRequest

import framework.utils.Utilities; //导入方法依赖的package包/类
/**
 * Display the details of a pending milestone request in order to
 * accept/reject it.
 * 
 * @param id
 *            the portfolio entry id
 * @param requestId
 *            the request id
 */
@With(CheckPortfolioEntryExists.class)
@Dynamic(IMafConstants.PORTFOLIO_ENTRY_REVIEW_REQUEST_DYNAMIC_PERMISSION)
public Result processMilestoneRequest(Long id, Long requestId) {

    // get the portfolio entry
    PortfolioEntry portfolioEntry = PortfolioEntryDao.getPEById(id);

    // get the request
    ProcessTransitionRequest request = ProcessTransitionRequestDao.getProcessTransitionRequestById(requestId);

    // check the request is not yet processed
    if (request.reviewDate != null) {
        Utilities.sendInfoFlashMessage(Msg.get("core.process_transition_request.process_milestone_request.message.already_processed"));
        return redirect(controllers.core.routes.ProcessTransitionRequestController.reviewMilestoneRequestList(0));
    }

    // get the structured document (RequestMilestoneFormData)
    RequestMilestoneFormData requestMilestoneFormData = null;
    try {
        List<Attachment> structuredDocumentAttachments = getAttachmentManagerPlugin()
                .getAttachmentsFromObjectTypeAndObjectId(ProcessTransitionRequest.class, request.id, true);

        requestMilestoneFormData = (RequestMilestoneFormData) Utilities.unmarshallObject(structuredDocumentAttachments.get(0).structuredDocument.content);

        if (!requestMilestoneFormData.id.equals(id)) {
            return forbidden(views.html.error.access_forbidden.render(""));
        }

    } catch (Exception e) {
        return ControllersUtils.logAndReturnUnexpectedError(e, log, getConfiguration(), getI18nMessagesPlugin());
    }

    // get the milestone
    LifeCycleMilestone lifeCycleMilestone = LifeCycleMilestoneDao.getLCMilestoneById(requestMilestoneFormData.milestoneId);

    // get the milestone instances status
    List<String> status = LifeCycleMilestoneDao.getLCMilestoneAsStatusByPEAndLCMilestone(id, lifeCycleMilestone.id);

    // if exists, get the description document
    List<Attachment> attachments = FileAttachmentHelper.getFileAttachmentsForDisplay(ProcessTransitionRequest.class, request.id,
            getAttachmentManagerPlugin(), getUserSessionManagerPlugin());
    Attachment descriptionDocument = null;
    if (attachments != null && attachments.size() > 0) {
        descriptionDocument = attachments.get(0);
    }

    // construct the form
    Form<ProcessMilestoneRequestFormData> processMilestoneRequestForm = processMilestoneRequestFormTemplate
            .fill(new ProcessMilestoneRequestFormData(requestMilestoneFormData, request.id));

    return ok(views.html.core.processtransitionrequest.milestone_request_process.render(request, descriptionDocument, portfolioEntry, lifeCycleMilestone,
            status, processMilestoneRequestForm));
}
 
开发者ID:theAgileFactory,项目名称:maf-desktop-app,代码行数:63,代码来源:ProcessTransitionRequestController.java

示例4: getState

import framework.utils.Utilities; //导入方法依赖的package包/类
/**
 * Get the state of the configuration plugin.
 * 
 * @return an object
 */
public Object getState() {
    return Utilities.unmarshallObject(this.stateStorage);
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:9,代码来源:PluginConfiguration.java

示例5: getState

import framework.utils.Utilities; //导入方法依赖的package包/类
/**
 * Get the state of the widget.
 * 
 * @return an object
 */
public Object getState() {
    return Utilities.unmarshallObject(this.config);
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:9,代码来源:DashboardWidget.java

示例6: getBigData

import framework.utils.Utilities; //导入方法依赖的package包/类
/**
 * Plugin data stored as a blob.
 * 
 * @return an object
 */
public Object getBigData() {
    return Utilities.unmarshallObject(this.bigDataStorage);
}
 
开发者ID:theAgileFactory,项目名称:app-framework,代码行数:9,代码来源:PluginSharedRecord.java


注:本文中的framework.utils.Utilities.unmarshallObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。