Files
VisualSapfor/src/_VisualDVM/Passes/Server/PublishServerObject.java

47 lines
1.6 KiB
Java
Raw Normal View History

2024-10-14 12:14:01 +03:00
package _VisualDVM.Passes.Server;
import Common.Database.Objects.DBObject;
import Common.Database.Objects.riDBObject;
import _VisualDVM.Global;
2024-10-09 22:21:57 +03:00
import _VisualDVM.Repository.RepositoryServer;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class PublishServerObject<S extends RepositoryServer, D extends DBObject> extends ServerObjectPass<S, D> {
public Object pk = null;
public PublishServerObject(S server_in, Class<D> d_in) {
super(server_in, d_in);
}
@Override
public String getIconPath() {
return "/icons/RedAdd.png";
}
//--
@Override
protected boolean canStart(Object... args) throws Exception {
pk = null;
if (Global.mainModule.getAccount().CheckRegistered(Log)) {
target = d.newInstance();
if (target instanceof riDBObject) {
riDBObject rTarget = (riDBObject) target;
rTarget.sender_name = Global.mainModule.getAccount().name;
rTarget.sender_address = Global.mainModule.getAccount().email;
}
return fillObjectFields();
}
return false;
}
2024-10-14 15:19:13 +03:00
protected String getEmail() {
return null;
}
//--
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, getEmail(), target));
pk = response.object;
}
@Override
protected void showDone() throws Exception {
super.showDone();
getDb().tables.get(d).ui_.Show(pk);
}
}