use of com.liferay.portal.model.ContainerModel in project liferay-ide by liferay.
the class JukeBoxBaseTrashHandler method getParentContainerModels.
@Override
public List<ContainerModel> getParentContainerModels(long classPK) throws PortalException, SystemException {
List<ContainerModel> containerModels = new ArrayList<ContainerModel>();
ContainerModel containerModel = getParentContainerModel(classPK);
if (containerModel == null) {
return containerModels;
}
containerModels.add(containerModel);
while (containerModel.getParentContainerModelId() > 0) {
containerModel = getContainerModel(containerModel.getParentContainerModelId());
if (containerModel == null) {
break;
}
containerModels.add(containerModel);
}
return containerModels;
}
use of com.liferay.portal.model.ContainerModel in project liferay-ide by liferay.
the class ArtistClp method getTrashEntry.
@Override
public TrashEntry getTrashEntry() throws PortalException, SystemException {
if (!isInTrash()) {
return null;
}
TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(), getTrashEntryClassPK());
if (trashEntry != null) {
return trashEntry;
}
TrashHandler trashHandler = getTrashHandler();
if (!Validator.isNull(trashHandler.getContainerModelClassName())) {
ContainerModel containerModel = trashHandler.getParentContainerModel(this);
while (containerModel != null) {
if (containerModel instanceof TrashedModel) {
TrashedModel trashedModel = (TrashedModel) containerModel;
return trashedModel.getTrashEntry();
}
trashHandler = TrashHandlerRegistryUtil.getTrashHandler(trashHandler.getContainerModelClassName());
if (trashHandler == null) {
return null;
}
containerModel = trashHandler.getContainerModel(containerModel.getParentContainerModelId());
}
}
return null;
}
use of com.liferay.portal.model.ContainerModel in project liferay-ide by liferay.
the class SongModelImpl method getTrashEntry.
@Override
public TrashEntry getTrashEntry() throws PortalException, SystemException {
if (!isInTrash()) {
return null;
}
TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(), getTrashEntryClassPK());
if (trashEntry != null) {
return trashEntry;
}
TrashHandler trashHandler = getTrashHandler();
if (!Validator.isNull(trashHandler.getContainerModelClassName())) {
ContainerModel containerModel = trashHandler.getParentContainerModel(this);
while (containerModel != null) {
if (containerModel instanceof TrashedModel) {
TrashedModel trashedModel = (TrashedModel) containerModel;
return trashedModel.getTrashEntry();
}
trashHandler = TrashHandlerRegistryUtil.getTrashHandler(trashHandler.getContainerModelClassName());
if (trashHandler == null) {
return null;
}
containerModel = trashHandler.getContainerModel(containerModel.getParentContainerModelId());
}
}
return null;
}
use of com.liferay.portal.model.ContainerModel in project liferay-ide by liferay.
the class AlbumModelImpl method getTrashEntry.
@Override
public TrashEntry getTrashEntry() throws PortalException, SystemException {
if (!isInTrash()) {
return null;
}
TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(), getTrashEntryClassPK());
if (trashEntry != null) {
return trashEntry;
}
TrashHandler trashHandler = getTrashHandler();
if (!Validator.isNull(trashHandler.getContainerModelClassName())) {
ContainerModel containerModel = trashHandler.getParentContainerModel(this);
while (containerModel != null) {
if (containerModel instanceof TrashedModel) {
TrashedModel trashedModel = (TrashedModel) containerModel;
return trashedModel.getTrashEntry();
}
trashHandler = TrashHandlerRegistryUtil.getTrashHandler(trashHandler.getContainerModelClassName());
if (trashHandler == null) {
return null;
}
containerModel = trashHandler.getContainerModel(containerModel.getParentContainerModelId());
}
}
return null;
}
use of com.liferay.portal.model.ContainerModel in project liferay-ide by liferay.
the class ArtistModelImpl method getTrashEntry.
@Override
public TrashEntry getTrashEntry() throws PortalException, SystemException {
if (!isInTrash()) {
return null;
}
TrashEntry trashEntry = TrashEntryLocalServiceUtil.fetchEntry(getModelClassName(), getTrashEntryClassPK());
if (trashEntry != null) {
return trashEntry;
}
TrashHandler trashHandler = getTrashHandler();
if (!Validator.isNull(trashHandler.getContainerModelClassName())) {
ContainerModel containerModel = trashHandler.getParentContainerModel(this);
while (containerModel != null) {
if (containerModel instanceof TrashedModel) {
TrashedModel trashedModel = (TrashedModel) containerModel;
return trashedModel.getTrashEntry();
}
trashHandler = TrashHandlerRegistryUtil.getTrashHandler(trashHandler.getContainerModelClassName());
if (trashHandler == null) {
return null;
}
containerModel = trashHandler.getContainerModel(containerModel.getParentContainerModelId());
}
}
return null;
}
Aggregations