src/main/java/gov/usgs/cida/pubs/busservice/mp/MpBusService.java
protected void beginPublicationEdit(Integer publicationId) {
		if (null != publicationId) {
			//Look in MP to see if this key exists
			MpPublication mpPub = MpPublication.getDao().getById(publicationId);
			if (null == mpPub) {
				//Didn't find it in MP, look in PW
				PwPublication pwPub = PwPublication.getDao().getById(publicationId);
				if (null != pwPub) {
					//There it is, copy it!
					MpPublication.getDao().copyFromPw(publicationId);
					MpPublicationCostCenter.getDao().copyFromPw(publicationId);
					MpPublicationLink.getDao().copyFromPw(publicationId);
					MpPublicationContributor.getDao().copyFromPw(publicationId);
				}
			}
		   	MpPublication.getDao().lockPub(publicationId);
		}
	}
/**
	 * Make sure the pw publication information exists in mp before working with it in mp.
	 * @param publicationId
	 */
Make sure the pw publication information exists in mp before working with it in mp.
@param publicationId
Make sure the pw publication information exists in mp before working with it in mp . @param publicationId
protected void beginPublicationEdit(Integer publicationId) {
		if (null != publicationId) {
			MpPublication mpPub = MpPublication.getDao().getById(publicationId);
			if (null == mpPub) {
				PwPublication pwPub = PwPublication.getDao().getById(publicationId);
				if (null != pwPub) {
					MpPublication.getDao().copyFromPw(publicationId);
					MpPublicationCostCenter.getDao().copyFromPw(publicationId);
					MpPublicationLink.getDao().copyFromPw(publicationId);
					MpPublicationContributor.getDao().copyFromPw(publicationId);
				}
			}
		   	MpPublication.getDao().lockPub(publicationId);
		}
	}
protected void beginPublicationEdit ( Integer publicationId ) { if ( null != publicationId ) { MpPublication mpPub = MpPublication . getDao ( ) . getById ( publicationId ) ; if ( null == mpPub ) { PwPublication pwPub = PwPublication . getDao ( ) . getById ( publicationId ) ; if ( null != pwPub ) { MpPublication . getDao ( ) . copyFromPw ( publicationId ) ; MpPublicationCostCenter . getDao ( ) . copyFromPw ( publicationId ) ; MpPublicationLink . getDao ( ) . copyFromPw ( publicationId ) ; MpPublicationContributor . getDao ( ) . copyFromPw ( publicationId ) ; } } MpPublication . getDao ( ) . lockPub ( publicationId ) ; } }
Make sure the pw publication information exists in mp before working with it in mp.
Make sure the pw publication information exists in mp before working with it in mp .
//Look in MP to see if this key exists //Didn't find it in MP, look in PW //There it is, copy it!