All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nosi.core.gui.fields.LookupField Maven / Gradle / Ivy

Go to download

IGRP Framework is a powerful and highly customizable platform developed by the Operational Nucleus for the Information Society (NOSi) to create web applications, it provides out of box, several modules to make easy to create stand-alone, production-grade web applications: authentication and access-control, business processes automation, reporting, page builder with automatic code generation and incorporation of the Once-Only-Principle, written in Java. IGRP Framework WAR - Contains some keys resources that give UI to IGRP Framework and others supports files.

There is a newer version: 2.0.0.241121-RCM
Show newest version
package nosi.core.gui.fields;

import java.util.Map;

import nosi.core.config.ConfigApp;
import nosi.core.webapp.Core;
import nosi.core.webapp.helpers.Route;
import nosi.webapps.igrp.dao.Action;
import nosi.webapps.igrp.dao.Application;

import java.util.LinkedHashMap;

/**
 * @author: Emanuel Pereira
 * 

* Apr 13, 2017 * * Description: class to configure lookup field */ public class LookupField extends TextField { private final Map params; private final Map lookupParams; private int versionLookup = 1; public LookupField(Object model,String name) { super(model,name); this.propertie().put("type", "lookup"); this.params = new LinkedHashMap <>(); this.lookupParams = new LinkedHashMap <>(); } @Override public void addParam(String key,String value){ this.params.put(key, value); } @Override public void addLookupParam(String key,String value) { this.lookupParams.put(key, value); this.versionLookup = 2; } public Map getParams(){ return this.params; } public Map getLookupParams(){ return this.lookupParams; } @Override public int vertionLookup() { return this.versionLookup; } @Override public void setLookup(String app, String page, String action) { int isPublic = Core.getParamInt("isPublic"); String currentDad = Core.getCurrentDad(); if(isPublic == 1) this.lookup = Route.getResolveUrl(app, page, action, currentDad, 1).replace("?", "").replace("webapps", ""); else { this.lookup = Route.getResolveUrl(app, page, action).replace("?", "").replace("webapps", ""); Application application = Core.findApplicationByDad(app); if(application != null && application.getExterno() == 2) { String deployedWarName = Core.getDeployedWarName(); Action pagina = new Action().findByPage(page, app); if(!deployedWarName.equals(application.getUrl()) && pagina != null) { this.lookup = ConfigApp.getInstance().getExternalUrl(application.getUrl()); this.lookup = String.format("%s?r=%s/%s/%s", this.lookup, app, page, pagina.getAction()); } } } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy