клонирование параметров тестирования двм/сапфора

This commit is contained in:
2024-10-03 14:36:45 +03:00
parent d18eb3327e
commit c077af6824
10 changed files with 113 additions and 54 deletions

View File

@@ -0,0 +1,35 @@
package Visual_DVM_2021.Passes.Server;
import Common.Current;
import Common.Database.DBObject;
import Common.Database.riDBObject;
import Repository.RepositoryServer;
public abstract class CloneServerObject<S extends RepositoryServer, D extends riDBObject> extends PublishServerObject<S, D> {
public D src;
@Override
public String getIconPath() {
return "/icons/MultiFiles.png";
}
public CloneServerObject(S server_in, Class<D> d_in) {
super(server_in, d_in);
}
protected abstract Current currentName();
@Override
protected boolean canStart(Object... args) throws Exception {
src=null;
if (!Current.Check(Log, currentName()))
return false;
//---------
pk = null;
if (Current.getAccount().CheckRegistered(Log)) {
target = d.newInstance();
target.SynchronizeFields(src=(D) Current.get(currentName()));
//единственное отличие клона - текущий автор
target.description+=" копия";
target.sender_name = Current.getAccount().name;
target.sender_address = Current.getAccount().email;
return true;
}
return false;
}
}