-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(multi-language) #30591 : Create endpoints to feed the Multi-lang…
…uage Component for the Edit Contentlet sidebar (#30606) ### Proposed Changes * A new Endpoint has been added to retrieve the languages that a contentlet is available on: `/api/v1/content//{identifier}/languages` * A new Endpoint has been added to retrieve the default language: `/api/v2/languages/_getdefault` * The existing Endpoint that retrieved the languages that an HTML Page is available on has been marked as `Deprecated` -- as well as its related code -- in order to favor the new Endpoint.
- Loading branch information
1 parent
20899cc
commit 65c8ebb
Showing
8 changed files
with
302 additions
and
340 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
26 changes: 26 additions & 0 deletions
26
dotCMS/src/main/java/com/dotcms/rest/api/v1/content/ExistingLanguagesForContentletView.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,26 @@ | ||
package com.dotcms.rest.api.v1.content; | ||
|
||
import com.dotmarketing.portlets.languagesmanager.model.Language; | ||
|
||
import java.io.Serializable; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* This View is used to indicate what language a | ||
* {@link com.dotmarketing.portlets.contentlet.model.Contentlet} is available on, and what language | ||
* it is not. This is particularly useful for the UI to be aware of such a situation, and then | ||
* provide the user the option to create it using that language. | ||
* | ||
* @author Jose Castro | ||
* @since Jan 5th, 2023 | ||
*/ | ||
public class ExistingLanguagesForContentletView extends HashMap<String, Object> implements Serializable { | ||
|
||
public ExistingLanguagesForContentletView(final Language language, final boolean translated) { | ||
final Map<String, Object> dataMap = new HashMap<>(language.toMap()); | ||
this.putAll(dataMap); | ||
this.put("translated", translated); | ||
} | ||
|
||
} |
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
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.