-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2084 from KoukiHama/license-changelogs
feat(ui) : Add changelogs for license pages Reviewed by: [email protected] Tested by: [email protected]
- Loading branch information
Showing
11 changed files
with
246 additions
and
5 deletions.
There are no files selected for viewing
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
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
51 changes: 51 additions & 0 deletions
51
...licenses/src/main/java/org/eclipse/sw360/licenses/db/LicenseObligationListRepository.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,51 @@ | ||
/* | ||
* Copyright TOSHIBA CORPORATION, 2023. Part of the SW360 Portal Project. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.sw360.licenses.db; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import org.eclipse.sw360.datahandler.cloudantclient.DatabaseConnectorCloudant; | ||
import org.eclipse.sw360.datahandler.cloudantclient.DatabaseRepositoryCloudantClient; | ||
import org.eclipse.sw360.datahandler.thrift.licenses.LicenseObligationList; | ||
|
||
import org.ektorp.support.View; | ||
|
||
import com.cloudant.client.api.model.DesignDocument.MapReduce; | ||
|
||
/** | ||
* CRUD access for the LicenseObligationList class | ||
* | ||
* | ||
*/ | ||
public class LicenseObligationListRepository extends DatabaseRepositoryCloudantClient<LicenseObligationList> { | ||
|
||
private static final String BY_LICENSE_ID = | ||
"function(doc) {" + | ||
" if (doc.type == 'licenseObligationList') {" + | ||
" emit(doc.licenseId, null);" + | ||
" }" + | ||
"}"; | ||
|
||
private static final String ALL = "function(doc) { if (doc.type == 'licenseObligationList') emit(null, doc._id) }"; | ||
|
||
public LicenseObligationListRepository(DatabaseConnectorCloudant db) { | ||
super(db, LicenseObligationList.class); | ||
Map<String, MapReduce> views = new HashMap<String, MapReduce>(); | ||
views.put("byLicenseId", createMapReduce(BY_LICENSE_ID, null)); | ||
views.put("all", createMapReduce(ALL, null)); | ||
initStandardDesignDocument(views, db); | ||
} | ||
|
||
public Optional<LicenseObligationList> getObligationByLicenseid(String licenseId) { | ||
return queryView("byLicenseId", licenseId).stream().findFirst(); | ||
} | ||
} |
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
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
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
Oops, something went wrong.