Skip to content

Commit

Permalink
Introduce an interface for the DTO objects
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Apr 10, 2024
1 parent 17bd18f commit 177c25b
Show file tree
Hide file tree
Showing 75 changed files with 3,832 additions and 836 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* (c) Kitodo. Key to digital objects e. V. <[email protected]>
*
* This file is part of the Kitodo project.
*
* It is licensed under GNU General Public License version 3 or later.
*
* For the full copyright and license information, please read the
* GPL3-License.txt file that was distributed with this source code.
*/

package org.kitodo.data.interfaces;

import java.util.List;

/**
* Interface for batches of processes. Processes can be assembled in batches to
* take on or complete tasks for entire batches with a single user interaction.
*/
public interface BatchInterface extends DataInterface {

/**
* Returns the title of the batch. If no textual title was assigned, the
* title returned is “Batch ‹i›” with its database ID.
*
* @return the title of the batch
*/
String getTitle();

/**
* Gives the batch a text-based title.
*
* @param title
* title to use
*/
void setTitle(String title);

/**
* Returns the processes belonging to the batch. This list is not guaranteed
* to be in reliable order.
*
* @return the processes belonging to the batch
*/
List<ProcessInterface> getProcesses();

/**
* Sets the list of processes belonging to the batch. The list should not
* contain duplicates, and must not contain {@code null}s.
*
* @param processes
* contain the list of processes belonging to the batch to be
* determined
*/
void setProcesses(List<ProcessInterface> processes);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* (c) Kitodo. Key to digital objects e. V. <[email protected]>
*
* This file is part of the Kitodo project.
*
* It is licensed under GNU General Public License version 3 or later.
*
* For the full copyright and license information, please read the
* GPL3-License.txt file that was distributed with this source code.
*/

package org.kitodo.data.interfaces;

import java.util.List;

/**
* Interface for working with clients. Clients are related organizations that
* are allowed to use this instance of Production for their own projects. Users
* can work for several clients or just one.
*/
public interface ClientInterface extends DataInterface {

/**
* Returns the name of the client.
*
* @return the name of the client
*/
String getName();

/**
* Sets the name of the client.
*
* @param name
* the name of the client
*/
void setName(String name);

/**
* Specifies the users who work for this client. This list is not guaranteed
* to be in reliable order.
*
* @return the users who work for this client
*/
List<UserInterface> getUsers();

/**
* Sets the list of users working for this client. The list should not
* contain duplicates, and must not contain {@code null}s.
*
* @param users
* The users.
*/
void setUsers(List<UserInterface> users);

/**
* Returns the client's projects. This list is not guaranteed to be in
* reliable order.
*
* @return the client's projects
*/
List<ProjectInterface> getProjects();

/**
* Sets the lists of the client's projects. The list should not contain
* duplicates, and must not contain {@code null}s.
*
* @param projects
* The projects.
*/
void setProjects(List<ProjectInterface> projects);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* (c) Kitodo. Key to digital objects e. V. <[email protected]>
*
* This file is part of the Kitodo project.
*
* It is licensed under GNU General Public License version 3 or later.
*
* For the full copyright and license information, please read the
* GPL3-License.txt file that was distributed with this source code.
*/

package org.kitodo.data.interfaces;

/**
* Factory interface for the objects of the interface. An instance of the
* interface can be used to obtain objects of the interface. This allows new
* objects of the interface to be obtained without being aware of the
* implementation.
*/
public interface DataFactoryInterface {

/**
* Returns a new batch. The batch has not yet been persisted and does not
* yet have a database ID.
*
* @return a new batch
*/
BatchInterface newBatch();

/**
* Returns a new client. The client has not yet been persisted and does not
* yet have a database ID.
*
* @return a new client
*/
ClientInterface newClient();

/**
* Returns a new docket generation statement. The client has not yet been
* persisted and does not yet have a database ID.
*
* @return a new docket generation
*/
DocketInterface newDocket();

/**
* Returns a new store for a search string. The filter string has not yet
* been persisted and does not yet have a database ID.
*
* @return a new search string
*/
FilterInterface newFilter();

/**
* Returns a new process. The process has not yet been persisted and does
* not yet have a database ID.
*
* @return a new process
*/
ProcessInterface newProcess();

/**
* Returns a new project. The project has not yet been persisted and does
* not yet have a database ID.
*
* @return a new project
*/
ProjectInterface newProject();

/**
* Returns a new container for a property key-value pair. The property has
* not yet been persisted and does not yet have a database ID.
*
* @return a new property
*/
PropertyInterface newProperty();

/**
* Returns a new storage for the business domain specification. The ruleset
* has not yet been persisted and does not yet have a database ID.
*
* @return a new business specification
*/
RulesetInterface newRuleset();

/**
* Returns a new task. The task has not yet been persisted and does not yet
* have a database ID.
*
* @return a new task
*/
TaskInterface newTask();

/**
* Returns a new production template. The production template has not yet
* been persisted and does not yet have a database ID.
*
* @return a new template
*/
TemplateInterface newTemplate();

/**
* Returns a new user. The user has not yet been persisted and does not yet
* have a database ID.
*
* @return a new user
*/
UserInterface newUser();

/**
* Returns a new workflow. Returns a new workflow reference. The workflow
* has not yet been persisted in the database and does not yet have a record
* number.
*
* @return a new batch
*/
WorkflowInterface newWorkflow();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* (c) Kitodo. Key to digital objects e. V. <[email protected]>
*
* This file is part of the Kitodo project.
*
* It is licensed under GNU General Public License version 3 or later.
*
* For the full copyright and license information, please read the
* GPL3-License.txt file that was distributed with this source code.
*/

package org.kitodo.data.interfaces;

/**
* Meta interface over the data interfaces of this interface.
*/
public interface DataInterface {
/**
* Returns the record number of the object in the database. Can be
* {@code null} if the object has not yet been persisted.
*
* @return the record number
*/
Integer getId();

/**
* Sets the data record number of the object. This should only happen when
* data from a third-party source is integrated during operation, or in
* tests. Normally the data record number is assigned by the database when
* the object is saved.
*
* @param id
* data record number to use
*/
void setId(Integer id);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* (c) Kitodo. Key to digital objects e. V. <[email protected]>
*
* This file is part of the Kitodo project.
*
* It is licensed under GNU General Public License version 3 or later.
*
* For the full copyright and license information, please read the
* GPL3-License.txt file that was distributed with this source code.
*/

package org.kitodo.data.interfaces;

/**
* Interface for configuring the docket generator.
*/
public interface DocketInterface extends DataInterface {

/**
* Returns the name of the configuration file, without a path. The file must
* exist in the XSLT directory. The directory is set in the configuration
* file.
*
* @return the XSLT file name
*/
String getFile();

/**
* Sets the name of the configuration file. The file must exist in the XSLT
* directory. The file name must be specified without a path.
*
* @param file
* XSLT file name
*/
void setFile(String file);

/**
* Returns the display name of the configuration. It is displayed to the
* user in a selection dialog.
*
* @return the display name
*/
String getTitle();

/**
* Sets the display name of the configuration.
*
* @param title
* the display name
*/
void setTitle(String title);

/**
* Returns the client that this docket generator configuration is associated
* with. Technically, multiple client can use the same docket generator
* configuration (file), but they must be made available independently for
* each client using one configuration object each. This determines which
* docket generator configurations are visible to a client at all, and they
* can be named differently.
*
* @return client that this docket is associated with
*/
ClientInterface getClient();

/**
* Sets the client to which this docket generator configuration is
* associated.
*
* @param client
* client to which this docket is associated
*/
void setClient(ClientInterface client);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* (c) Kitodo. Key to digital objects e. V. <[email protected]>
*
* This file is part of the Kitodo project.
*
* It is licensed under GNU General Public License version 3 or later.
*
* For the full copyright and license information, please read the
* GPL3-License.txt file that was distributed with this source code.
*/

package org.kitodo.data.interfaces;

/**
* Interface for persisting search queries from users.
*/
public interface FilterInterface extends DataInterface {

/**
* Returns the search query string.
*
* @return the search query
*/
String getValue();

/**
* Sets the search query string.
*
* @param value
* query string to specify
*/
void setValue(String value);
}
Loading

0 comments on commit 177c25b

Please sign in to comment.