Foren
Document Library Service - Parameter questions - repositoryid?
Schmock Orock Orockski, geändert vor 14 Jahren.
Document Library Service - Parameter questions - repositoryid?
New Member Beiträge: 8 Beitrittsdatum: 20.08.09 Neueste Beiträge
Hello guys,
I have got a huge problem in understanding the document library service (DLService).
I just want to add a File to a certain library via addFile:
What the hell is the repositoryid? I cannot find any information about it (thanks to the non existing doc!)
Where is the targetfolder specified?
I have got every parameter information but the repositoryid. Could it be, that the repositoryid, is the FolderName? But that would be strange, because there is another method "addDirectory" (if I remember right) which also needs a repositoryid as a parameter.
EDIT:
Whats with the properties??
Thanks for help!
Bye
Thomas
I have got a huge problem in understanding the document library service (DLService).
I just want to add a File to a certain library via addFile:
static void addFile(long companyId, java.lang.String portletId, long groupId, long repositoryId, java.lang.String fileName, java.lang.String properties, java.lang.String[] tagsEntries, java.io.File file)
What the hell is the repositoryid? I cannot find any information about it (thanks to the non existing doc!)
Where is the targetfolder specified?
I have got every parameter information but the repositoryid. Could it be, that the repositoryid, is the FolderName? But that would be strange, because there is another method "addDirectory" (if I remember right) which also needs a repositoryid as a parameter.
EDIT:
Whats with the properties??
Thanks for help!
Bye
Thomas
Alexander Boldt, geändert vor 13 Jahren.
RE: Document Library Service - Parameter questions - repositoryid?
New Member Beiträge: 12 Beitrittsdatum: 06.01.11 Neueste Beiträge
if you still have this problem:
found this in DLFileEntryImpl
So RepoID is the folderId or groupID
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID -> 0L, this should be the case if it is the root folder.
In addition found that in
DLFolderImpl
bye, alex
found this in DLFileEntryImpl
public static long getRepositoryId(long groupId, long folderId) {
if (folderId == DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
return groupId;
}
else {
return folderId;
}
}
So RepoID is the folderId or groupID
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID -> 0L, this should be the case if it is the root folder.
In addition found that in
DLFolderImpl
public boolean isRoot() {
if (getParentFolderId() == DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
return true;
}
else {
return false;
}
}
bye, alex
Alexander Boldt, geändert vor 13 Jahren.
RE: Document Library Service - Parameter questions - repositoryid?
New Member Beiträge: 12 Beitrittsdatum: 06.01.11 Neueste Beiträge
now something about properties.
Look @DLFileEntryLocalServiceImpl
Properties -> fileEntry.getLuceneProperties()
now look @DLFileEntryImpl and you find what is properties.
Look @DLFileEntryLocalServiceImpl
dlLocalService.addFile(
user.getCompanyId(), PortletKeys.DOCUMENT_LIBRARY,
fileEntry.getGroupId(), fileEntry.getRepositoryId(), name, false,
fileEntryId, fileEntry.getLuceneProperties(),
fileEntry.getModifiedDate(), serviceContext, is);
Properties -> fileEntry.getLuceneProperties()
now look @DLFileEntryImpl and you find what is properties.
tom mahy, geändert vor 11 Jahren.
RE: Document Library Service - Parameter questions - repositoryid?
Junior Member Beiträge: 38 Beitrittsdatum: 02.05.12 Neueste Beiträge
Ive tried this and i get an error:
Caused by: com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=0, classNameId=10008, classPK=0}
What am i doing wrong ?
Caused by: com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=0, classNameId=10008, classPK=0}
SearchContext searchContext = new SearchContext();
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
Group group = GroupLocalServiceUtil.getGroup(themeDisplay.getScopeGroupId());
Hits hits = DLAppServiceUtil.search(group.getGroupId(), searchContext);
What am i doing wrong ?