Permalink
Browse files

LPS-7736 manual

git-svn-id: svn://svn.liferay.com/repos/public/portal/trunk@45788 05bdf26c-840f-0410-9ced-eb539d925f36
  • Loading branch information...
1 parent 1835233 commit 4f1ad50a34dbd58726874df79d0bb9794e03e8f4 @lionah lionah committed Feb 10, 2010
@@ -1045,6 +1045,9 @@
<field name="name" type="String">
<hint name="max-length">255</hint>
</field>
+ <field name="description" type="String">
+ <hint-collection name="TEXTAREA" />
+ </field>
<field name="version" type="double" />
<field name="size" type="int" />
<field name="status" type="int" />
@@ -93,6 +93,7 @@ protected String fileUpload(
String name = fileName;
String title = fileName;
String description = StringPool.BLANK;
+ String versionDescription = StringPool.BLANK;
String extraSettings = StringPool.BLANK;
ServiceContext serviceContext = new ServiceContext();
@@ -102,7 +103,7 @@ protected String fileUpload(
DLFileEntryServiceUtil.addFileEntry(
group.getGroupId(), folderId, name, title, description,
- extraSettings, file, serviceContext);
+ versionDescription, extraSettings, file, serviceContext);
}
catch (Exception e) {
throw new FCKException(e);
@@ -215,6 +215,8 @@ protected void updateFileEntry(
String title = ParamUtil.getString(uploadRequest, "title");
String description = ParamUtil.getString(uploadRequest, "description");
+ String versionDescription = ParamUtil.getString(
+ uploadRequest, "versionDescription");
String extraSettings = PropertiesUtil.toString(
fileEntryForm.getExtraSettingsProperties());
@@ -234,7 +236,7 @@ protected void updateFileEntry(
DLFileEntry fileEntry = DLFileEntryServiceUtil.addFileEntry(
groupId, newFolderId, sourceFileName, title, description,
- extraSettings, file, serviceContext);
+ versionDescription, extraSettings, file, serviceContext);
AssetPublisherUtil.addAndStoreSelection(
actionRequest, DLFileEntry.class.getName(),
@@ -246,7 +248,8 @@ protected void updateFileEntry(
DLFileEntryServiceUtil.updateFileEntry(
groupId, folderId, newFolderId, name, sourceFileName, title,
- description, extraSettings, file, serviceContext);
+ description, versionDescription, extraSettings, file,
+ serviceContext);
}
AssetPublisherUtil.addRecentFolderId(
@@ -275,7 +275,7 @@ public static void importFileEntry(
userId, groupId, existingFileEntry.getFolderId(),
folderId, existingFileEntry.getName(),
fileEntry.getTitle(), fileEntry.getTitle(),
- fileEntry.getDescription(),
+ fileEntry.getDescription(), null,
fileEntry.getExtraSettings(), is,
fileEntry.getSize(), serviceContext);
}
@@ -284,15 +284,15 @@ public static void importFileEntry(
DLFileEntryLocalServiceUtil.addFileEntry(
fileEntry.getUuid(), userId, groupId, folderId,
fileEntry.getName(), fileEntry.getTitle(),
- fileEntry.getDescription(),
+ fileEntry.getDescription(), null,
fileEntry.getExtraSettings(), is,
fileEntry.getSize(), serviceContext);
}
}
else {
existingFileEntry = DLFileEntryLocalServiceUtil.addFileEntry(
null, userId, groupId, folderId, fileEntry.getName(),
- fileEntry.getTitle(), fileEntry.getDescription(),
+ fileEntry.getTitle(), fileEntry.getDescription(), null,
fileEntry.getExtraSettings(), is, fileEntry.getSize(),
serviceContext);
}
@@ -219,6 +219,7 @@
<column name="folderId" type="long" />
<column name="name" type="String" />
+ <column name="description" type="String" />
<column name="version" type="double" />
<column name="size" type="int" />
<column name="status" type="int" />
@@ -92,8 +92,8 @@
public DLFileEntry addFileEntry(
String uuid, long userId, long groupId, long folderId, String name,
- String title, String description, String extraSettings,
- byte[] bytes, ServiceContext serviceContext)
+ String title, String description, String versionDescription,
+ String extraSettings, byte[] bytes, ServiceContext serviceContext)
throws PortalException, SystemException {
if (!PropsValues.WEBDAV_LITMUS) {
@@ -106,13 +106,14 @@ public DLFileEntry addFileEntry(
return addFileEntry(
uuid, userId, groupId, folderId, name, title, description,
- extraSettings, is, bytes.length, serviceContext);
+ versionDescription, extraSettings, is, bytes.length,
+ serviceContext);
}
public DLFileEntry addFileEntry(
String uuid, long userId, long groupId, long folderId, String name,
- String title, String description, String extraSettings, File file,
- ServiceContext serviceContext)
+ String title, String description, String versionDescription,
+ String extraSettings, File file, ServiceContext serviceContext)
throws PortalException, SystemException {
if (!PropsValues.WEBDAV_LITMUS) {
@@ -127,7 +128,8 @@ public DLFileEntry addFileEntry(
return addFileEntry(
uuid, userId, groupId, folderId, name, title, description,
- extraSettings, is, file.length(), serviceContext);
+ versionDescription, extraSettings, is, file.length(),
+ serviceContext);
}
catch (FileNotFoundException fnfe) {
throw new FileSizeException();
@@ -136,8 +138,9 @@ public DLFileEntry addFileEntry(
public DLFileEntry addFileEntry(
String uuid, long userId, long groupId, long folderId, String name,
- String title, String description, String extraSettings,
- InputStream is, long size, ServiceContext serviceContext)
+ String title, String description, String versionDescription,
+ String extraSettings, InputStream is, long size,
+ ServiceContext serviceContext)
throws PortalException, SystemException {
// File entry
@@ -205,7 +208,7 @@ public DLFileEntry addFileEntry(
// File version
addFileVersion(
- user, fileEntry, fileEntry.getVersion(),
+ user, fileEntry, fileEntry.getVersion(), null,
serviceContext.getStatus());
// Folder
@@ -306,20 +309,22 @@ public void addFileEntryResources(
public DLFileEntry addOrOverwriteFileEntry(
long userId, long groupId, long folderId, String name,
String sourceName, String title, String description,
- String extraSettings, File file, ServiceContext serviceContext)
+ String versionDescription, String extraSettings, File file,
+ ServiceContext serviceContext)
throws PortalException, SystemException {
try {
dlFileEntryPersistence.findByG_F_T(groupId, folderId, title);
return updateFileEntry(
userId, groupId, folderId, folderId, name, sourceName, title,
- description, extraSettings, file, serviceContext);
+ description, versionDescription, extraSettings, file,
+ serviceContext);
}
catch (NoSuchFileEntryException nsfee) {
return addFileEntry(
null, userId, groupId, folderId, name, title, description,
- extraSettings, file, serviceContext);
+ versionDescription, extraSettings, file, serviceContext);
}
}
@@ -685,8 +690,8 @@ public void updateAsset(
public DLFileEntry updateFileEntry(
long userId, long groupId, long folderId, long newFolderId,
String name, String sourceFileName, String title,
- String description, String extraSettings, byte[] bytes,
- ServiceContext serviceContext)
+ String description, String versionDescription, String extraSettings,
+ byte[] bytes, ServiceContext serviceContext)
throws PortalException, SystemException {
InputStream is = null;
@@ -699,14 +704,15 @@ public DLFileEntry updateFileEntry(
return updateFileEntry(
userId, groupId, folderId, newFolderId, name, sourceFileName, title,
- description, extraSettings, is, size, serviceContext);
+ description, versionDescription, extraSettings, is, size,
+ serviceContext);
}
public DLFileEntry updateFileEntry(
long userId, long groupId, long folderId, long newFolderId,
String name, String sourceFileName, String title,
- String description, String extraSettings, File file,
- ServiceContext serviceContext)
+ String description, String versionDescription, String extraSettings,
+ File file, ServiceContext serviceContext)
throws PortalException, SystemException {
try {
@@ -720,7 +726,8 @@ public DLFileEntry updateFileEntry(
return updateFileEntry(
userId, groupId, folderId, newFolderId, name, sourceFileName,
- title, description, extraSettings, is, size, serviceContext);
+ title, description, versionDescription, extraSettings, is, size,
+ serviceContext);
}
catch (FileNotFoundException fnfe) {
throw new NoSuchFileException();
@@ -730,8 +737,8 @@ public DLFileEntry updateFileEntry(
public DLFileEntry updateFileEntry(
long userId, long groupId, long folderId, long newFolderId,
String name, String sourceFileName, String title,
- String description, String extraSettings, InputStream is, long size,
- ServiceContext serviceContext)
+ String description, String versionDescription, String extraSettings,
+ InputStream is, long size, ServiceContext serviceContext)
throws PortalException, SystemException {
// File entry
@@ -940,7 +947,9 @@ public DLFileEntry updateFileEntry(
return fileEntry;
}
- addFileVersion(user, fileEntry, newVersion, serviceContext.getStatus());
+ addFileVersion(
+ user, fileEntry, newVersion, versionDescription,
+ serviceContext.getStatus());
// File entry
@@ -1089,7 +1098,8 @@ else if (fileEntry.getVersion() == 0) {
}
protected void addFileVersion(
- User user, DLFileEntry fileEntry, double version, int status)
+ User user, DLFileEntry fileEntry, double version,
+ String description, int status)
throws SystemException {
long fileVersionId = counterLocalService.increment();
@@ -1113,6 +1123,7 @@ protected void addFileVersion(
fileVersion.setCreateDate(fileEntry.getModifiedDate());
fileVersion.setFolderId(fileEntry.getFolderId());
fileVersion.setName(fileEntry.getName());
+ fileVersion.setDescription(description);
fileVersion.setVersion(version);
fileVersion.setSize(fileEntry.getSize());
fileVersion.setStatus(status);
@@ -54,30 +54,30 @@
public DLFileEntry addFileEntry(
long groupId, long folderId, String name, String title,
- String description, String extraSettings, byte[] bytes,
- ServiceContext serviceContext)
+ String description, String versionDescription, String extraSettings,
+ byte[] bytes, ServiceContext serviceContext)
throws PortalException, SystemException {
DLFolderPermission.check(
getPermissionChecker(), groupId, folderId, ActionKeys.ADD_DOCUMENT);
return dlFileEntryLocalService.addFileEntry(
null, getUserId(), groupId, folderId, name, title, description,
- extraSettings, bytes, serviceContext);
+ versionDescription, extraSettings, bytes, serviceContext);
}
public DLFileEntry addFileEntry(
long groupId, long folderId, String name, String title,
- String description, String extraSettings, File file,
- ServiceContext serviceContext)
+ String description, String versionDescription, String extraSettings,
+ File file, ServiceContext serviceContext)
throws PortalException, SystemException {
DLFolderPermission.check(
getPermissionChecker(), groupId, folderId, ActionKeys.ADD_DOCUMENT);
return dlFileEntryLocalService.addFileEntry(
null, getUserId(), groupId, folderId, name, title, description,
- extraSettings, file, serviceContext);
+ versionDescription, extraSettings, file, serviceContext);
}
public void deleteFileEntry(long groupId, long folderId, String name)
@@ -281,7 +281,8 @@ public void unlockFileEntry(
public DLFileEntry updateFileEntry(
long groupId, long folderId, long newFolderId, String name,
String sourceFileName, String title, String description,
- String extraSettings, byte[] bytes, ServiceContext serviceContext)
+ String versionDescription, String extraSettings, byte[] bytes,
+ ServiceContext serviceContext)
throws PortalException, SystemException {
DLFileEntryPermission.check(
@@ -301,8 +302,8 @@ public DLFileEntry updateFileEntry(
try {
fileEntry = dlFileEntryLocalService.updateFileEntry(
getUserId(), groupId, folderId, newFolderId, name,
- sourceFileName, title, description, extraSettings, bytes,
- serviceContext);
+ sourceFileName, title, description, versionDescription,
+ extraSettings, bytes, serviceContext);
}
finally {
if (!hasLock) {
@@ -319,7 +320,8 @@ public DLFileEntry updateFileEntry(
public DLFileEntry updateFileEntry(
long groupId, long folderId, long newFolderId, String name,
String sourceFileName, String title, String description,
- String extraSettings, File file, ServiceContext serviceContext)
+ String versionDescription, String extraSettings, File file,
+ ServiceContext serviceContext)
throws PortalException, SystemException {
DLFileEntryPermission.check(
@@ -339,8 +341,8 @@ public DLFileEntry updateFileEntry(
try {
fileEntry = dlFileEntryLocalService.updateFileEntry(
getUserId(), groupId, folderId, newFolderId, name,
- sourceFileName, title, description, extraSettings, file,
- serviceContext);
+ sourceFileName, title, description, versionDescription,
+ extraSettings, file, serviceContext);
}
finally {
if (!hasLock) {
@@ -412,7 +412,7 @@ protected void copyFolder(
dlFileEntryService.addFileEntry(
destFolder.getGroupId(), destFolder.getFolderId(), name, title,
- description, extraSettings, file, serviceContext);
+ description, null, extraSettings, file, serviceContext);
file.delete();
}
@@ -260,6 +260,7 @@ public void getParentFolderIds(
long folderId = fileEntry.getFolderId();
String name = fileEntry.getName();
String description = fileEntry.getDescription();
+ String versionDescription = StringPool.BLANK;
String extraSettings = fileEntry.getExtraSettings();
InputStream is = DLFileEntryLocalServiceUtil.getFileAsStream(
@@ -276,7 +277,8 @@ public void getParentFolderIds(
fileEntry = DLFileEntryServiceUtil.updateFileEntry(
groupId, folderId, newParentFolderId, name, newName, newName,
- description, extraSettings, bytes, serviceContext);
+ description, versionDescription, extraSettings, bytes,
+ serviceContext);
Tree documentTree = getFileEntryTree(
fileEntry, newParentFolderPath);
@@ -312,6 +314,7 @@ public void putDocument(SharepointRequest sharepointRequest)
String name = getResourceName(documentPath);
String title = name;
String description = StringPool.BLANK;
+ String versionDescription = StringPool.BLANK;
String extraSettings = StringPool.BLANK;
ServiceContext serviceContext = new ServiceContext();
@@ -333,8 +336,8 @@ public void putDocument(SharepointRequest sharepointRequest)
DLFileEntryServiceUtil.updateFileEntry(
groupId, parentFolderId, parentFolderId, name, title, title,
- description, extraSettings, sharepointRequest.getBytes(),
- serviceContext);
+ description, versionDescription, extraSettings,
+ sharepointRequest.getBytes(), serviceContext);
}
catch (NoSuchFileEntryException nsfee) {
File file = FileUtil.createTempFile(FileUtil.getExtension(name));
@@ -343,7 +346,7 @@ public void putDocument(SharepointRequest sharepointRequest)
DLFileEntryServiceUtil.addFileEntry(
groupId, parentFolderId, name, title, description,
- extraSettings, file, serviceContext);
+ versionDescription, extraSettings, file, serviceContext);
}
}
Oops, something went wrong.

0 comments on commit 4f1ad50

Please sign in to comment.