diff --git a/ccm-cms/src/main/java/org/librecms/pages/models/ContactableEntityModelBuilder.java b/ccm-cms/src/main/java/org/librecms/pages/models/ContactableEntityModelBuilder.java new file mode 100644 index 000000000..319a66707 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/pages/models/ContactableEntityModelBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2021 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.librecms.pages.models; + +import org.librecms.assets.ContactableEntity; + +/** + * + * @author Jens Pelzetter + */ +public class ContactableEntityModelBuilder + extends AbstractContactableEntityModelBuilder { + + @Override + public Class buildsAssetModelFor() { + return ContactableEntity.class; + } + + @Override + protected ContactableEntityModel buildModel() { + return new ContactableEntityModel(); + } + +} diff --git a/ccm-cms/src/main/java/org/librecms/pages/models/OrganizationModel.java b/ccm-cms/src/main/java/org/librecms/pages/models/OrganizationModel.java new file mode 100644 index 000000000..b0dc48765 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/pages/models/OrganizationModel.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2021 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.librecms.pages.models; + +import org.librecms.assets.Organization; + +/** + * + * @author Jens Pelzetter + */ +public class OrganizationModel extends ContactableEntityModel { + + private String name; + + @Override + public String getType() { + return Organization.class.getName(); + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + + +} diff --git a/ccm-cms/src/main/java/org/librecms/pages/models/OrganizationModelBuilder.java b/ccm-cms/src/main/java/org/librecms/pages/models/OrganizationModelBuilder.java new file mode 100644 index 000000000..883380a55 --- /dev/null +++ b/ccm-cms/src/main/java/org/librecms/pages/models/OrganizationModelBuilder.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2021 LibreCCM Foundation. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ +package org.librecms.pages.models; + +import org.librecms.assets.Organization; + +/** + * + * @author Jens Pelzetter + */ +public class OrganizationModelBuilder + extends AbstractContactableEntityModelBuilder { + + @Override + public Class buildsAssetModelFor() { + return Organization.class; + } + + @Override + protected OrganizationModel buildModel() { + return new OrganizationModel(); + } + + @Override + protected void addProperties( + final Organization organization, final OrganizationModel model + ) { + super.addProperties(organization, model); + model.setName(organization.getName()); + } + +}