Skip to content

Commit

Permalink
LPS-26863 Source Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Apr 26, 2012
1 parent 50f024b commit 4a9acbf
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ public DLFileVersion getFileVersion(String version)
getFileEntryId(), version);
}

public int getFileVersionCount(int status) throws SystemException {
return DLFileVersionLocalServiceUtil.getFileVersionCount(
getFileEntryId(), status);
}

public List<DLFileVersion> getFileVersions(int status)
throws SystemException {

return DLFileVersionLocalServiceUtil.getFileVersions(
getFileEntryId(), status);
}

public int getFileVersionsCount(int status) throws SystemException {
return DLFileVersionLocalServiceUtil.getFileVersionsCount(
getFileEntryId(), status);
}

public DLFolder getFolder() {
DLFolder dlFolder = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,10 @@ public void deleteFileVersion(long userId, long fileEntryId, String version)
}

try {
DLFileVersion fileVersion = dlFileVersionPersistence.findByF_V(
DLFileVersion dlFileVersion = dlFileVersionPersistence.findByF_V(
fileEntryId, version);

if (!fileVersion.isApproved()) {
if (!dlFileVersion.isApproved()) {
throw new InvalidFileVersionException(
"Cannot delete an unapproved file version");
}
Expand All @@ -616,10 +616,11 @@ public void deleteFileVersion(long userId, long fileEntryId, String version)
}
}

dlFileVersionPersistence.remove(fileVersion);
dlFileVersionPersistence.remove(dlFileVersion);

expandoValueLocalService.deleteValues(
DLFileVersion.class.getName(), fileVersion.getFileVersionId());
DLFileVersion.class.getName(),
dlFileVersion.getFileVersionId());

DLFileEntry dlFileEntry = dlFileEntryPersistence.findByPrimaryKey(
fileEntryId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ public DLFileVersion getFileVersionByUuidAndGroupId(
return dlFileVersionPersistence.fetchByUUID_G(uuid, groupId);
}

public int getFileVersionCount(long fileEntryId, int status)
throws SystemException {

return dlFileVersionPersistence.countByF_S(fileEntryId, status);
}

public List<DLFileVersion> getFileVersions(long fileEntryId, int status)
throws SystemException {

Expand All @@ -69,6 +63,12 @@ public List<DLFileVersion> getFileVersions(long fileEntryId, int status)
}
}

public int getFileVersionsCount(long fileEntryId, int status)
throws SystemException {

return dlFileVersionPersistence.countByF_S(fileEntryId, status);
}

public DLFileVersion getLatestFileVersion(
long fileEntryId, boolean excludeWorkingCopy)
throws PortalException, SystemException {
Expand Down
2 changes: 1 addition & 1 deletion portal-impl/src/content/Language.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,7 @@ file-size-was-not-specified-in-the-request=File size was not specified in the re
file-type-is-invalid=File type is invalid.
file-upload=File Upload
file-uploads=File Uploads
file-version-is-invalid=File Version is invalid.
file-version-is-invalid=File version is invalid.
file=File
files=Files
fill-out-the-following-form-to-get-driving-directions-to=Fill out the following form to get driving directions to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ public void deleteFileEntry(long folderId, String title)
deleteFileEntry(fileEntry.getFileEntryId());
}

public void deleteFileVersion(long fileEntryId, String version)
throws PortalException, SystemException {

public void deleteFileVersion(long fileEntryId, String version) {
throw new UnsupportedOperationException();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ FileVersion fileVersion = (FileVersion)objArray[1];
/>
</c:if>

<c:if test="<%= DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.DELETE) && (fileVersion.getStatus() == WorkflowConstants.STATUS_APPROVED) && (fileEntry.getModel() instanceof DLFileEntry) && (((DLFileEntry)fileEntry.getModel()).getFileVersionCount(WorkflowConstants.STATUS_APPROVED) > 1) %>">
<c:if test="<%= DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.DELETE) && (fileVersion.getStatus() == WorkflowConstants.STATUS_APPROVED) && (fileEntry.getModel() instanceof DLFileEntry) && (((DLFileEntry)fileEntry.getModel()).getFileVersionsCount(WorkflowConstants.STATUS_APPROVED) > 1) %>">
<portlet:actionURL var="deleteURL">
<portlet:param name="struts_action" value="/document_library/edit_file_entry" />
<portlet:param name="<%= Constants.CMD %>" value="<%= Constants.DELETE %>" />
Expand Down

0 comments on commit 4a9acbf

Please sign in to comment.