Weitere Module
This commit is contained in:
parent
4cb63d7c3b
commit
93db501810
@ -30,8 +30,7 @@ import de.hsadmin.mods.user.UnixUser;
|
|||||||
@Table(name = "emailalias")
|
@Table(name = "emailalias")
|
||||||
@SequenceGenerator(name = "EMailAliasesSeqGen", sequenceName = "emailalias_emailalias_id_seq")
|
@SequenceGenerator(name = "EMailAliasesSeqGen", sequenceName = "emailalias_emailalias_id_seq")
|
||||||
@EntityInfo(name = "E-Mail-Alias")
|
@EntityInfo(name = "E-Mail-Alias")
|
||||||
@SearchFilter("pac = :loginUserPac OR "
|
@SearchFilter("obj.pac = :loginUserPac OR obj.pac.customer.name = :loginUserName")
|
||||||
+ "pac.customer.name = :loginUserName")
|
|
||||||
public class EMailAlias extends AbstractEntity implements Serializable {
|
public class EMailAlias extends AbstractEntity implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4711415079723587161L;
|
private static final long serialVersionUID = -4711415079723587161L;
|
||||||
@ -192,9 +191,9 @@ public class EMailAlias extends AbstractEntity implements Serializable {
|
|||||||
public static String restriction() {
|
public static String restriction() {
|
||||||
return
|
return
|
||||||
// all aliases of all pacs of customer
|
// all aliases of all pacs of customer
|
||||||
"pac.customer.name=:loginUserName OR " +
|
"obj.pac.customer.name=:loginUserName OR " +
|
||||||
// all aliases of packet admin
|
// all aliases of packet admin
|
||||||
"pac.name=:loginUserName";
|
"obj.pac.name=:loginUserName";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class EMailAliasModuleImpl extends AbstractModuleImpl {
|
|||||||
public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass,
|
public List<AbstractEntity> search(Class<? extends AbstractEntity> entityClass,
|
||||||
String condition, String orderBy) throws HSAdminException {
|
String condition, String orderBy) throws HSAdminException {
|
||||||
if (orderBy == null || orderBy.length() == 0) {
|
if (orderBy == null || orderBy.length() == 0) {
|
||||||
orderBy = "ORDER BY name ASC";
|
orderBy = "ORDER BY obj.name ASC";
|
||||||
}
|
}
|
||||||
return super.search(entityClass, condition, orderBy);
|
return super.search(entityClass, condition, orderBy);
|
||||||
}
|
}
|
||||||
|
@ -21,14 +21,14 @@ public class EMailAddressRemote extends AbstractRemote {
|
|||||||
String emailaddress = adr.getEMailAddress();
|
String emailaddress = adr.getEMailAddress();
|
||||||
String fulldomain = adr.getFullDomain();
|
String fulldomain = adr.getFullDomain();
|
||||||
map.put("id", Long.toString(id));
|
map.put("id", Long.toString(id));
|
||||||
map.put("domain", domain);
|
if (assertNotNull(domain)) map.put("domain", domain);
|
||||||
map.put("admin", admin);
|
if (assertNotNull(admin)) map.put("admin", admin);
|
||||||
map.put("pac", pac);
|
if (assertNotNull(pac)) map.put("pac", pac);
|
||||||
map.put("target", target);
|
if (assertNotNull(target)) map.put("target", target);
|
||||||
map.put("localpart", localpart);
|
if (assertNotNull(localpart)) map.put("localpart", localpart);
|
||||||
map.put("subdomain", subdomain);
|
if (assertNotNull(subdomain)) map.put("subdomain", subdomain);
|
||||||
map.put("emailaddress", emailaddress);
|
if (assertNotNull(emailaddress)) map.put("emailaddress", emailaddress);
|
||||||
map.put("fulldomain", fulldomain);
|
if (assertNotNull(fulldomain)) map.put("fulldomain", fulldomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -7,6 +7,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
import de.hsadmin.core.model.AbstractEntity;
|
import de.hsadmin.core.model.AbstractEntity;
|
||||||
import de.hsadmin.core.qserv.QueueTask;
|
import de.hsadmin.core.qserv.QueueTask;
|
||||||
|
import de.hsadmin.core.qserv.QueueTask.QueueTaskStatus;
|
||||||
|
import de.hsadmin.mods.user.UnixUser;
|
||||||
|
|
||||||
public class QueueTaskRemote extends AbstractRemote {
|
public class QueueTaskRemote extends AbstractRemote {
|
||||||
|
|
||||||
@ -21,11 +23,13 @@ public class QueueTaskRemote extends AbstractRemote {
|
|||||||
protected void entity2map(AbstractEntity entity, Map<String, String> resultMap) {
|
protected void entity2map(AbstractEntity entity, Map<String, String> resultMap) {
|
||||||
QueueTask task = (QueueTask) entity;
|
QueueTask task = (QueueTask) entity;
|
||||||
resultMap.put("id", Long.toString(task.getId()));
|
resultMap.put("id", Long.toString(task.getId()));
|
||||||
resultMap.put("status", task.getStatus().toString());
|
QueueTaskStatus status = task.getStatus();
|
||||||
resultMap.put("title", task.getTitle());
|
if (status != null) resultMap.put("status", status.toString());
|
||||||
resultMap.put("details", task.getDetails());
|
if (assertNotNull(task.getTitle())) resultMap.put("title", task.getTitle());
|
||||||
resultMap.put("exception", task.getException());
|
if (assertNotNull(task.getDetails())) resultMap.put("details", task.getDetails());
|
||||||
resultMap.put("user", task.getUser().getName());
|
if (assertNotNull(task.getException())) resultMap.put("exception", task.getException());
|
||||||
|
UnixUser user = task.getUser();
|
||||||
|
if (user != null) resultMap.put("user", user.getName());
|
||||||
Date started = task.getStarted();
|
Date started = task.getStarted();
|
||||||
if (assertNotNull(started)) {
|
if (assertNotNull(started)) {
|
||||||
resultMap.put("started", df.format(started));
|
resultMap.put("started", df.format(started));
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<context-param>
|
<context-param>
|
||||||
<description>HSAdmin Module</description>
|
<description>HSAdmin Module</description>
|
||||||
<param-name>hsarmodules</param-name>
|
<param-name>hsarmodules</param-name>
|
||||||
<param-value>de.hsadmin.web.DomainModule,de.hsadmin.web.EMailAddressModule,de.hsadmin.web.EMailAliasModule</param-value>
|
<param-value>de.hsadmin.web.UnixUserModule,de.hsadmin.web.DomainModule,de.hsadmin.web.EMailAddressModule,de.hsadmin.web.EMailAliasModule,de.hsadmin.web.QueueTaskModule</param-value>
|
||||||
</context-param>
|
</context-param>
|
||||||
|
|
||||||
<filter>
|
<filter>
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<classes dir="build/cls" />
|
<classes dir="build/cls" />
|
||||||
<classes dir="src">
|
<classes dir="src">
|
||||||
<include name="**/*.properties"/>
|
<include name="**/*.properties"/>
|
||||||
|
<include name="**/*.png"/>
|
||||||
</classes>
|
</classes>
|
||||||
</war>
|
</war>
|
||||||
</target>
|
</target>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package de.hsadmin.web;
|
package de.hsadmin.web;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@ -20,7 +21,7 @@ import com.vaadin.ui.themes.BaseTheme;
|
|||||||
import de.hsadmin.web.config.ModuleConfig;
|
import de.hsadmin.web.config.ModuleConfig;
|
||||||
import de.hsadmin.web.config.PropertyConfig;
|
import de.hsadmin.web.config.PropertyConfig;
|
||||||
|
|
||||||
public abstract class GenericModule {
|
public abstract class GenericModule implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private static final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
|
private static final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
|
||||||
|
@ -41,7 +41,7 @@ public class MainApplication extends Application implements HttpServletRequestLi
|
|||||||
public void init() {
|
public void init() {
|
||||||
localeConfig = new LocaleConfig(Locale.getDefault(), "main");
|
localeConfig = new LocaleConfig(Locale.getDefault(), "main");
|
||||||
remote = new Remote(this);
|
remote = new Remote(this);
|
||||||
Window mainWindow = new Window(localeConfig.getText("title"));
|
Window mainWindow = new Window(localeConfig.getText("applicationtitle"));
|
||||||
TabSheet tabs = new TabSheet();
|
TabSheet tabs = new TabSheet();
|
||||||
tabs.setWidth(100.0f, Sizeable.UNITS_PERCENTAGE);
|
tabs.setWidth(100.0f, Sizeable.UNITS_PERCENTAGE);
|
||||||
tabs.setHeight(680.0f, Sizeable.UNITS_PIXELS);
|
tabs.setHeight(680.0f, Sizeable.UNITS_PIXELS);
|
||||||
@ -56,9 +56,9 @@ public class MainApplication extends Application implements HttpServletRequestLi
|
|||||||
firstModule = module;
|
firstModule = module;
|
||||||
}
|
}
|
||||||
ModuleConfig moduleConfig = module.getModuleConfig();
|
ModuleConfig moduleConfig = module.getModuleConfig();
|
||||||
String label = moduleConfig.getLabel("title");
|
String label = moduleConfig.getLabel("moduletitle");
|
||||||
modules.put(label, module);
|
modules.put(label, module);
|
||||||
tabs.addTab(module.getComponent(), label, new ThemeResource(moduleConfig.getLabel("icon")));
|
tabs.addTab(module.getComponent(), label, new ThemeResource(moduleConfig.getLabel("moduleicon")));
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
31
hsarweb/src/de/hsadmin/web/QueueTaskModule.java
Normal file
31
hsarweb/src/de/hsadmin/web/QueueTaskModule.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package de.hsadmin.web;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import de.hsadmin.web.config.ModuleConfig;
|
||||||
|
import de.hsadmin.web.config.PropertyConfig;
|
||||||
|
|
||||||
|
public class QueueTaskModule extends GenericModule {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private ModuleConfig moduleConfig;
|
||||||
|
|
||||||
|
public QueueTaskModule() {
|
||||||
|
moduleConfig = new ModuleConfig("q");
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "id", Long.class, "", true, true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "title", String.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "status", String.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "started", Date.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "finished", Date.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "user", String.class, "", true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "details", String.class, "", true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "exception", String.class, "", true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModuleConfig getModuleConfig() {
|
||||||
|
return moduleConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
30
hsarweb/src/de/hsadmin/web/UnixUserModule.java
Normal file
30
hsarweb/src/de/hsadmin/web/UnixUserModule.java
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package de.hsadmin.web;
|
||||||
|
|
||||||
|
import de.hsadmin.web.config.ModuleConfig;
|
||||||
|
import de.hsadmin.web.config.PropertyConfig;
|
||||||
|
|
||||||
|
public class UnixUserModule extends GenericModule {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private ModuleConfig moduleConfig;
|
||||||
|
|
||||||
|
public UnixUserModule() {
|
||||||
|
moduleConfig = new ModuleConfig("user");
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "id", Long.class, "", true, true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "name", String.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "comment", String.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "shell", String.class, ""));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "userid", Long.class, "", true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "homedir", String.class, "", true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "pac", String.class, "", true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "quota_softlimit", Long.class, "", true));
|
||||||
|
moduleConfig.addProperty(new PropertyConfig(moduleConfig, "quota_hardlimit", Long.class, "", true));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModuleConfig getModuleConfig() {
|
||||||
|
return moduleConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
hsarweb/src/icons/database.png
Normal file
BIN
hsarweb/src/icons/database.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 390 B |
BIN
hsarweb/src/icons/database_key.png
Normal file
BIN
hsarweb/src/icons/database_key.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 764 B |
BIN
hsarweb/src/icons/table.png
Normal file
BIN
hsarweb/src/icons/table.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 566 B |
BIN
hsarweb/src/icons/table_key.png
Normal file
BIN
hsarweb/src/icons/table_key.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 746 B |
@ -4,5 +4,5 @@ user=admin
|
|||||||
pac=packet
|
pac=packet
|
||||||
hive=host
|
hive=host
|
||||||
since=connected since
|
since=connected since
|
||||||
title=domains
|
moduletitle=domains
|
||||||
icon=../runo/icons/16/document-web.png
|
moduleicon=../runo/icons/16/document-web.png
|
@ -4,5 +4,5 @@ user=Administrator
|
|||||||
pac=Paket
|
pac=Paket
|
||||||
hive=Server
|
hive=Server
|
||||||
since=aufgeschaltet seit
|
since=aufgeschaltet seit
|
||||||
title=Domains
|
moduletitle=Domains
|
||||||
icon=../runo/icons/16/document-web.png
|
moduleicon=../runo/icons/16/document-web.png
|
@ -7,5 +7,5 @@ target=target(s)
|
|||||||
admin=admin user
|
admin=admin user
|
||||||
pac=packet
|
pac=packet
|
||||||
fulldomain=full domain
|
fulldomain=full domain
|
||||||
title=email addresses
|
moduletitle=email addresses
|
||||||
icon=../runo/icons/16/email.png
|
moduleicon=../runo/icons/16/email.png
|
@ -7,5 +7,5 @@ target=Ziel(e)
|
|||||||
admin=Administrator
|
admin=Administrator
|
||||||
pac=Paket
|
pac=Paket
|
||||||
fulldomain=volle Domain
|
fulldomain=volle Domain
|
||||||
title=EMail Adressen
|
moduletitle=EMail Adressen
|
||||||
icon=../runo/icons/16/email.png
|
moduleicon=../runo/icons/16/email.png
|
@ -2,5 +2,5 @@ id=identifier
|
|||||||
name=name
|
name=name
|
||||||
target=target(s)
|
target=target(s)
|
||||||
pac=packet
|
pac=packet
|
||||||
title=email aliases
|
moduletitle=email aliases
|
||||||
icon=../runo/icons/16/email-send.png
|
moduleicon=../runo/icons/16/email-send.png
|
@ -2,5 +2,5 @@ id=Schl
|
|||||||
name=Alias
|
name=Alias
|
||||||
target=Ziel(e)
|
target=Ziel(e)
|
||||||
pac=Paket
|
pac=Paket
|
||||||
title=EMail Aliases
|
moduletitle=EMail Aliases
|
||||||
icon=../runo/icons/16/email-send.png
|
moduleicon=../runo/icons/16/email-send.png
|
@ -1 +1 @@
|
|||||||
title=HSAdmin Web Application
|
applicationtitle=HSAdmin Web Application
|
10
hsarweb/src/texts/q.properties
Normal file
10
hsarweb/src/texts/q.properties
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
id=identifier
|
||||||
|
title=title
|
||||||
|
status=status
|
||||||
|
started=started
|
||||||
|
finished=finished
|
||||||
|
user=user
|
||||||
|
details=details
|
||||||
|
exception=exception
|
||||||
|
moduletitle=queue tasks
|
||||||
|
moduleicon=../runo/icons/16/attention.png
|
10
hsarweb/src/texts/q_de.properties
Normal file
10
hsarweb/src/texts/q_de.properties
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
id=Schlüssel
|
||||||
|
title=Titel
|
||||||
|
status=Status
|
||||||
|
started=gestartet
|
||||||
|
finished=bearbeitet
|
||||||
|
user=Benutzer
|
||||||
|
details=Details
|
||||||
|
exception=Fehlermeldungen
|
||||||
|
moduletitle=Aufträge
|
||||||
|
moduleicon=../runo/icons/16/attention.png
|
11
hsarweb/src/texts/user.properties
Normal file
11
hsarweb/src/texts/user.properties
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
id=identifier
|
||||||
|
name=username
|
||||||
|
comment=comment
|
||||||
|
shell=shell
|
||||||
|
userid=numeric userid
|
||||||
|
homedir=home directory
|
||||||
|
pac=packet
|
||||||
|
quota_softlimit=quota soft limit
|
||||||
|
quota_hardlimit=quota hard limit
|
||||||
|
moduletitle=unix user
|
||||||
|
moduleicon=../runo/icons/16/users.png
|
11
hsarweb/src/texts/user_de.properties
Normal file
11
hsarweb/src/texts/user_de.properties
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
id=Schlüssel
|
||||||
|
name=Benutzername
|
||||||
|
comment=Beschreibung
|
||||||
|
shell=Unix Shell
|
||||||
|
userid=Numerische Id
|
||||||
|
homedir=Heimat Verzeichnis
|
||||||
|
pac=Paket
|
||||||
|
quota_softlimit=Weiche Quota
|
||||||
|
quota_hardlimit=Harte Quota
|
||||||
|
moduletitle=Unix Benutzer
|
||||||
|
moduleicon=../runo/icons/16/users.png
|
Loading…
Reference in New Issue
Block a user