-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPS-87625 Create DEDataLayout service
- Loading branch information
1 parent
63a0cd3
commit c671a2a
Showing
3 changed files
with
652 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...ne/data-engine-api/src/main/java/com/liferay/data/engine/service/DEDataLayoutService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
*/ | ||
|
||
package com.liferay.data.engine.service; | ||
|
||
import com.liferay.data.engine.exception.DEDataLayoutException; | ||
|
||
/** | ||
* Service interface for the {@link com.liferay.data.engine.model.DEDataLayout} | ||
* operations. | ||
* @review | ||
* @author Jeyvison Nascimento | ||
*/ | ||
public interface DEDataLayoutService { | ||
|
||
/** | ||
* Retrive a DEDataLayout | ||
* @param deDataLayoutGetRequest | ||
* @return The {@link DEDataLayoutGetResponse} object | ||
* @throws DEDataLayoutException | ||
* @review | ||
*/ | ||
public DEDataLayoutGetResponse execute( | ||
DEDataLayoutGetRequest deDataLayoutGetRequest) | ||
throws DEDataLayoutException; | ||
|
||
/** | ||
* Saves a DEDataLayout | ||
* @param deDataLayoutSaveRequest | ||
* @return The {@link DEDataLayoutSaveResponse} object | ||
* @throws DEDataLayoutException | ||
* @review | ||
*/ | ||
public DEDataLayoutSaveResponse execute( | ||
DEDataLayoutSaveRequest deDataLayoutSaveRequest) | ||
throws DEDataLayoutException; | ||
|
||
} |
106 changes: 106 additions & 0 deletions
106
...rvice/src/main/java/com/liferay/data/engine/internal/service/DEDataLayoutServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/** | ||
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
*/ | ||
|
||
package com.liferay.data.engine.internal.service; | ||
|
||
import com.liferay.data.engine.exception.DEDataLayoutException; | ||
import com.liferay.data.engine.internal.executor.DEDataLayoutGetRequestExecutor; | ||
import com.liferay.data.engine.internal.executor.DEDataLayoutSaveRequestExecutor; | ||
import com.liferay.data.engine.internal.io.DEDataLayoutDeserializerTracker; | ||
import com.liferay.data.engine.internal.io.DEDataLayoutSerializerTracker; | ||
import com.liferay.data.engine.service.DEDataLayoutGetRequest; | ||
import com.liferay.data.engine.service.DEDataLayoutGetResponse; | ||
import com.liferay.data.engine.service.DEDataLayoutSaveRequest; | ||
import com.liferay.data.engine.service.DEDataLayoutSaveResponse; | ||
import com.liferay.data.engine.service.DEDataLayoutService; | ||
import com.liferay.dynamic.data.mapping.service.DDMStructureLayoutLocalService; | ||
import com.liferay.dynamic.data.mapping.service.DDMStructureLocalService; | ||
import com.liferay.dynamic.data.mapping.service.DDMStructureVersionLocalService; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
|
||
/** | ||
* @author Jeyvison Nascimento | ||
*/ | ||
@Component(immediate = true, service = DEDataLayoutService.class) | ||
public class DEDataLayoutServiceImpl implements DEDataLayoutService { | ||
|
||
@Override | ||
public DEDataLayoutGetResponse execute( | ||
DEDataLayoutGetRequest deDataLayoutGetRequest) | ||
throws DEDataLayoutException { | ||
|
||
DEDataLayoutGetRequestExecutor deDataLayoutGetRequestExecutor = | ||
getDEDataLayoutGetRequestExecutor(); | ||
|
||
return deDataLayoutGetRequestExecutor.execute(deDataLayoutGetRequest); | ||
} | ||
|
||
@Override | ||
public DEDataLayoutSaveResponse execute( | ||
DEDataLayoutSaveRequest deDataLayoutSaveRequest) | ||
throws DEDataLayoutException { | ||
|
||
DEDataLayoutSaveRequestExecutor deDataLayoutSaveRequestExecutor = | ||
getDEDataLayoutSaveRequestExecutor(); | ||
|
||
return deDataLayoutSaveRequestExecutor.execute(deDataLayoutSaveRequest); | ||
} | ||
|
||
public DEDataLayoutGetRequestExecutor getDEDataLayoutGetRequestExecutor() { | ||
if (_deDataLayoutGetRequestExecutor == null) { | ||
_deDataLayoutGetRequestExecutor = | ||
new DEDataLayoutGetRequestExecutor( | ||
_ddmStructureLayoutLocalService, | ||
_ddmStructureVersionLocalService, | ||
_deDataLayoutDeserializerTracker); | ||
} | ||
|
||
return _deDataLayoutGetRequestExecutor; | ||
} | ||
|
||
public DEDataLayoutSaveRequestExecutor | ||
getDEDataLayoutSaveRequestExecutor() { | ||
|
||
if (_deDataLayoutSaveRequestExecutor == null) { | ||
_deDataLayoutSaveRequestExecutor = | ||
new DEDataLayoutSaveRequestExecutor( | ||
_ddmStructureLayoutLocalService, | ||
_ddmStructureVersionLocalService, _ddmStructureLocalService, | ||
_deDataLayoutSerializerTracker); | ||
} | ||
|
||
return _deDataLayoutSaveRequestExecutor; | ||
} | ||
|
||
@Reference | ||
private DDMStructureLayoutLocalService _ddmStructureLayoutLocalService; | ||
|
||
@Reference | ||
private DDMStructureLocalService _ddmStructureLocalService; | ||
|
||
@Reference | ||
private DDMStructureVersionLocalService _ddmStructureVersionLocalService; | ||
|
||
@Reference | ||
private DEDataLayoutDeserializerTracker _deDataLayoutDeserializerTracker; | ||
|
||
private DEDataLayoutGetRequestExecutor _deDataLayoutGetRequestExecutor; | ||
private DEDataLayoutSaveRequestExecutor _deDataLayoutSaveRequestExecutor; | ||
|
||
@Reference | ||
private DEDataLayoutSerializerTracker _deDataLayoutSerializerTracker; | ||
|
||
} |
Oops, something went wrong.