@Singleton
public class ComponentService
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
ComponentProperties |
bindToProperties(Component component) |
Component |
clone(Component componentToBeCloned)
Clones a Component entity.
|
Component |
cloneWholeComponent(Component component)
Does the same as
cloneComponent and additionally clones the HTML file and changes the
title. |
Component |
createAndPersistComponent(Study study,
Component component)
Initialise and persist the given Component.
|
Component |
createAndPersistComponent(Study study,
ComponentProperties componentProperties)
Create and persist a Component with given properties.
|
void |
remove(Component component,
User loggedinUser)
Remove Component: Remove it from the given study, remove all its ComponentResults, and remove the component
itself.
|
void |
renameHtmlFilePath(Component component,
java.lang.String newHtmlFilePath,
boolean htmlFileRename)
Renames the path to the HTML file in the file system and persists the component's property.
|
void |
updateComponentAfterEdit(Component component,
ComponentProperties updatedProps)
Update component's properties with the ones from updatedComponent, but not htmlFilePath and not active.
|
void |
validate(Component component)
Validates the component by using the Component's model validation method.
|
public Component clone(Component componentToBeCloned)
public void updateComponentAfterEdit(Component component, ComponentProperties updatedProps)
public Component cloneWholeComponent(Component component)
cloneComponent
and additionally clones the HTML file and changes the
title.public ComponentProperties bindToProperties(Component component)
public Component createAndPersistComponent(Study study, Component component)
public Component createAndPersistComponent(Study study, ComponentProperties componentProperties)
public void renameHtmlFilePath(Component component, java.lang.String newHtmlFilePath, boolean htmlFileRename) throws java.io.IOException
java.io.IOException
public void validate(Component component) throws javax.validation.ValidationException
javax.validation.ValidationException