src/main/java/gov/usgs/cida/pubs/busservice/mp/MpPublicationBusService.java
protected void defaultThumbnail(final MpPublication mpPub) {
		if (null != mpPub && null != mpPub.getId()) {
			Map<String, Object> filters = new HashMap<String, Object>();
			filters.put(MpPublicationLinkDao.LINK_TYPE_SEARCH, LinkType.THUMBNAIL);
			filters.put(MpPublicationLinkDao.PUB_SEARCH, mpPub.getId());
			List<MpPublicationLink> thumbnails = MpPublicationLink.getDao().getByMap(filters);
			if (thumbnails.isEmpty()) {
				MpPublicationLink thumbnail = new MpPublicationLink();
				thumbnail.setPublicationId(mpPub.getId());
				thumbnail.setLinkType(LinkType.getDao().getById(LinkType.THUMBNAIL.toString()));
				if (PubsUtils.isUsgsNumberedSeries(mpPub.getPublicationSubtype())
						|| PubsUtils.isUsgsUnnumberedSeries(mpPub.getPublicationSubtype())) {
					thumbnail.setUrl(configurationService.getWarehouseEndpoint() + MpPublicationLink.USGS_THUMBNAIL);
				} else {
					thumbnail.setUrl(configurationService.getWarehouseEndpoint() + MpPublicationLink.EXTERNAL_THUMBNAIL);
				}
				MpPublicationLink.getDao().add(thumbnail);
			}
		}
	}
/**
	 * For publicationLink, on publish, we create a placeholder thumbnail link if none already exist.
	 */
For publicationLink, on publish, we create a placeholder thumbnail link if none already exist.
For publicationLink on publish we create a placeholder thumbnail link if none already exist .
protected void defaultThumbnail(final MpPublication mpPub) {
		if (null != mpPub && null != mpPub.getId()) {
			Map<String, Object> filters = new HashMap<String, Object>();
			filters.put(MpPublicationLinkDao.LINK_TYPE_SEARCH, LinkType.THUMBNAIL);
			filters.put(MpPublicationLinkDao.PUB_SEARCH, mpPub.getId());
			List<MpPublicationLink> thumbnails = MpPublicationLink.getDao().getByMap(filters);
			if (thumbnails.isEmpty()) {
				MpPublicationLink thumbnail = new MpPublicationLink();
				thumbnail.setPublicationId(mpPub.getId());
				thumbnail.setLinkType(LinkType.getDao().getById(LinkType.THUMBNAIL.toString()));
				if (PubsUtils.isUsgsNumberedSeries(mpPub.getPublicationSubtype())
						|| PubsUtils.isUsgsUnnumberedSeries(mpPub.getPublicationSubtype())) {
					thumbnail.setUrl(configurationService.getWarehouseEndpoint() + MpPublicationLink.USGS_THUMBNAIL);
				} else {
					thumbnail.setUrl(configurationService.getWarehouseEndpoint() + MpPublicationLink.EXTERNAL_THUMBNAIL);
				}
				MpPublicationLink.getDao().add(thumbnail);
			}
		}
	}
protected void defaultThumbnail ( final MpPublication mpPub ) { if ( null != mpPub && null != mpPub . getId ( ) ) { Map < String , Object > filters = new HashMap < String , Object > ( ) ; filters . put ( MpPublicationLinkDao . LINK_TYPE_SEARCH , LinkType . THUMBNAIL ) ; filters . put ( MpPublicationLinkDao . PUB_SEARCH , mpPub . getId ( ) ) ; List < MpPublicationLink > thumbnails = MpPublicationLink . getDao ( ) . getByMap ( filters ) ; if ( thumbnails . isEmpty ( ) ) { MpPublicationLink thumbnail = new MpPublicationLink ( ) ; thumbnail . setPublicationId ( mpPub . getId ( ) ) ; thumbnail . setLinkType ( LinkType . getDao ( ) . getById ( LinkType . THUMBNAIL . toString ( ) ) ) ; if ( PubsUtils . isUsgsNumberedSeries ( mpPub . getPublicationSubtype ( ) ) || PubsUtils . isUsgsUnnumberedSeries ( mpPub . getPublicationSubtype ( ) ) ) { thumbnail . setUrl ( configurationService . getWarehouseEndpoint ( ) + MpPublicationLink . USGS_THUMBNAIL ) ; } else { thumbnail . setUrl ( configurationService . getWarehouseEndpoint ( ) + MpPublicationLink . EXTERNAL_THUMBNAIL ) ; } MpPublicationLink . getDao ( ) . add ( thumbnail ) ; } } }
For publicationLink, on publish, we create a placeholder thumbnail link if none already exist.
For publicationLink on publish we create a placeholder thumbnail link if none already exist .