use of org.liferay.jukebox.model.Album in project liferay-ide by liferay.
the class AlbumIndexer method doGetDocument.
@Override
protected Document doGetDocument(Object obj) throws Exception {
Album album = (Album) obj;
Document document = getBaseModelDocument(PORTLET_ID, album);
document.addDate(Field.MODIFIED_DATE, album.getModifiedDate());
document.addText(Field.TITLE, album.getName());
document.addKeyword("year", album.getYear());
Artist artist = ArtistLocalServiceUtil.getArtist(album.getArtistId());
document.addText("artist", artist.getName());
document.addKeyword("artistId", artist.getArtistId());
return document;
}
use of org.liferay.jukebox.model.Album in project liferay-ide by liferay.
the class ArtistLocalServiceImpl method deleteArtist.
@Indexable(type = IndexableType.DELETE)
public Artist deleteArtist(long artistId) throws PortalException, SystemException {
Artist artist = artistPersistence.findByPrimaryKey(artistId);
List<Album> albums = albumLocalService.getAlbumsByArtistId(artistId);
for (Album album : albums) {
albumLocalService.deleteAlbum(album.getAlbumId());
}
try {
PortletFileRepositoryUtil.deletePortletFileEntry(artist.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, String.valueOf(artistId));
} catch (Exception e) {
}
return artistPersistence.remove(artistId);
}
use of org.liferay.jukebox.model.Album in project liferay-ide by liferay.
the class AlbumPermission method check.
public static void check(PermissionChecker permissionChecker, long albumId, String actionId) throws PortalException, SystemException {
Album album = AlbumLocalServiceUtil.getAlbum(albumId);
check(permissionChecker, album, actionId);
}
use of org.liferay.jukebox.model.Album in project liferay-ide by liferay.
the class AlbumTrashHandler method getRestoreContainedModelLink.
@Override
public String getRestoreContainedModelLink(PortletRequest portletRequest, long classPK) throws PortalException, SystemException {
Album album = AlbumLocalServiceUtil.getAlbum(classPK);
PortletURL portletURL = getRestoreURL(portletRequest, classPK);
portletURL.setParameter("albumId", String.valueOf(album.getAlbumId()));
return portletURL.toString();
}
use of org.liferay.jukebox.model.Album 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;
}
Aggregations