Class CustomFormModel
java.lang.Object
it.uniroma2.art.semanticturkey.customform.CustomFormModel
-
Constructor Summary
ConstructorDescriptionCreates CustomFormModel at system levelCustomFormModel
(Project project, CustomFormModel systemCFModel) Creates CustomFormModel at project level -
Method Summary
Modifier and TypeMethodDescriptionaddFormsMapping
(org.eclipse.rdf4j.model.IRI resource, FormCollection formColl, boolean replace) Adds aFormsMapping
(mapping between resource andFormCollection
) to the configuration.createCustomFormGraph
(String id, String name, String description, String ref) createCustomFormNode
(String id, String name, String description, String ref) Creates and adds a FormCollection.void
deleteCustomForm
(CustomForm customForm, boolean deleteEmptyColl) Removes a CustomForm from the form collection of a projectvoid
deleteFormCollection
(FormCollection formColl) Removes aFormCollection
from the configuration and its file from file-systemReturns the broken CustomForms that are ignore during initializationgetCustomFormById
(String customFormId) Returns theCustomForm
with the given ID of the given projectgetCustomFormForResource
(org.eclipse.rdf4j.model.IRI resource) Returns all theCustomForm
for the given resource.getCustomFormGraphForResource
(org.eclipse.rdf4j.model.IRI resource) Returns all theCustomFormGraph
for the given resourceReturns all theCustomForm
sgetFormCollectionById
(String formCollId) Returns theFormCollection
with the given ID.getFormCollectionForResource
(org.eclipse.rdf4j.model.IRI resource) Given a resource URI (property or class) returns theFormCollection
linked to that resource in the configuration.Returns all theFormCollection
getFormMapping
(org.eclipse.rdf4j.model.IRI resource) Returns theFormsMapping
linked to the given resource.Returns theFormsMapping
s in the current project.void
removeFormsMapping
(org.eclipse.rdf4j.model.IRI resource) Removes aFormsMapping
(mapping between resource andFormCollection
) from the configuration.void
setReplace
(org.eclipse.rdf4j.model.IRI resource, boolean replace) toString()
void
updateCustomFormGraph
(CustomFormGraph customForm, String name, String description, String ref) void
updateCustomFormNode
(CustomFormNode customForm, String name, String description, String ref) void
updateFormCollection
(FormCollection formColl, Collection<CustomForm> customForms, Collection<org.eclipse.rdf4j.model.IRI> suggestions)
-
Constructor Details
-
CustomFormModel
Creates CustomFormModel at system level- Throws:
CustomFormParseException
-
CustomFormModel
public CustomFormModel(Project project, CustomFormModel systemCFModel) throws CustomFormParseException, CustomFormInitializationException Creates CustomFormModel at project level
-
-
Method Details
-
getBrokenCustomForms
Returns the broken CustomForms that are ignore during initialization- Returns:
-
getFormMappings
Returns theFormsMapping
s in the current project.- Returns:
-
getFormMapping
Returns theFormsMapping
linked to the given resource.null
if no FormsMapping is linked.- Parameters:
resource
-- Returns:
-
getFormCollections
Returns all theFormCollection
- Returns:
-
getFormCollectionForResource
Given a resource URI (property or class) returns theFormCollection
linked to that resource in the configuration.null
if no FormCollection is linked to the resource.- Parameters:
resource
-- Returns:
-
getFormCollectionById
Returns theFormCollection
with the given ID.null
if there is no FC with that id.- Parameters:
formCollId
-- Returns:
-
getCustomForms
Returns all theCustomForm
s- Returns:
-
getCustomFormById
Returns theCustomForm
with the given ID of the given project- Parameters:
customFormId
-- Returns:
-
getCustomFormForResource
Returns all theCustomForm
for the given resource. If the resource has not aFormCollection
linked, then returns an empty collection.- Parameters:
resource
-- Returns:
-
getCustomFormGraphForResource
public Collection<CustomFormGraph> getCustomFormGraphForResource(org.eclipse.rdf4j.model.IRI resource) Returns all theCustomFormGraph
for the given resource- Parameters:
resource
-- Returns:
-
addFormsMapping
public FormsMapping addFormsMapping(org.eclipse.rdf4j.model.IRI resource, FormCollection formColl, boolean replace) throws CustomFormException Adds aFormsMapping
(mapping between resource andFormCollection
) to the configuration. If aFormCollection
is already assigned to the given resource, throws aCustomFormException
.- Parameters:
resource
-formColl
-replace
-- Returns:
- Throws:
CustomFormException
-
createFormCollection
Creates and adds a FormCollection. If aFormCollection
with the same ID exists, aDuplicateIdException
is thrown- Parameters:
id
-- Returns:
- Throws:
DuplicateIdException
-
createCustomFormGraph
public CustomFormGraph createCustomFormGraph(String id, String name, String description, String ref) throws DuplicateIdException - Throws:
DuplicateIdException
-
createCustomFormNode
public CustomFormNode createCustomFormNode(String id, String name, String description, String ref) throws DuplicateIdException - Throws:
DuplicateIdException
-
setReplace
public void setReplace(org.eclipse.rdf4j.model.IRI resource, boolean replace) throws CustomFormException - Throws:
CustomFormException
-
removeFormsMapping
public void removeFormsMapping(org.eclipse.rdf4j.model.IRI resource) Removes aFormsMapping
(mapping between resource andFormCollection
) from the configuration.- Parameters:
resource
-
-
deleteFormCollection
Removes aFormCollection
from the configuration and its file from file-system- Parameters:
formColl
-
-
updateCustomFormNode
public void updateCustomFormNode(CustomFormNode customForm, String name, String description, String ref) -
updateCustomFormGraph
public void updateCustomFormGraph(CustomFormGraph customForm, String name, String description, String ref) -
deleteCustomForm
Removes a CustomForm from the form collection of a project- Parameters:
customForm
-deleteEmptyColl
- if true deletes FormCollection that are left empty after the deletion
-
updateFormCollection
public void updateFormCollection(FormCollection formColl, Collection<CustomForm> customForms, Collection<org.eclipse.rdf4j.model.IRI> suggestions) -
toString
-