• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java DocumentFormBase类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.kuali.rice.krad.web.form.DocumentFormBase的典型用法代码示例。如果您正苦于以下问题:Java DocumentFormBase类的具体用法?Java DocumentFormBase怎么用?Java DocumentFormBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

DocumentFormBase类属于org.kuali.rice.krad.web.form包,在下文中一共展示了DocumentFormBase类的40个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: route

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Showcase the dialog feature by confirming with the user that he really wants to route the document.
 */
@Override
public ModelAndView route(DocumentFormBase form) {
    String dialog = "TravelAccount-RouteConfirmationDialog";
    DialogResponse routeConfirmDialog = form.getDialogResponse(dialog);
    if (routeConfirmDialog == null) {
        return showDialog(dialog, true, form);
    }

    boolean dialogAnswer = routeConfirmDialog.getResponseAsBoolean();
    if (dialogAnswer) {
        return super.route(form);
    }

    return getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:TravelAccountController.java

示例2: reload

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView reload(DocumentFormBase form) throws WorkflowException {
    Document document = form.getDocument();

    // prepare the reload action by calling dochandler (set doc id and command)
    form.setDocId(document.getDocumentNumber());
    form.setCommand(DOCUMENT_LOAD_COMMANDS[1]);

    form.setEvaluateFlagsAndModes(true);
    form.setCanEditView(null);

    GlobalVariables.getMessageMap().putInfo(KRADConstants.GLOBAL_MESSAGES, RiceKeyConstants.MESSAGE_RELOADED);

    return docHandler(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:DocumentControllerServiceImpl.java

示例3: save

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView save(DocumentFormBase form, SaveDocumentEvent saveDocumentEvent) {
    Document document = form.getDocument();

    // get the explanation from the document and check it for sensitive data
    String explanation = document.getDocumentHeader().getExplanation();
    ModelAndView sensitiveDataDialogModelAndView = checkSensitiveDataAndWarningDialog(explanation, form);

    // if a sensitive data warning dialog is returned then display it
    if (sensitiveDataDialogModelAndView != null) {
        return sensitiveDataDialogModelAndView;
    }

    performWorkflowAction(form, UifConstants.WorkflowAction.SAVE, saveDocumentEvent);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:21,
代码来源:DocumentControllerServiceImpl.java

示例4: disapprove

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView disapprove(DocumentFormBase form) {
    // get the explanation for disapproval from the disapprove dialog and check it for sensitive data
    String explanationData = generateDisapprovalNote(form);
    ModelAndView sensitiveDataDialogModelAndView = checkSensitiveDataAndWarningDialog(explanationData, form);

    // if a sensitive data warning dialog is returned then display it
    if (sensitiveDataDialogModelAndView != null) {
        return sensitiveDataDialogModelAndView;
    }

    performWorkflowAction(form, UifConstants.WorkflowAction.DISAPPROVE);

    return getNavigationControllerService().returnToPrevious(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:DocumentControllerServiceImpl.java

示例5: superUserApprove

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView superUserApprove(DocumentFormBase form) {
    Document document = form.getDocument();

    if (StringUtils.isBlank(document.getSuperUserAnnotation())) {
        GlobalVariables.getMessageMap().putErrorForSectionId(
                "Uif-SuperUserAnnotation", RiceKeyConstants.ERROR_SUPER_USER_APPROVE_MISSING);
    }

    Set<String> selectedCollectionLines = form.getSelectedCollectionLines().get(UifPropertyPaths.ACTION_REQUESTS);

    if (!CollectionUtils.isEmpty(selectedCollectionLines)) {
        GlobalVariables.getMessageMap().putErrorForSectionId(
                "Uif-SuperUserActionRequests", RiceKeyConstants.ERROR_SUPER_USER_APPROVE_ACTIONS_CHECKED);
    }

    if (GlobalVariables.getMessageMap().hasErrors()) {
        return getModelAndViewService().getModelAndView(form);
    }

    performSuperUserWorkflowAction(form, UifConstants.SuperUserWorkflowAction.APPROVE);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:28,
代码来源:DocumentControllerServiceImpl.java

示例6: superUserDisapprove

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView superUserDisapprove(DocumentFormBase form) {
    Document document = form.getDocument();

    if (StringUtils.isBlank(document.getSuperUserAnnotation())) {
        GlobalVariables.getMessageMap().putErrorForSectionId(
                "Uif-SuperUserAnnotation", RiceKeyConstants.ERROR_SUPER_USER_DISAPPROVE_MISSING);
    }

    Set<String> selectedCollectionLines = form.getSelectedCollectionLines().get(UifPropertyPaths.ACTION_REQUESTS);

    if (!CollectionUtils.isEmpty(selectedCollectionLines)) {
        GlobalVariables.getMessageMap().putErrorForSectionId(
                "Uif-SuperUserActionRequests", RiceKeyConstants.ERROR_SUPER_USER_DISAPPROVE_ACTIONS_CHECKED);
    }

    if (GlobalVariables.getMessageMap().hasErrors()) {
        return getModelAndViewService().getModelAndView(form);
    }

    performSuperUserWorkflowAction(form, UifConstants.SuperUserWorkflowAction.DISAPPROVE);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:28,
代码来源:DocumentControllerServiceImpl.java

示例7: setDocumentForm

点赞 3

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * @deprecated (Deprecated and removed from use in KRAD  (KULRICE-9149)
 *
 */
@Override
@Deprecated
public void setDocumentForm(DocumentFormBase form, UserSession userSession, String ipAddress) {
    synchronized (userSession) {
        //formKey was set in KualiDocumentActionBase execute method
        String formKey = form.getFormKey();
        String key = userSession.getKualiSessionId() + "-" + formKey;

        String documentNumber = form.getDocument().getDocumentNumber();
        if (StringUtils.isNotBlank(formKey)) {
            //FIXME: Currently using formKey for sessionId
            persistDocumentForm(form, userSession, ipAddress, formKey, documentNumber);
        } else {
            LOG.warn("documentNumber is null on form's document: " + form);
        }
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:22,
代码来源:SessionDocumentServiceImpl.java

示例8: getKeyValues

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.uif.control.UifKeyValuesFinder#getKeyValues(org.kuali.rice.krad.uif.view.ViewModel)
 */
@Override
public List<KeyValue> getKeyValues(ViewModel model) {
    DocumentFormBase documentFormBase = (DocumentFormBase) model;
    Document document = documentFormBase.getDocument();
    List<KeyValue> keyValues = new ArrayList<KeyValue>();
    keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_FYI_REQ, KewApiConstants.ACTION_REQUEST_FYI_REQ_LABEL));
    keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ_LABEL));
    keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_APPROVE_REQ, KewApiConstants.ACTION_REQUEST_APPROVE_REQ_LABEL));

    if ((document.getDocumentHeader().getWorkflowDocument().isInitiated() || document.getDocumentHeader().getWorkflowDocument().isSaved())) {
        keyValues.add(new ConcreteKeyValue(KewApiConstants.ACTION_REQUEST_COMPLETE_REQ, KewApiConstants.ACTION_REQUEST_COMPLETE_REQ_LABEL));
    }
    return keyValues;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:AdHocActionRequestCodesValuesFinder.java

示例9: loadDocument

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void loadDocument(DocumentFormBase form) throws WorkflowException {
    super.loadDocument(form);

    MaintenanceDocumentForm maintenanceForm = (MaintenanceDocumentForm) form;
    maintenanceForm.setMaintenanceAction(
            (maintenanceForm.getDocument()).getNewMaintainableObject().getMaintenanceAction());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:12,
代码来源:MaintenanceDocumentControllerServiceImpl.java

示例10: docHandler

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Determines whether a new document instance needs created or we need to load an existing document by
 * checking the {@link org.kuali.rice.krad.web.form.DocumentFormBase#getCommand()} value, then delegates to
 * a helper method to carry out the action.
 *
 * {@inheritDoc}
 */
@Override
public ModelAndView docHandler(DocumentFormBase form) throws WorkflowException {
    String command = form.getCommand();
    DocumentView view = (DocumentView) form.getView();

    if (ArrayUtils.contains(DOCUMENT_LOAD_COMMANDS, command) && (form.getDocId() != null)) {
        checkReturnLocationForDocSearch(command, form);

        loadDocument(form);

        if (KewApiConstants.SUPERUSER_COMMAND.equals(command)) {
            view.setSuperUserView(true);
        }
    } else if (KewApiConstants.INITIATE_COMMAND.equals(command)) {
        if (view != null) {
            form.setApplyDefaultValues(true);
        }

        createDocument(form);
    } else {
        LOG.error("docHandler called with invalid parameters");
        throw new IllegalArgumentException("docHandler called with invalid parameters");
    }

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:34,
代码来源:DocumentControllerServiceImpl.java

示例11: loadDocument

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Loads the document by its provided document header id on the given form.
 *
 * <p>This has been abstracted out so that it can be overridden in children if the need arises</p>
 *
 * @param form form instance that contains the doc id parameter and where
 * the retrieved document instance should be set
 */
protected void loadDocument(DocumentFormBase form) throws WorkflowException {
    String docId = form.getDocId();

    if (LOG.isDebugEnabled()) {
        LOG.debug("Loading document" + docId);
    }

    Document document = getDocumentService().getByDocumentHeaderId(docId);
    if (document == null) {
        throw new UnknownDocumentIdException(
                "Document no longer exists.  It may have been cancelled before being saved.");
    }

    WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();
    if (!getDocumentDictionaryService().getDocumentAuthorizer(document).canOpen(document,
            GlobalVariables.getUserSession().getPerson())) {
        throw buildAuthorizationException("open", document);
    }

    // re-retrieve the document using the current user's session - remove
    // the system user from the WorkflowDcument object
    if (workflowDocument != document.getDocumentHeader().getWorkflowDocument()) {
        LOG.warn("Workflow document changed via canOpen check");
        document.getDocumentHeader().setWorkflowDocument(workflowDocument);
    }

    form.setDocument(document);
    form.setDocTypeName(workflowDocument.getDocumentTypeName());

    UserSessionUtils.addWorkflowDocument(GlobalVariables.getUserSession(), workflowDocument);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:40,
代码来源:DocumentControllerServiceImpl.java

示例12: createDocument

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Creates a new document of the type specified by the docTypeName property of the given form.
 *
 * <p>This has been abstracted out so that it can be overridden in children if the need arises</p>
 *
 * @param form form instance that contains the doc type parameter and where
 * the new document instance should be set
 */
protected void createDocument(DocumentFormBase form) throws WorkflowException {
    if (LOG.isDebugEnabled()) {
        LOG.debug("Creating new document instance for doc type: " + form.getDocTypeName());
    }

    Document doc = getDocumentService().getNewDocument(form.getDocTypeName());

    form.setDocument(doc);
    form.setDocTypeName(doc.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:DocumentControllerServiceImpl.java

示例13: cancel

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView cancel(UifFormBase form) {
    performWorkflowAction((DocumentFormBase) form, UifConstants.WorkflowAction.CANCEL);

    return getNavigationControllerService().returnToPrevious(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例14: recall

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView recall(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.RECALL);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例15: complete

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView complete(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.COMPLETE);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例16: route

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView route(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.ROUTE);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例17: blanketApprove

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView blanketApprove(DocumentFormBase form) {
    Document document = form.getDocument();
    WorkflowDocument workflowDocument = document.getDocumentHeader().getWorkflowDocument();

    //disable blanket approve if adhoc route completion exists
    List<AdHocRouteRecipient> adHocRecipients = new ArrayList<AdHocRouteRecipient>();
    adHocRecipients.addAll(document.getAdHocRoutePersons());
    adHocRecipients.addAll(document.getAdHocRouteWorkgroups());

    //check for ad hoc completion request
    for (AdHocRouteRecipient adHocRouteRecipient : adHocRecipients) {
        String actionRequestedCode = adHocRouteRecipient.getActionRequested();

        //add error and send back
        if (KewApiConstants.ACTION_REQUEST_COMPLETE_REQ.equals(actionRequestedCode)) {
            GlobalVariables.getMessageMap().putError(KRADConstants.NEW_AD_HOC_ROUTE_WORKGROUP_PROPERTY_NAME,
                    RiceKeyConstants.ERROR_ADHOC_COMPLETE_BLANKET_APPROVE_NOT_ALLOWED);

            return getModelAndViewService().getModelAndView(form);
        }
    }

    performWorkflowAction(form, UifConstants.WorkflowAction.BLANKETAPPROVE);

    if (GlobalVariables.getMessageMap().hasErrors()) {
        return getModelAndViewService().getModelAndView(form);
    }

    return getNavigationControllerService().returnToPrevious(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:35,
代码来源:DocumentControllerServiceImpl.java

示例18: approve

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView approve(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.APPROVE);

    return getNavigationControllerService().returnToPrevious(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例19: generateDisapprovalNote

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Convenience method for generating disapproval note with text from the explanation dialog.
 *
 * @param form document form instance containing the explanation dialog
 * @return
 */
protected String generateDisapprovalNote(DocumentFormBase form) {
    String explanationData = form.getDialogExplanations().get(EXPLANATION_DIALOG);
    if(explanationData == null) {
        return "";
    }

    // build out full message to return
    String introNoteMessage = getConfigurationService().getPropertyValueAsString(
            RiceKeyConstants.MESSAGE_DISAPPROVAL_NOTE_TEXT_INTRO) + KRADConstants.BLANK_SPACE;

    return introNoteMessage + explanationData;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:DocumentControllerServiceImpl.java

示例20: fyi

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView fyi(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.FYI);

    return getNavigationControllerService().returnToPrevious(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例21: acknowledge

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView acknowledge(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.ACKNOWLEDGE);

    return getNavigationControllerService().returnToPrevious(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例22: sendAdHocRequests

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView sendAdHocRequests(DocumentFormBase form) {
    performWorkflowAction(form, UifConstants.WorkflowAction.SENDADHOCREQUESTS);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例23: supervisorFunctions

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView supervisorFunctions(DocumentFormBase form) {
    String workflowSuperUserUrl = getConfigurationService().getPropertyValueAsString(KRADConstants.WORKFLOW_URL_KEY)
            + "/"
            + KRADConstants.SUPERUSER_ACTION;

    Properties props = new Properties();
    props.setProperty(UifParameters.METHOD_TO_CALL, UifConstants.MethodToCallNames.DISPLAY_SUPER_USER_DOCUMENT);
    props.setProperty(UifPropertyPaths.DOCUMENT_ID, form.getDocument().getDocumentNumber());

    return getModelAndViewService().performRedirect(form, workflowSuperUserUrl, props);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:DocumentControllerServiceImpl.java

示例24: insertNote

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Validates the note, saves attachment, adds the time stamp and author, and calls the
 * generic addLine method.
 *
 * {@inheritDoc}
 */
@Override
public ModelAndView insertNote(DocumentFormBase form) {
    Document document = form.getDocument();

    Note newNote = getAddLineNoteInstance(form);
    setNewNoteProperties(form, document, newNote);

    Attachment attachment = getNewNoteAttachment(form, document, newNote);

    // validate the note
    boolean rulesPassed = KRADServiceLocatorWeb.getKualiRuleService().applyRules(new AddNoteEvent(document,
            newNote));
    if (!rulesPassed) {
        return getModelAndViewService().getModelAndView(form);
    }

    // adding the attachment after refresh gets called, since the attachment record doesn't get persisted
    // until the note does (and therefore refresh doesn't have any attachment to autoload based on the id, nor
    // does it autopopulate the id since the note hasn't been persisted yet)
    if (attachment != null) {
        newNote.addAttachment(attachment);
    }

    // check for sensitive data within the note and display warning dialog if necessary
    ModelAndView sensitiveDataDialogModelAndView = checkSensitiveDataAndWarningDialog(newNote.getNoteText(), form);
    if (sensitiveDataDialogModelAndView != null) {
        return sensitiveDataDialogModelAndView;
    }

    saveNewNote(form, document, newNote);

    return getCollectionControllerService().addLine(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:40,
代码来源:DocumentControllerServiceImpl.java

示例25: getAddLineNoteInstance

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Retrieves the note instance on the form that should be added to the document notes.
 *
 * @param form form instance containing the add note instance
 * @return
 */
protected Note getAddLineNoteInstance(DocumentFormBase form) {
    String selectedCollectionId = form.getActionParamaterValue(UifParameters.SELECTED_COLLECTION_ID);

    BindingInfo addLineBindingInfo = (BindingInfo) form.getViewPostMetadata().getComponentPostData(
            selectedCollectionId, UifConstants.PostMetadata.ADD_LINE_BINDING_INFO);

    String addLinePath = addLineBindingInfo.getBindingPath();
    Object addLine = ObjectPropertyUtils.getPropertyValue(form, addLinePath);

    return (Note) addLine;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:DocumentControllerServiceImpl.java

示例26: setNewNoteProperties

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Defaults properties (posted timestamp, object id, author) on the note instance that will be added.
 *
 * @param form form instance containing the add note instance
 * @param document document instance the note will be added to
 * @param newNote note instance to set properties on
 */
protected void setNewNoteProperties(DocumentFormBase form, Document document, Note newNote) {
    newNote.setNotePostedTimestampToCurrent();
    newNote.setRemoteObjectIdentifier(document.getNoteTarget().getObjectId());

    Person kualiUser = GlobalVariables.getUserSession().getPerson();
    if (kualiUser == null) {
        throw new IllegalStateException("Current UserSession has a null Person.");
    }

    newNote.setAuthorUniversalIdentifier(kualiUser.getPrincipalId());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:19,
代码来源:DocumentControllerServiceImpl.java

示例27: getNewNoteAttachment

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Builds an attachment for the file (if any) associated with the add note instance.
 *
 * @param form form instance containing the attachment file
 * @param document document instance the attachment should be associated with
 * @param newNote note instance the attachment should be associated with
 * @return Attachment instance for the note, or null if no attachment file was present
 */
protected Attachment getNewNoteAttachment(DocumentFormBase form, Document document, Note newNote) {
    MultipartFile attachmentFile = form.getAttachmentFile();

    if ((attachmentFile == null) || StringUtils.isBlank(attachmentFile.getOriginalFilename())) {
        return null;
    }

    if (attachmentFile.getSize() == 0) {
        GlobalVariables.getMessageMap().putError(String.format("%s.%s",
                KRADConstants.NEW_DOCUMENT_NOTE_PROPERTY_NAME, KRADConstants.NOTE_ATTACHMENT_FILE_PROPERTY_NAME),
                RiceKeyConstants.ERROR_UPLOADFILE_EMPTY, attachmentFile.getOriginalFilename());

        return null;
    }

    String attachmentTypeCode = null;
    if (newNote.getAttachment() != null) {
        attachmentTypeCode = newNote.getAttachment().getAttachmentTypeCode();
    }

    DocumentAuthorizer documentAuthorizer = getDocumentDictionaryService().getDocumentAuthorizer(document);
    if (!documentAuthorizer.canAddNoteAttachment(document, attachmentTypeCode,
            GlobalVariables.getUserSession().getPerson())) {
        throw buildAuthorizationException("annotate", document);
    }

    Attachment attachment;
    try {
        attachment = getAttachmentService().createAttachment(document.getNoteTarget(),
                attachmentFile.getOriginalFilename(), attachmentFile.getContentType(),
                (int) attachmentFile.getSize(), attachmentFile.getInputStream(), attachmentTypeCode);
    } catch (IOException e) {
        throw new RiceRuntimeException("Unable to store attachment", e);
    }

    return attachment;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:46,
代码来源:DocumentControllerServiceImpl.java

示例28: saveNewNote

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Saves a new note instance to the data store if the document state allows it.
 *
 * @param form form instance containing the add note instance
 * @param document document instance the note is associated with
 * @param newNote note instance to save
 */
protected void saveNewNote(DocumentFormBase form, Document document, Note newNote) {
    DocumentHeader documentHeader = document.getDocumentHeader();

    if (!documentHeader.getWorkflowDocument().isInitiated() && StringUtils.isNotEmpty(
            document.getNoteTarget().getObjectId()) && !(document instanceof MaintenanceDocument && NoteType
            .BUSINESS_OBJECT.getCode().equals(newNote.getNoteTypeCode()))) {

        getNoteService().save(newNote);
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:18,
代码来源:DocumentControllerServiceImpl.java

示例29: deleteNote

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView deleteNote(DocumentFormBase form) {
    String selectedLineIndex = form.getActionParamaterValue(UifParameters.SELECTED_LINE_INDEX);

    Document document = form.getDocument();

    Note note = document.getNote(Integer.parseInt(selectedLineIndex));
    Attachment attachment = note.getAttachment();

    String attachmentTypeCode = null;
    if (attachment != null) {
        attachmentTypeCode = attachment.getAttachmentTypeCode();
    }

    // verify the user has permissions to delete the note
    Person user = GlobalVariables.getUserSession().getPerson();
    if (!getDocumentDictionaryService().getDocumentAuthorizer(document).canDeleteNoteAttachment(document,
            attachmentTypeCode, note.getAuthorUniversalIdentifier(), user)) {
        throw buildAuthorizationException("annotate", document);
    }

    if (attachment != null && attachment.isComplete()) {
        getAttachmentService().deleteAttachmentContents(attachment);
    }

    // if document is not saved there is no need to delete the note (it is not persisted)
    if (!document.getDocumentHeader().getWorkflowDocument().isInitiated()) {
        getNoteService().deleteNote(note);
    }

    return getCollectionControllerService().deleteLine(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:36,
代码来源:DocumentControllerServiceImpl.java

示例30: cancelAttachment

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ModelAndView cancelAttachment(DocumentFormBase form) {
    form.setAttachmentFile(null);

    return getModelAndViewService().getModelAndView(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentControllerServiceImpl.java

示例31: combineAdHocRecipients

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Convenience method to combine the two lists of ad hoc recipients into one which should be done before
 * calling any of the document service methods that expect a list of ad hoc recipients.
 *
 * @param form document form instance containing the ad hod lists
 * @return List<AdHocRouteRecipient> combined ad hoc recipients
 */
protected List<AdHocRouteRecipient> combineAdHocRecipients(DocumentFormBase form) {
    Document document = form.getDocument();

    List<AdHocRouteRecipient> adHocRecipients = new ArrayList<AdHocRouteRecipient>();
    adHocRecipients.addAll(document.getAdHocRoutePersons());
    adHocRecipients.addAll(document.getAdHocRouteWorkgroups());

    return adHocRecipients;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:17,
代码来源:DocumentControllerServiceImpl.java

示例32: canEditView

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Verify the document can be edited in addition to the view
 */
@Override
public boolean canEditView(View view, ViewModel model) {
    DocumentFormBase documentForm = (DocumentFormBase) model;

    return super.canEditView(view, model) && canEdit(documentForm.getDocument());
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentViewPresentationControllerBase.java

示例33: cancel

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * <p>
 * Releases the pessimistic locks before continuing.
 * </p>
 */
@Override
public ModelAndView cancel(UifFormBase form) {
    ModelAndView modelAndView = super.cancel(form);

    releasePessimisticLocks((DocumentFormBase) form);

    return modelAndView;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例34: route

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * <p>
 * Releases the pessimistic locks before continuing.
 * </p>
 */
@Override
public ModelAndView route(DocumentFormBase form) {
    ModelAndView modelAndView = super.route(form);

    releasePessimisticLocks(form);

    return modelAndView;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例35: approve

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * <p>
 * Releases the pessimistic locks before continuing.
 * </p>
 */
@Override
public ModelAndView approve(DocumentFormBase form) {
    ModelAndView modelAndView = super.approve(form);

    releasePessimisticLocks(form);

    return modelAndView;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例36: disapprove

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * <p>
 * Releases the pessimistic locks before continuing.
 * </p>
 */
@Override
public ModelAndView disapprove(DocumentFormBase form) {
    ModelAndView modelAndView = super.disapprove(form);

    releasePessimisticLocks(form);

    return modelAndView;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例37: acknowledge

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * <p>
 * Releases the pessimistic locks before continuing.
 * </p>
 */
@Override
public ModelAndView acknowledge(DocumentFormBase form) {
    ModelAndView modelAndView = super.acknowledge(form);

    releasePessimisticLocks(form);

    return modelAndView;
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:16,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例38: close

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 *
 * <p>
 * Prompts for save and releases the pessimistic locks before continuing.
 * </p>
 */
@Override
public ModelAndView close(DocumentFormBase form) {
    Document document = form.getDocument();

    // only offer to save if it is a valid action
    if (document.getDocumentHeader().getWorkflowDocument().isValidAction(ActionType.SAVE)) {
        // initialize the dialog to prompt for save
        DialogResponse dialogResponse = form.getDialogResponse(KRADConstants.QUESTION_ACTION_CLOSE_RESPONSE);

        if (dialogResponse == null) {
            return getModelAndViewService().showDialog(KRADConstants.QUESTION_ACTION_CLOSE_RESPONSE, false, form);
        }

        // save if the user answers yes in the dialog
        if (dialogResponse.getResponseAsBoolean()) {
            // get the explanation from the document and check it for sensitive data
            String explanation = document.getDocumentHeader().getExplanation();
            ModelAndView sensitiveDataDialogModelAndView = checkSensitiveDataAndWarningDialog(explanation, form);

            // if a sensitive data warning dialog is returned then display it
            if (sensitiveDataDialogModelAndView != null) {
                return sensitiveDataDialogModelAndView;
            }

            performWorkflowAction(form, UifConstants.WorkflowAction.SAVE);
        }
    }

    releasePessimisticLocks(form);

    return super.close(form);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:40,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例39: releasePessimisticLocks

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * Releases the pessimistic locks for the current user.
 *
 * @param form form instance containing the transactional document data
 */
protected void releasePessimisticLocks(DocumentFormBase form) {
    Document document = form.getDocument();

    if (!document.getPessimisticLocks().isEmpty()) {
        Person user = GlobalVariables.getUserSession().getPerson();
        getPessimisticLockService().releaseAllLocksForUser(document.getPessimisticLocks(), user);
        document.refreshPessimisticLocks();
    }
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:15,
代码来源:TransactionalDocumentControllerServiceImpl.java

示例40: canOpenView

点赞 2

import org.kuali.rice.krad.web.form.DocumentFormBase; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean canOpenView(View view, ViewModel model, Person user) {
    DocumentFormBase documentForm = (DocumentFormBase) model;

    return super.canOpenView(view, model, user) && canOpen(documentForm.getDocument(), user);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:10,
代码来源:DocumentViewAuthorizerBase.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)