Fórum

Document Library Service - Parameter questions - repositoryid?

Schmock Orock Orockski, modificado 14 Anos atrás.

Document Library Service - Parameter questions - repositoryid?

New Member Postagens: 8 Data de Entrada: 20/08/09 Postagens Recentes
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:


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, modificado 13 Anos atrás.

RE: Document Library Service - Parameter questions - repositoryid?

New Member Postagens: 12 Data de Entrada: 06/01/11 Postagens Recentes
if you still have this problem:

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, modificado 13 Anos atrás.

RE: Document Library Service - Parameter questions - repositoryid?

New Member Postagens: 12 Data de Entrada: 06/01/11 Postagens Recentes
now something about 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, modificado 11 Anos atrás.

RE: Document Library Service - Parameter questions - repositoryid?

Junior Member Postagens: 38 Data de Entrada: 02/05/12 Postagens Recentes
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}

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 ?