-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split the base model adapter factory and the custom implementation (#402
) So that the actual model classes can be separated from the base class. This means the model classes can now be used completely independently from the rest of the source code.
- Loading branch information
Carlos Munoz
authored
Sep 8, 2020
1 parent
e568787
commit d3dfb13
Showing
3 changed files
with
50 additions
and
38 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
pantheon-bundle/src/main/java/com/redhat/pantheon/model/CustomModelAdapterFactory.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,46 @@ | ||
package com.redhat.pantheon.model; | ||
|
||
import com.redhat.pantheon.model.api.SlingModelAdapterFactory; | ||
import org.apache.sling.api.adapter.AdapterFactory; | ||
import org.osgi.service.component.annotations.Component; | ||
|
||
import static org.apache.sling.api.adapter.AdapterFactory.ADAPTABLE_CLASSES; | ||
import static org.apache.sling.api.adapter.AdapterFactory.ADAPTER_CLASSES; | ||
|
||
/** | ||
* Custom {@link SlingModelAdapterFactory} for the Pantheon system. It lists all the | ||
* model classes which will be converted from the adaptTo invocations. | ||
*/ | ||
@Component( | ||
name = "Pantheon - SlingModel Adapter Factory", | ||
service = AdapterFactory.class, | ||
property = { | ||
ADAPTABLE_CLASSES + "=org.apache.sling.api.resource.Resource", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.Content", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.Product", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.ProductVersion", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.api.SlingModel", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.api.FileResource", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.assembly.Assembly", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.assembly.AssemblyLocale", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.assembly.AssemblyMetadata", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.assembly.AssemblyVariant", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.assembly.AssemblyVariants", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.assembly.AssemblyVersion", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.document.Document", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.document.DocumentLocale", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.document.DocumentMetadata", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.document.DocumentVariant", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.document.DocumentVariants", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.document.DocumentVersion", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.module.Module", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.module.ModuleLocale", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.module.ModuleMetadata", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.module.ModuleVariant", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.module.ModuleVariants", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.module.ModuleVersion", | ||
ADAPTER_CLASSES + "=com.redhat.pantheon.model.workspace.Workspace" | ||
} | ||
) | ||
public class CustomModelAdapterFactory extends SlingModelAdapterFactory { | ||
} |
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