本文整理汇总了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);
}
}
}
示例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);
}
示例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));
}
示例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);
}
示例5: getState
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Get the state of the widget.
*
* @return an object
*/
public Object getState() {
return Utilities.unmarshallObject(this.config);
}
示例6: getBigData
import framework.utils.Utilities; //导入方法依赖的package包/类
/**
* Plugin data stored as a blob.
*
* @return an object
*/
public Object getBigData() {
return Utilities.unmarshallObject(this.bigDataStorage);
}