Skip to content

Lpd 49536 new api 3 #6212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/apps/depot/depot-api/bnd.bnd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Bundle-Name: Liferay Depot API
Bundle-SymbolicName: com.liferay.depot.api
Bundle-Version: 7.1.1
Bundle-Version: 7.2.0
Export-Package:\
com.liferay.depot.application,\
com.liferay.depot.configuration,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ public DepotEntry addDepotEntry(
ServiceContext serviceContext)
throws PortalException;

public DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode, Map<Locale, String> nameMap,
Map<Locale, String> descriptionMap,
Map<String, Boolean> depotAppCustomizationMap,
UnicodeProperties typeSettingsUnicodeProperties,
ServiceContext serviceContext)
throws PortalException;

/**
* Creates a new depot entry with the primary key. Does not add the depot entry to the database.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ public static DepotEntry addDepotEntry(
nameMap, descriptionMap, serviceContext);
}

public static DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode, Map<java.util.Locale, String> nameMap,
Map<java.util.Locale, String> descriptionMap,
Map<String, Boolean> depotAppCustomizationMap,
com.liferay.portal.kernel.util.UnicodeProperties
typeSettingsUnicodeProperties,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws PortalException {

return getService().addOrUpdateDepotEntry(
externalReferenceCode, nameMap, descriptionMap,
depotAppCustomizationMap, typeSettingsUnicodeProperties,
serviceContext);
}

/**
* Creates a new depot entry with the primary key. Does not add the depot entry to the database.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ public DepotEntry addDepotEntry(
nameMap, descriptionMap, serviceContext);
}

@Override
public DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode,
java.util.Map<java.util.Locale, String> nameMap,
java.util.Map<java.util.Locale, String> descriptionMap,
java.util.Map<String, Boolean> depotAppCustomizationMap,
com.liferay.portal.kernel.util.UnicodeProperties
typeSettingsUnicodeProperties,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {

return _depotEntryLocalService.addOrUpdateDepotEntry(
externalReferenceCode, nameMap, descriptionMap,
depotAppCustomizationMap, typeSettingsUnicodeProperties,
serviceContext);
}

/**
* Creates a new depot entry with the primary key. Does not add the depot entry to the database.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ public DepotEntry addDepotEntry(
ServiceContext serviceContext)
throws PortalException;

public DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode, Map<Locale, String> nameMap,
Map<Locale, String> descriptionMap,
Map<String, Boolean> depotAppCustomizationMap,
UnicodeProperties typeSettingsUnicodeProperties,
ServiceContext serviceContext)
throws PortalException;

public DepotEntry deleteDepotEntry(long depotEntryId)
throws PortalException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ public static DepotEntry addDepotEntry(
nameMap, descriptionMap, serviceContext);
}

public static DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode, Map<java.util.Locale, String> nameMap,
Map<java.util.Locale, String> descriptionMap,
Map<String, Boolean> depotAppCustomizationMap,
com.liferay.portal.kernel.util.UnicodeProperties
typeSettingsUnicodeProperties,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws PortalException {

return getService().addOrUpdateDepotEntry(
externalReferenceCode, nameMap, descriptionMap,
depotAppCustomizationMap, typeSettingsUnicodeProperties,
serviceContext);
}

public static DepotEntry deleteDepotEntry(long depotEntryId)
throws PortalException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ public DepotEntry addDepotEntry(
nameMap, descriptionMap, serviceContext);
}

@Override
public DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode,
java.util.Map<java.util.Locale, String> nameMap,
java.util.Map<java.util.Locale, String> descriptionMap,
java.util.Map<String, Boolean> depotAppCustomizationMap,
com.liferay.portal.kernel.util.UnicodeProperties
typeSettingsUnicodeProperties,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {

return _depotEntryService.addOrUpdateDepotEntry(
externalReferenceCode, nameMap, descriptionMap,
depotAppCustomizationMap, typeSettingsUnicodeProperties,
serviceContext);
}

@Override
public DepotEntry deleteDepotEntry(long depotEntryId)
throws com.liferay.portal.kernel.exception.PortalException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version 2.1.0
version 2.2.0
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,62 @@ public static com.liferay.depot.model.DepotEntry addDepotEntry(
}
}

public static com.liferay.depot.model.DepotEntry addOrUpdateDepotEntry(
HttpPrincipal httpPrincipal, String externalReferenceCode,
java.util.Map<java.util.Locale, String> nameMap,
java.util.Map<java.util.Locale, String> descriptionMap,
java.util.Map<String, Boolean> depotAppCustomizationMap,
com.liferay.portal.kernel.util.UnicodeProperties
typeSettingsUnicodeProperties,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException {

try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "addOrUpdateDepotEntry",
_addOrUpdateDepotEntryParameterTypes1);

MethodHandler methodHandler = new MethodHandler(
methodKey, externalReferenceCode, nameMap, descriptionMap,
depotAppCustomizationMap, typeSettingsUnicodeProperties,
serviceContext);

Object returnObj = null;

try {
returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
}
catch (Exception exception) {
if (exception instanceof
com.liferay.portal.kernel.exception.PortalException) {

throw (com.liferay.portal.kernel.exception.PortalException)
exception;
}

throw new com.liferay.portal.kernel.exception.SystemException(
exception);
}

return (com.liferay.depot.model.DepotEntry)returnObj;
}
catch (com.liferay.portal.kernel.exception.SystemException
systemException) {

_log.error(systemException, systemException);

throw systemException;
}
}

public static com.liferay.depot.model.DepotEntry deleteDepotEntry(
HttpPrincipal httpPrincipal, long depotEntryId)
throws com.liferay.portal.kernel.exception.PortalException {

try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "deleteDepotEntry",
_deleteDepotEntryParameterTypes1);
_deleteDepotEntryParameterTypes2);

MethodHandler methodHandler = new MethodHandler(
methodKey, depotEntryId);
Expand Down Expand Up @@ -133,7 +181,7 @@ public static com.liferay.depot.model.DepotEntry deleteDepotEntry(
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class,
"getCurrentAndGroupConnectedDepotEntries",
_getCurrentAndGroupConnectedDepotEntriesParameterTypes2);
_getCurrentAndGroupConnectedDepotEntriesParameterTypes3);

MethodHandler methodHandler = new MethodHandler(
methodKey, groupId, start, end);
Expand Down Expand Up @@ -174,7 +222,7 @@ public static com.liferay.depot.model.DepotEntry getDepotEntry(
try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "getDepotEntry",
_getDepotEntryParameterTypes3);
_getDepotEntryParameterTypes4);

MethodHandler methodHandler = new MethodHandler(
methodKey, depotEntryId);
Expand Down Expand Up @@ -216,7 +264,7 @@ public static com.liferay.depot.model.DepotEntry getDepotEntry(
try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "getGroupConnectedDepotEntries",
_getGroupConnectedDepotEntriesParameterTypes4);
_getGroupConnectedDepotEntriesParameterTypes5);

MethodHandler methodHandler = new MethodHandler(
methodKey, groupId, ddmStructuresAvailable, start, end);
Expand Down Expand Up @@ -258,7 +306,7 @@ public static com.liferay.depot.model.DepotEntry getDepotEntry(
try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "getGroupConnectedDepotEntries",
_getGroupConnectedDepotEntriesParameterTypes5);
_getGroupConnectedDepotEntriesParameterTypes6);

MethodHandler methodHandler = new MethodHandler(
methodKey, groupId, start, end);
Expand Down Expand Up @@ -300,7 +348,7 @@ public static int getGroupConnectedDepotEntriesCount(
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class,
"getGroupConnectedDepotEntriesCount",
_getGroupConnectedDepotEntriesCountParameterTypes6);
_getGroupConnectedDepotEntriesCountParameterTypes7);

MethodHandler methodHandler = new MethodHandler(methodKey, groupId);

Expand Down Expand Up @@ -339,7 +387,7 @@ public static com.liferay.depot.model.DepotEntry getGroupDepotEntry(
try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "getGroupDepotEntry",
_getGroupDepotEntryParameterTypes7);
_getGroupDepotEntryParameterTypes8);

MethodHandler methodHandler = new MethodHandler(methodKey, groupId);

Expand Down Expand Up @@ -384,7 +432,7 @@ public static com.liferay.depot.model.DepotEntry updateDepotEntry(
try {
MethodKey methodKey = new MethodKey(
DepotEntryServiceUtil.class, "updateDepotEntry",
_updateDepotEntryParameterTypes8);
_updateDepotEntryParameterTypes9);

MethodHandler methodHandler = new MethodHandler(
methodKey, depotEntryId, nameMap, descriptionMap,
Expand Down Expand Up @@ -427,29 +475,36 @@ public static com.liferay.depot.model.DepotEntry updateDepotEntry(
java.util.Map.class, java.util.Map.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class<?>[] _deleteDepotEntryParameterTypes1 =
private static final Class<?>[] _addOrUpdateDepotEntryParameterTypes1 =
new Class[] {
String.class, java.util.Map.class, java.util.Map.class,
java.util.Map.class,
com.liferay.portal.kernel.util.UnicodeProperties.class,
com.liferay.portal.kernel.service.ServiceContext.class
};
private static final Class<?>[] _deleteDepotEntryParameterTypes2 =
new Class[] {long.class};
private static final Class<?>[]
_getCurrentAndGroupConnectedDepotEntriesParameterTypes2 = new Class[] {
_getCurrentAndGroupConnectedDepotEntriesParameterTypes3 = new Class[] {
long.class, int.class, int.class
};
private static final Class<?>[] _getDepotEntryParameterTypes3 =
private static final Class<?>[] _getDepotEntryParameterTypes4 =
new Class[] {long.class};
private static final Class<?>[]
_getGroupConnectedDepotEntriesParameterTypes4 = new Class[] {
_getGroupConnectedDepotEntriesParameterTypes5 = new Class[] {
long.class, boolean.class, int.class, int.class
};
private static final Class<?>[]
_getGroupConnectedDepotEntriesParameterTypes5 = new Class[] {
_getGroupConnectedDepotEntriesParameterTypes6 = new Class[] {
long.class, int.class, int.class
};
private static final Class<?>[]
_getGroupConnectedDepotEntriesCountParameterTypes6 = new Class[] {
_getGroupConnectedDepotEntriesCountParameterTypes7 = new Class[] {
long.class
};
private static final Class<?>[] _getGroupDepotEntryParameterTypes7 =
private static final Class<?>[] _getGroupDepotEntryParameterTypes8 =
new Class[] {long.class};
private static final Class<?>[] _updateDepotEntryParameterTypes8 =
private static final Class<?>[] _updateDepotEntryParameterTypes9 =
new Class[] {
long.class, java.util.Map.class, java.util.Map.class,
java.util.Map.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,41 @@ public DepotEntry addDepotEntry(
return depotEntry;
}

@Override
public DepotEntry addOrUpdateDepotEntry(
String externalReferenceCode, Map<Locale, String> nameMap,
Map<Locale, String> descriptionMap,
Map<String, Boolean> depotAppCustomizationMap,
UnicodeProperties typeSettingsUnicodeProperties,
ServiceContext serviceContext)
throws PortalException {

DepotEntry depotEntry = null;

Group group = _groupLocalService.fetchGroupByExternalReferenceCode(
externalReferenceCode, serviceContext.getCompanyId());

if (group != null) {
depotEntry = getGroupDepotEntry(group.getGroupId());

depotEntry = updateDepotEntry(
depotEntry.getDepotEntryId(), nameMap, descriptionMap,
depotAppCustomizationMap, typeSettingsUnicodeProperties,
serviceContext);
}
else {
depotEntry = addDepotEntry(nameMap, descriptionMap, serviceContext);
}

group = depotEntry.getGroup();

group.setExternalReferenceCode(externalReferenceCode);

_groupLocalService.updateGroup(group);

return getDepotEntry(depotEntry.getDepotEntryId());
}

@Override
public DepotEntry deleteDepotEntry(DepotEntry depotEntry)
throws PortalException {
Expand Down
Loading