Package services.gui
Class ComponentService
- java.lang.Object
-
- services.gui.ComponentService
-
@Singleton public class ComponentService extends java.lang.ObjectService class for JATOS Controllers (not Publix).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComponentPropertiesbindToProperties(Component component)Componentclone(Component componentToBeCloned)Clones a Component entity.ComponentcloneWholeComponent(Component component)Does the same ascloneComponentand additionally clones the HTML file and changes the title.ComponentcreateAndPersistComponent(Study study, Component component)Initialise and persist the given Component.ComponentcreateAndPersistComponent(Study study, ComponentProperties componentProperties)Create and persist a Component with given properties.ComponentgetComponentFromIdOrUuid(java.lang.String idOrUuid)voidremove(Component component, User signedinUser)Remove Component: Remove it from the given study, remove all its ComponentResults, and remove the component itself.voidrenameHtmlFilePath(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.voidupdateComponentAfterEdit(Component component, ComponentProperties updatedProps)Update component's properties with the ones from updatedComponent, but not htmlFilePath and not active.voidvalidate(Component component)Validates the component by using the Component's model validation method.
-
-
-
Method Detail
-
clone
public Component clone(Component componentToBeCloned)
Clones a Component entity. Does not clone id, uuid, or date. Does not persist the clone. Does not clone the HTML file.
-
updateComponentAfterEdit
public void updateComponentAfterEdit(Component component, ComponentProperties updatedProps)
Update component's properties with the ones from updatedComponent, but not htmlFilePath and not active.
-
cloneWholeComponent
public Component cloneWholeComponent(Component component)
Does the same ascloneComponentand additionally clones the HTML file and changes the title.
-
bindToProperties
public ComponentProperties bindToProperties(Component component)
-
createAndPersistComponent
public Component createAndPersistComponent(Study study, Component component)
Initialise and persist the given Component. Updates its study.
-
createAndPersistComponent
public Component createAndPersistComponent(Study study, ComponentProperties componentProperties)
Create and persist a Component with given properties. Updates its study.
-
renameHtmlFilePath
public void renameHtmlFilePath(Component component, java.lang.String newHtmlFilePath, boolean htmlFileRename) throws java.io.IOException
Renames the path to the HTML file in the file system and persists the component's property.- Throws:
java.io.IOException
-
validate
public void validate(Component component) throws javax.validation.ValidationException
Validates the component by using the Component's model validation method. Throws ValidationException in case of an error.- Throws:
javax.validation.ValidationException
-
remove
public void remove(Component component, User signedinUser)
Remove Component: Remove it from the given study, remove all its ComponentResults, and remove the component itself.
-
getComponentFromIdOrUuid
public Component getComponentFromIdOrUuid(java.lang.String idOrUuid)
-
-