001
014
015 package com.liferay.portal.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.model.RepositoryEntry;
020 import com.liferay.portal.service.ServiceContext;
021 import com.liferay.portal.service.base.RepositoryEntryLocalServiceBaseImpl;
022
023
027 public class RepositoryEntryLocalServiceImpl
028 extends RepositoryEntryLocalServiceBaseImpl {
029
030 public RepositoryEntry addRepositoryEntry(
031 long groupId, long repositoryId, String mappedId,
032 ServiceContext serviceContext)
033 throws SystemException {
034
035 long repositoryEntryId = counterLocalService.increment();
036
037 RepositoryEntry repositoryEntry = repositoryEntryPersistence.create(
038 repositoryEntryId);
039
040 repositoryEntry.setGroupId(groupId);
041 repositoryEntry.setUuid(serviceContext.getUuid());
042 repositoryEntry.setRepositoryId(repositoryId);
043 repositoryEntry.setMappedId(mappedId);
044
045 repositoryEntryPersistence.update(repositoryEntry);
046
047 return repositoryEntry;
048 }
049
050 public RepositoryEntry updateRepositoryEntry(
051 long repositoryEntryId, String mappedId)
052 throws PortalException, SystemException {
053
054 RepositoryEntry repositoryEntry =
055 repositoryEntryPersistence.findByPrimaryKey(repositoryEntryId);
056
057 repositoryEntry.setMappedId(mappedId);
058
059 repositoryEntryPersistence.update(repositoryEntry);
060
061 return repositoryEntry;
062 }
063
064 }