use of org.liferay.jukebox.model.Artist in project liferay-ide by liferay.
the class ArtistIndexer method doReindex.
@Override
protected void doReindex(String className, long classPK) throws Exception {
Artist artist = ArtistLocalServiceUtil.getArtist(classPK);
doReindex(artist);
}
use of org.liferay.jukebox.model.Artist in project liferay-ide by liferay.
the class ArtistIndexer method doDelete.
@Override
protected void doDelete(Object obj) throws Exception {
Artist artist = (Artist) obj;
deleteDocument(artist.getCompanyId(), artist.getArtistId());
}
use of org.liferay.jukebox.model.Artist in project liferay-ide by liferay.
the class ArtistIndexer method doReindex.
@Override
protected void doReindex(Object obj) throws Exception {
Artist artist = (Artist) obj;
Document document = getDocument(artist);
SearchEngineUtil.updateDocument(getSearchEngineId(), artist.getCompanyId(), document);
}
use of org.liferay.jukebox.model.Artist in project liferay-ide by liferay.
the class SongIndexer method doGetDocument.
@Override
protected Document doGetDocument(Object obj) throws Exception {
Song song = (Song) obj;
Document document = getBaseModelDocument(PORTLET_ID, song);
document.addDate(Field.MODIFIED_DATE, song.getModifiedDate());
document.addText(Field.TITLE, song.getName());
Album album = AlbumLocalServiceUtil.getAlbum(song.getAlbumId());
document.addText("album", album.getName());
document.addKeyword("albumId", album.getAlbumId());
Artist artist = ArtistLocalServiceUtil.getArtist(song.getArtistId());
document.addText("artist", artist.getName());
document.addKeyword("artistId", artist.getArtistId());
return document;
}
use of org.liferay.jukebox.model.Artist in project liferay-ide by liferay.
the class AlbumStagedModelDataHandler method doExportStagedModel.
@Override
protected void doExportStagedModel(PortletDataContext portletDataContext, Album album) throws Exception {
Artist artist = ArtistLocalServiceUtil.getArtist(album.getArtistId());
Element albumElement = portletDataContext.getExportDataElement(album);
if (portletDataContext.getBooleanParameter(JukeboxPortletDataHandler.NAMESPACE, "artists")) {
// Artists are selected to export, making sure this album's artist
// is going to be exported as well
StagedModelDataHandlerUtil.exportReferenceStagedModel(portletDataContext, album, artist, PortletDataContext.REFERENCE_TYPE_DEPENDENCY);
} else {
// Artists are not exported - adding missing reference element to
// validate
portletDataContext.addReferenceElement(album, albumElement, artist, PortletDataContext.REFERENCE_TYPE_DEPENDENCY, true);
}
if (album.hasCustomImage()) {
FileEntry fileEntry = album.getCustomImage();
StagedModelDataHandlerUtil.exportReferenceStagedModel(portletDataContext, album, Album.class, fileEntry, FileEntry.class, PortletDataContext.REFERENCE_TYPE_WEAK);
}
portletDataContext.addClassedModel(albumElement, ExportImportPathUtil.getModelPath(album), album);
}
Aggregations