split event listeners and made xml elements for event en actions on back/frontend
This commit is contained in:
parent
3d0d609462
commit
a51eeeb254
26 changed files with 559 additions and 123 deletions
|
|
@ -49,11 +49,13 @@ import javax.persistence.EntityManager;
|
|||
|
||||
import com.idcanet.vasc.backends.jpa.EntityManagerProvider;
|
||||
import com.idcanet.vasc.core.VascBackend;
|
||||
import com.idcanet.vasc.core.VascBackendControllerLocal;
|
||||
import com.idcanet.vasc.core.VascController;
|
||||
import com.idcanet.vasc.core.VascEntry;
|
||||
import com.idcanet.vasc.impl.DefaultVascBackedEntryFinalizer;
|
||||
import com.idcanet.vasc.impl.DefaultVascEntryController;
|
||||
import com.idcanet.vasc.impl.DefaultVascFactory;
|
||||
import com.idcanet.vasc.impl.VascBackendProxyEventExecutor;
|
||||
import com.idcanet.vasc.impl.actions.AddRowAction;
|
||||
import com.idcanet.vasc.impl.actions.CSVExportGlobalAction;
|
||||
import com.idcanet.vasc.impl.actions.DeleteRowAction;
|
||||
|
|
@ -91,18 +93,16 @@ public class VascServiceManagerImpl implements VascServiceManager.IRemote,VascSe
|
|||
@PostConstruct
|
||||
public void loadAll() {
|
||||
logger.fine("VascServiceManager created now loading resources...");
|
||||
try {
|
||||
long s = System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
Map<String,String> keys = loadKeys();
|
||||
for (String key:keys.keySet()) {
|
||||
String value = keys.get(key);
|
||||
if ("persistenceUnit".equals(key)) {
|
||||
logger.info("getting EntityManager: "+value);
|
||||
logger.fine("getting EntityManager: "+value);
|
||||
entityManager = (EntityManager)new InitialContext().lookup(value);
|
||||
}
|
||||
if ("xpqlController".equals(key)) {
|
||||
logger.info("getting XpqlQueryManagerLocal: "+value);
|
||||
logger.fine("getting XpqlQueryManagerLocal: "+value);
|
||||
xpqlController = (XpqlQueryManager)new InitialContext().lookup(value);
|
||||
}
|
||||
if ("i18nBundle".equals(key)) {
|
||||
|
|
@ -119,9 +119,10 @@ public class VascServiceManagerImpl implements VascServiceManager.IRemote,VascSe
|
|||
if (resourceBundle==null) {
|
||||
new NullPointerException("Have no resourceBundle");
|
||||
}
|
||||
long s = System.currentTimeMillis();
|
||||
|
||||
// get local jvm plugging controller
|
||||
VascController c = DefaultVascFactory.getDefaultVascController(22l, "test", "login");
|
||||
VascController c = DefaultVascFactory.getDefaultVascController(0l, "nobody", "NO_ROLE");
|
||||
|
||||
for (String key:keys.keySet()) {
|
||||
String value = keys.get(key);
|
||||
|
|
@ -357,8 +358,8 @@ public class VascServiceManagerImpl implements VascServiceManager.IRemote,VascSe
|
|||
try {
|
||||
// fill stuff in all global entry'ies
|
||||
for (String id:c.getVascEntryController().getVascEntryIds()) {
|
||||
VascEntry entry = ((DefaultVascEntryController)c.getVascEntryController()).getRealVascEntryById(id);
|
||||
if (entry.isVascDisplayOnly()==false) {
|
||||
VascEntry entry = ((DefaultVascEntryController)c.getVascEntryController()).getRealVascEntryById(id);
|
||||
if (entry.isVascDisplayOnly()==false) {
|
||||
if (entry.isVascAdminCreate()) {
|
||||
entry.addRowAction(new AddRowAction());
|
||||
}
|
||||
|
|
@ -391,9 +392,14 @@ public class VascServiceManagerImpl implements VascServiceManager.IRemote,VascSe
|
|||
// this is temp untill x4o templaing
|
||||
DefaultVascBackedEntryFinalizer f = new DefaultVascBackedEntryFinalizer();
|
||||
f.finalizeVascEntry(entry, c);
|
||||
|
||||
// execute backend event listeners
|
||||
VascBackend vb = c.getVascBackendController().getVascBackendById(entry.getBackendId());
|
||||
vb = new VascBackendProxyEventExecutor(vb,entry);
|
||||
((VascBackendControllerLocal)c.getVascBackendController()).addVascBackend(vb);
|
||||
}
|
||||
|
||||
logger.info("VASC COMPLEET LETS RETURN.");
|
||||
logger.finer("Done final config vascController: "+c);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue