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


Java Note.setAuthorUniversalIdentifier方法代码示例

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


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

示例1: createNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
    * TODO this method seems awfully out of place in this service
    *
    */
   @Override
public Note createNote(Note noteToCopy, GloballyUnique bo, String authorPrincipalId) {
   	validateNoteNotNull(noteToCopy);
   	if (bo == null) {
   		throw new IllegalArgumentException("The bo must not be null.");
   	}
   	if (StringUtils.isBlank(authorPrincipalId)) {
   		throw new IllegalArgumentException("The authorPrincipalId must not be null.");
   	}

       Note tmpNote = new CopiedObject<Note>(noteToCopy).getContent();
       tmpNote.setRemoteObjectIdentifier(bo.getObjectId());
       tmpNote.setAuthorUniversalIdentifier(authorPrincipalId);

       return tmpNote;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:NoteServiceImpl.java

示例2: addNoteAfterProcessingAgencyStagingExpense

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addNoteAfterProcessingAgencyStagingExpense(MaintenanceDocument document, List<ErrorMessage> errors) {

        Principal kfsSystemUser = getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);
	    String errorText = getMessageAsString(errors);

	    if (!StringUtils.isEmpty(errorText)) {
	        //check maxLength on a Note and truncate if necessary
    	    Integer maxLength = getDataDictionaryService().getAttributeMaxLength(Note.class, KRADConstants.NOTE_TEXT_PROPERTY_NAME);
    	    if (errorText.length() > maxLength) {
    	        LOG.warn("Adding a truncated error text to Note due to space limitations. Original text:");
    	        LOG.warn(errorText);
    	        errorText = errorText.substring(0,maxLength);
    	    }

            final Note newNote = getDocumentService().createNoteFromDocument(document, errorText);
            newNote.setAuthorUniversalIdentifier(kfsSystemUser.getPrincipalId());
            document.addNote(newNote);
            getNoteService().save(newNote);
	    }
	}
 
开发者ID:kuali,项目名称:kfs,代码行数:21,代码来源:AgencyStagingDataMaintainable.java

示例3: notifyDateChangedOn

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.service.TravelReimbursementService#notifyDateChangedOn(TravelReimbursementDocument, Date, Date)
 */
@Override
public void notifyDateChangedOn(final TravelReimbursementDocument reimbursement, final Date start, final Date end) throws Exception {
    final SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    final String origStartDateStr = formatter.format(start);
    final String origEndDateStr = formatter.format(end);
    final String newStartDateStr = formatter.format(reimbursement.getTripBegin());
    final String newEndDateStr = formatter.format(reimbursement.getTripEnd());

    final String noteText = String.format(DATE_CHANGED_MESSAGE, origStartDateStr, origEndDateStr, newStartDateStr, newEndDateStr, reimbursement.getDocumentNumber());

    final Note noteToAdd = documentService.createNoteFromDocument(reimbursement, noteText);

    final Principal systemUser = getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);
    noteToAdd.setAuthorUniversalIdentifier(systemUser.getPrincipalId());
    reimbursement.addNote(noteToAdd);
    getNoteService().save(noteToAdd);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:21,代码来源:TravelReimbursementServiceImpl.java

示例4: addAssignedAssetNumbers

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.integration.service.PurchasingAccountsPayableModuleService#addAssignedAssetNumbers(java.lang.Integer,
 *      java.util.List)
 */
@Override
public void addAssignedAssetNumbers(Integer purchaseOrderNumber, String principalId, String noteText) {
    PurchaseOrderDocument document = purchaseOrderService.getCurrentPurchaseOrder(purchaseOrderNumber);

    try {
        Note assetNote = SpringContext.getBean(DocumentService.class).createNoteFromDocument(document, noteText);
        // set the initiator user info to the new note
        assetNote.setAuthorUniversalIdentifier(principalId);
        document.addNote(assetNote);
        SpringContext.getBean(NoteService.class).save(assetNote);
    }
    catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:20,代码来源:PurchasingAccountsPayableModuleServiceImpl.java

示例5: processAfterPost

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* @see  org.kuali.kfs.sys.document.FinancialSystemMaintainable.processAfterPost
*/
@Override
public void processAfterPost(MaintenanceDocument document, Map<String, String[]> parameters) {
    String[] customAction = parameters.get(KRADConstants.CUSTOM_ACTION);
    if (customAction != null && customAction.length > 0 && StringUtils.equals(CamsPropertyConstants.Asset.LAST_INVENTORY_DATE_UPDATE_BUTTON,customAction[0])) {
        WorkflowDocument workflowDoc = document.getDocumentHeader().getWorkflowDocument();
        if(workflowDoc != null && workflowDoc.isInitiated()) {
            asset.setLastInventoryDate(new Timestamp(SpringContext.getBean(DateTimeService.class).getCurrentSqlDate().getTime()));            
            String userPrincipalName= GlobalVariables.getUserSession().getPrincipalName();
            final String noteTextPattern = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(CamsKeyConstants.Asset.LAST_INVENTORY_DATE_UPDATE_NOTE_TEXT);
            Object[] arguments = { userPrincipalName, asset.getCapitalAssetNumber().toString() };
            String noteText = MessageFormat.format(noteTextPattern, arguments);
            Note lastInventoryDateUpdatedNote = getDocumentService().createNoteFromDocument(document, noteText);
            lastInventoryDateUpdatedNote.setAuthorUniversalIdentifier(getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER).getPrincipalId());
            document.addNote(lastInventoryDateUpdatedNote);
            getDocumentService().saveDocumentNotes(document);
        }
    }
    super.processAfterPost(document, parameters);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:23,代码来源:AssetMaintainableImpl.java

示例6: testNoteSave_LargePersonId

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * tests saving notes
 * 
 * @throws Exception
 */
@Test public void testNoteSave_LargePersonId() throws Exception {
    Note note = new Note();
    note.setAuthorUniversalIdentifier("superLongNameUsersFromWorkflow");
    note.setNotePostedTimestamp(CoreApiServiceLocator.getDateTimeService().getCurrentTimestamp());
    note.setNoteText("i like notes");
    note.setRemoteObjectIdentifier("1209348109834u");
    note.setNoteTypeCode(NoteType.BUSINESS_OBJECT.getCode());
    try {
        KRADServiceLocator.getNoteService().save(note);
    } catch (Exception e) {
        fail("Saving a note should not fail");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:NoteServiceTest.java

示例7: setNewNoteProperties

import org.kuali.rice.krad.bo.Note; //导入方法依赖的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

示例8: addAssignedAssetNumbers

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.ole.integration.service.PurchasingAccountsPayableModuleService#addAssignedAssetNumbers(java.lang.Integer,
 *      java.util.List)
 */
public void addAssignedAssetNumbers(Integer purchaseOrderNumber, String principalId, String noteText) {
    PurchaseOrderDocument document = purchaseOrderService.getCurrentPurchaseOrder(purchaseOrderNumber);

    try {
        Note assetNote = SpringContext.getBean(DocumentService.class).createNoteFromDocument(document, noteText);
        // set the initiator user info to the new note
        assetNote.setAuthorUniversalIdentifier(principalId);
        document.addNote(assetNote);
        SpringContext.getBean(NoteService.class).save(assetNote);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:18,代码来源:PurchasingAccountsPayableModuleServiceImpl.java

示例9: saveDocumentAndNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Saves the ContractsGrantsLetterOfCreditReviewDocument and if necessary (i.e. there were validation errors for some
 * of the awards) saves a note indicating some awards didn't pass validation and aren't included on the document.
 *
 * @param contractsGrantsLetterOfCreditReviewDocument document to save
 * @param contractsGrantsInvoiceDocumentErrorLogs Collection of validation errors, if any
 * @throws WorkflowException
 */
protected void saveDocumentAndNote(ContractsGrantsLetterOfCreditReviewDocument contractsGrantsLetterOfCreditReviewDocument, Collection<ContractsGrantsInvoiceDocumentErrorLog> contractsGrantsInvoiceDocumentErrorLogs) throws WorkflowException {
    SpringContext.getBean(DocumentService.class).saveDocument(contractsGrantsLetterOfCreditReviewDocument);
    if (contractsGrantsInvoiceDocumentErrorLogs.size() > 0) {
        String noteText = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(ArKeyConstants.ContractsGrantsInvoiceConstants.ERROR_SOME_AWARDS_INVALID);
        Note note = SpringContext.getBean(DocumentService.class).createNoteFromDocument(contractsGrantsLetterOfCreditReviewDocument, noteText);
        note.setAuthorUniversalIdentifier(SpringContext.getBean(IdentityService.class).getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER).getPrincipalId());
        contractsGrantsLetterOfCreditReviewDocument.addNote(note);
        SpringContext.getBean(NoteService.class).save(note);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:19,代码来源:ContractsGrantsLetterOfCreditReviewDocumentAction.java

示例10: addCloseNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.ar.document.service.CustomerInvoiceDocumentService#addCloseNote
 */
@Override
public void addCloseNote(CustomerInvoiceDocument documentToClose, WorkflowDocument closingDocument) {
    if (!documentToClose.isOpenInvoiceIndicator()) {
        // If it already is closed, no need to add a note
        return;
    }

    String principalName = "Unknown";
    List<ActionTaken> actionsTaken = closingDocument.getActionsTaken();
    if(ObjectUtils.isNotNull(actionsTaken)){
        for(ActionTaken action : actionsTaken){
            // we're looking for the person who completed the closing document, so we want the COMPLETE action
            if(isActionClose(action.getActionTaken())){
                principalName = getPersonService().getPerson(action.getPrincipalId()).getName();
                break;
            }
        }
    }

    final String noteTextPattern = getConfigurationService().getPropertyValueAsString(ArKeyConstants.INVOICE_CLOSE_NOTE_TEXT);
    Object[] arguments = { principalName, closingDocument.getDocumentTypeName(), closingDocument.getDocumentId() };
    String noteText = MessageFormat.format(noteTextPattern, arguments);


    Note note = getDocumentService().createNoteFromDocument(documentToClose, noteText);
    note.setAuthorUniversalIdentifier(getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER).getPrincipalId());
    documentToClose.addNote(noteService.save(note));
}
 
开发者ID:kuali,项目名称:kfs,代码行数:32,代码来源:CustomerInvoiceDocumentServiceImpl.java

示例11: closeAuthorization

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.document.service.TravelAuthorizationService#closeAuthorization(org.kuali.kfs.module.tem.document.TravelAuthorizationDocument, java.lang.String, java.lang.String, java.lang.String)
 */
@Override
public TravelAuthorizationCloseDocument closeAuthorization(TravelAuthorizationDocument authorization, String annotation, String initiatorPrincipalName, String reimbursementDocNum) {
    TravelAuthorizationCloseDocument authorizationClose = null;
    try {
        String user = GlobalVariables.getUserSession().getPerson().getLastName() + ", " + GlobalVariables.getUserSession().getPerson().getFirstName();
        String note = MessageUtils.getMessage(TA_MESSAGE_CLOSE_DOCUMENT_TEXT, user);
        Principal kfsSystemUser = getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);

        authorization.updateAndSaveAppDocStatus(TravelAuthorizationStatusCodeKeys.RETIRED_VERSION);
        documentDao.save(authorization);

        // setting to initiator principal name
        GlobalVariables.setUserSession(new UserSession(initiatorPrincipalName));
        authorizationClose = authorization.toCopyTAC();
        final Note newNoteTAC = documentService.createNoteFromDocument(authorizationClose, note);
        newNoteTAC.setAuthorUniversalIdentifier(kfsSystemUser.getPrincipalId());
       authorizationClose.addNote(newNoteTAC);
        authorizationClose.setTravelReimbursementDocumentNumber(reimbursementDocNum);

        // add relationship
        String relationDescription = authorization.getDocumentTypeName() + " - " + authorizationClose.getDocumentTypeName();
        accountingDocumentRelationshipService.save(new AccountingDocumentRelationship(authorization.getDocumentNumber(), authorizationClose.getDocumentNumber(), relationDescription));

        // switching to KR user to route
        GlobalVariables.setUserSession(new UserSession(KRADConstants.SYSTEM_USER));
        authorizationClose.setApplicationDocumentStatus(TravelAuthorizationStatusCodeKeys.CLOSED);
        documentService.routeDocument(authorizationClose, annotation, null);
    }
    catch (Exception e) {
        LOG.error("Could not create TAC or route it with travel id " + authorization.getTravelDocumentIdentifier());
        LOG.error(e.getMessage(), e);
    }
    return authorizationClose;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:38,代码来源:TravelAuthorizationServiceImpl.java

示例12: revertOriginalDocument

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.document.service.TravelDocumentService#revertOriginalDocument(org.kuali.kfs.module.tem.document.TravelDocument, java.lang.String)
 */
@Override
public void revertOriginalDocument(TravelDocument travelDocument, String status) {
    final DocumentAttributeIndexingQueue documentAttributeIndexingQueue = KewApiServiceLocator.getDocumentAttributeIndexingQueue(); // this service is not a good candidate for injection
    List<Document> relatedDocumentList = getDocumentsRelatedTo(travelDocument, TravelDocTypes.TRAVEL_AUTHORIZATION_DOCUMENT,
            TravelDocTypes.TRAVEL_AUTHORIZATION_AMEND_DOCUMENT);

    for (Document taDocument : relatedDocumentList) {
        if (taDocument.getDocumentHeader().getWorkflowDocument().getApplicationDocumentStatus().equals(TravelAuthorizationStatusCodeKeys.PEND_AMENDMENT)) {
            TravelAuthorizationDocument taDoc = (TravelAuthorizationDocument) taDocument;
            try {
                taDoc.updateAndSaveAppDocStatus(status);
            }
            catch (WorkflowException ex1) {
                // TODO Auto-generated catch block
                ex1.printStackTrace();
            }

            try {
                Note cancelNote = getDocumentService().createNoteFromDocument(taDoc, "Amemdment Canceled");
                Principal systemUser = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);
                cancelNote.setAuthorUniversalIdentifier(systemUser.getPrincipalId());
                taDoc.addNote(cancelNote);
                getNoteService().save(cancelNote);
            }
            catch (Exception ex) {
                ex.printStackTrace();
            }
            documentAttributeIndexingQueue.indexDocument(taDoc.getDocumentNumber());
        }
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:35,代码来源:TravelDocumentServiceImpl.java

示例13: disapproveSalaryExpenseDocument

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.ld.document.service.SalaryTransferPeriodValidationService#disapproveSalaryExpenseDocument(org.kuali.kfs.module.ld.document.SalaryExpenseTransferDocument)
 */
@Override
public void disapproveSalaryExpenseDocument(SalaryExpenseTransferDocument document) throws Exception {
    // create note explaining why the document was disapproved
    String message = kualiConfigurationService.getPropertyValueAsString(LaborKeyConstants.EFFORT_AUTO_DISAPPROVE_MESSAGE);
    Note cancelNote = documentService.createNoteFromDocument( document, message);

    Principal principal = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);
    cancelNote.setAuthorUniversalIdentifier(principal.getPrincipalId());
    noteService.save(cancelNote);
    document.addNote(cancelNote);

    documentService.disapproveDocument(document, "disapproved - failed effort certification checks");
}
 
开发者ID:kuali,项目名称:kfs,代码行数:17,代码来源:SalaryTransferPeriodValidationServiceImpl.java

示例14: addContinuationAccountsNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Creates and adds a note indicating accounts replaced and what they replaced and attaches it to the document.
 *
 * @param document  The accounts payable document to which we're adding the note.
 * @param accounts  The HashMap where the keys are the string representations of the chart and account of the
 *                  original account and the values are the ExpiredOrClosedAccountEntry.
 */
protected void addContinuationAccountsNote(AccountsPayableDocument document, HashMap<String, ExpiredOrClosedAccountEntry> accounts) {
    String noteText;
    StringBuffer sb = new StringBuffer("");
    ExpiredOrClosedAccountEntry accountEntry = null;
    ExpiredOrClosedAccount originalAccount = null;
    ExpiredOrClosedAccount replacementAccount = null;

    // List the entries using entrySet()
    Set entries = accounts.entrySet();
    Iterator it = entries.iterator();

    // loop through the accounts found to be expired/closed and add if they have a continuation account
    while (it.hasNext()) {
        Map.Entry entry = (Map.Entry) it.next();
        accountEntry = (ExpiredOrClosedAccountEntry) entry.getValue();
        originalAccount = accountEntry.getOriginalAccount();
        replacementAccount = accountEntry.getReplacementAccount();

        // only print out accounts that were replaced and not missing a continuation account
        if (originalAccount.isContinuationAccountMissing() == false) {
            String nteMsg = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(PurapKeyConstants.KEY_ACCT_EXPIRED_NOTE);
            sb.append(MessageFormat.format(nteMsg, new Object[] { originalAccount.getAccountString(), replacementAccount.getAccountString() }));
        }

    }

    // if a note was created, add it to the document
    if (sb.toString().length() > 0) {
        try {
            Note resetNote = documentService.createNoteFromDocument(document, sb.toString());
            Principal kfs = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName(KFSConstants.SYSTEM_USER);
            resetNote.setAuthorUniversalIdentifier(kfs.getPrincipalId());
            document.addNote(resetNote);
        }
        catch (Exception e) {
            throw new RuntimeException(PurapConstants.REQ_UNABLE_TO_CREATE_NOTE + " " + e);
        }
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:47,代码来源:AccountsPayableServiceImpl.java

示例15: submit

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
@RequestMapping(params = "methodToCall=submit")
  public ModelAndView submit(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result, HttpServletRequest request, HttpServletResponse response) throws Exception {
MissedPunchForm missedPunchForm = (MissedPunchForm) form;
      MissedPunchBo aMissedPunch = missedPunchForm.getMissedPunch();
      DictionaryValidationResult validationResults = KRADServiceLocatorWeb.getDictionaryValidationService().validate(((MissedPunchForm) form).getMissedPunch());
  	if (validationResults.getNumberOfErrors() == 0) {
      	
      	// call customized validation on the missed punch before creating document
      	boolean validFlag = new MissedPunchDocumentRule().runValidation(aMissedPunch);
      	if(validFlag) {
           try {
               createDocument(missedPunchForm);
               save(missedPunchForm, result, request, response);
	
               if (StringUtils.isNotBlank(missedPunchForm.getMissedPunch().getNote())) {
                   Document doc = missedPunchForm.getDocument();
                   Note note = new Note();
                   note.setNoteText(missedPunchForm.getMissedPunch().getNote());
                   note.setAuthorUniversalIdentifier(HrContext.getPrincipalId());
                   note.setNotePostedTimestampToCurrent();
                   doc.setNotes(Collections.<Note>singletonList(note));
               }
               ModelAndView modelAndView = route(missedPunchForm, result, request, response);
               missedPunchForm.setMissedPunchSubmitted(true);
	
               return modelAndView;
	
           } catch (ValidationException exception) {
               //ignore
           }
      	}
      }
      return getUIFModelAndView(form);
  }
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:35,代码来源:MissedPunchDocumentController.java


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