no message
This commit is contained in:
44
src/_VisualDVM/Passes/Server/PublishServerObject.java
Normal file
44
src/_VisualDVM/Passes/Server/PublishServerObject.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package _VisualDVM.Passes.Server;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Objects.riDBObject;
|
||||
import _VisualDVM.Global;
|
||||
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;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user