38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
package Visual_DVM_2021.Passes.Server;
|
|
import Common.Current;
|
|
import Common.Database.riDBObject;
|
|
import Repository.RepositoryServer;
|
|
public class PublishServerObject<S extends RepositoryServer, D extends riDBObject> extends ServerObjectPass<S, D> {
|
|
protected 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 (Current.getAccount().CheckRegistered(Log)) {
|
|
target = d.newInstance();
|
|
target.sender_name = Current.getAccount().name;
|
|
target.sender_address = Current.getAccount().email;
|
|
return fillObjectFields();
|
|
}
|
|
return false;
|
|
}
|
|
//--
|
|
@Override
|
|
protected void ServerAction() throws Exception {
|
|
PublishObject(target);
|
|
pk = response.object;
|
|
}
|
|
@Override
|
|
protected void showDone() throws Exception {
|
|
super.showDone();
|
|
getDb().tables.get(d).ui_.Show(pk);
|
|
}
|
|
}
|