Package com.contentful.java.cma.model
Class CMAUiExtension.Extension
- java.lang.Object
-
- com.contentful.java.cma.model.CMAUiExtension.Extension
-
- Enclosing class:
- CMAUiExtension
public static class CMAUiExtension.Extension extends java.lang.ObjectModel holding the actual information of the extension.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCMAUiExtension.Extension.FieldTypeHolder of one field type this extension should be used on.
-
Constructor Summary
Constructors Constructor Description Extension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMAUiExtension.ExtensionaddFieldType(Constants.CMAFieldType type)Add a new content type field type to this UI extension.java.util.List<CMAUiExtension.Extension.FieldType>getFieldTypes()java.lang.StringgetName()CMAUiExtensionParametersgetParameters()java.lang.StringgetSourceContent()java.lang.StringgetSourceUrl()booleanisOnSidebar()CMAUiExtension.ExtensionsetIsOnSidebar(boolean available)Update whether this element should be appearing on the sidebar.CMAUiExtension.ExtensionsetName(java.lang.String name)Update the name of this UI extension.CMAUiExtension.ExtensionsetParameters(CMAUiExtensionParameters parameters)Set the UI extension parameters.CMAUiExtension.ExtensionsetSourceContent(java.lang.String sourceContent)Updates the html sourcode.CMAUiExtension.ExtensionsetSourceUrl(java.lang.String sourceUrl)Link to the source code to be executed with this UI extension.java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- the name of this UI extension.
-
setName
public CMAUiExtension.Extension setName(java.lang.String name)
Update the name of this UI extension.- Parameters:
name- the new name.- Returns:
- this instance for chaining.
-
getFieldTypes
public java.util.List<CMAUiExtension.Extension.FieldType> getFieldTypes()
- Returns:
- a list of field types to be able to use this UI extension.
-
addFieldType
public CMAUiExtension.Extension addFieldType(Constants.CMAFieldType type)
Add a new content type field type to this UI extension.- Parameters:
type- the new type to be added.- Returns:
- this instance for chaining.
-
getSourceContent
public java.lang.String getSourceContent()
- Returns:
- html source code representing the UI extension.
-
setSourceContent
public CMAUiExtension.Extension setSourceContent(java.lang.String sourceContent)
Updates the html sourcode.Either this one or a link to an extension online needs to be present once sending to contentful.
May not be larger then 200kB.
- Parameters:
sourceContent- the actual html source code of this UI extension.- Returns:
- this instance for chaining.
- Throws:
java.lang.IllegalArgumentException- if source content is larger then 200kB.- See Also:
setSourceUrl(String)
-
getSourceUrl
public java.lang.String getSourceUrl()
- Returns:
- a url to the source code.
-
setSourceUrl
public CMAUiExtension.Extension setSourceUrl(java.lang.String sourceUrl)
Link to the source code to be executed with this UI extension.Either this one or the direct source code needs to be present once sending to contentful.
- Parameters:
sourceUrl- a link to an html page containing the source of the UI extension.- Returns:
- this instance for chaining.
- See Also:
setSourceContent(String)
-
isOnSidebar
public boolean isOnSidebar()
- Returns:
- is this element set to be appearing on the sidebar?
-
setIsOnSidebar
public CMAUiExtension.Extension setIsOnSidebar(boolean available)
Update whether this element should be appearing on the sidebar.- Parameters:
available- on sidebar or not?- Returns:
- this instance for chaining.
-
getParameters
public CMAUiExtensionParameters getParameters()
- Returns:
- the definitions of configuration parameters.
-
setParameters
public CMAUiExtension.Extension setParameters(CMAUiExtensionParameters parameters)
Set the UI extension parameters. You can define up to 8 installation and instance parameters for each UI Extension.- Parameters:
parameters- the installation or instance parameters.- Returns:
- this instance for chaining.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable string, representing the object.
-
-