This portal is to open public enhancement requests against the products and services belonging to IBM Sustainability Software. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
In our company, to integrate ELM and other data bases we are using the EWM scripts and in this scripts we call a webservice to obtain the data.
Using this strategy we get the data in xml format. So, we read the xml and populate a field or list in EWM.
About 2 or 3 years ago we decided use the same strategy but using JSON format to get the data in a "Calculated Value" type script. And it works very well!
Now, we need to use the same strategy but using JSON format to get the data in a "Value Set" type script. But we can't read the data, it doesn't work.
This Idea is to ask IBM to implement JSON format to get the data in a "Value Set" type script.
Below are some examples of what works and what doesn't.
1- Value Set Script with xml (it works!)
//==========================================
// Descrição: Carrega todas as UGs ativas.
//==========================================
dojo.provide("br.gov.serpro.alm.ValueSetProviderUg");
dojo.require("com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters");
(function() {
var HttpConnectorParameters= com.ibm.team.workitem.api.common.connectors.HttpConnectorParameters;
dojo.declare("br.gov.serpro.alm.ValueSetProviderUg", null, {
getFilteredValueSet: function(attributeId, workItem, context, filter) {
var params= new HttpConnectorParameters();
params.url= "https://alm.serpro/wsalm/rest/ugsAtivas";
params.xpath= "//xml/ug";
params.columnXpaths= ["./id","./sigla"];
params.columnIds= ["id","sigla"];
params.ignoreInvalidCertificates = true;
var connector= context.getDataConnector("HttpConnector");
var values= connector.get(params);
var result= [];
while(values.hasNext()){
var entry= values.next();
var title= entry.getById("sigla").toUpperCase() + "-" + entry.getById("id");
filter = filter == null ? "*" : filter.toUpperCase();
var termos_digitados = filter.split("*");
var sub_termos= [];
for (i=0;i<termos_digitados.length;i++) {
if (termos_digitados[i] != null && termos_digitados[i] != "") {
sub_termos.push(termos_digitados[i].replace(/^\s*/, "").replace(/\s*$/, ""));
}
}
var filterMatchs = true;
var iOf;
var iOfAux = -100000;
//usuário esta usando caracters especiais para a busca
for (i=0;i<sub_termos.length;i++) {
iOf = title.indexOf(sub_termos[i]);
if (iOf == -1 || iOf < iOfAux) {
filterMatchs = false;
break;
}
iOfAux = iOf;
}
if (filterMatchs) {
result.push(title);
}
}
return result;
}
});
})();
2- Calculated Value Script with JSON (it works!)
//============================================
// Descrição: Obter dados da Subcontratada a partir do sistema HISAQ. É passado // como parâmetro o Número do Contrato.
//============================================
dojo.provide("br.gov.serpro.alm.CalculatedSubcontratadaHisaq");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("br.gov.serpro.alm.CalculatedSubcontratadaHisaq", null, {
getValue: function(attributeId, workItem, configuration) {
// URL do webservice
var url = "https://alm.serpro/wsalm/rest/serprodata/lista-documento-contratual?cd_num_registro="; // Produção e Treinamento
var contrato_sub = workItem.getValue("br.gov.serpro.alm.itemdetrabalho.atributo.contrato_subcontratada");
// Monta a URL final, com o parâmetro (Contrato do Subcontratado).
url = url + contrato_sub;
var xmlhttp = null;
var xmlDoc = null;
var tagList = null;
// Obtém os dados do sistema HISAQ, via webservice
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, false);
xmlhttp.setRequestHeader("Accept","application/json;charset=utf-8");
xmlhttp.send();
xmlDoc=xmlhttp.responseText;
var dadosSubcontratada = JSON.parse(xmlDoc);
if (dadosSubcontratada.length > 0) {
// Define qual dado do subcontratado será retornado (CNPJ, Nome ou Vigência) de acordo com o id do atributo
//ID CNPJ = br.gov.serpro.alm.itemdetrabalho.atributo.cnpj_cliente
//ID Nome = br.gov.serpro.alm.itemdetrabalho.atributo.nome_subcontratada
//ID Vigência = br.gov.serpro.alm.itemdetrabalho.atributo.vigencia_contrato_sub
if (attributeId.indexOf("nome_subcontratada") >= 0) {
return dadosSubcontratada[0].nm_fornecedor;
}
if (attributeId.indexOf("cnpj_cliente") >= 0) {
return dadosSubcontratada[0].cd_cnpj_fornecedor;
}
if (attributeId.indexOf("vigencia_contrato_sub") >= 0) {
var vigini = dadosSubcontratada[0].dt_vigencia_inicio;
var vigfin = dadosSubcontratada[0].dt_vigencia_fim_atual;
var textovig = "("+vigini.substr(8,2)+"/"+vigini.substr(5,2)+"/"+vigini.substr(0,4)+" - "+vigfin.substr(8,2)+"/"+vigfin.substr(5,2)+"/"+vigfin.substr(0,4)+")";
return textovig;
}
} else {
return "Não encontrou dados do Subcontratado.";
}
}
});
})();
3- Value Set Script with JSON (it doesn't work!)
//=============================================
// Descrição: Carrega todas os Sistemas existentes no Portal Meu Domínio
//=============================================
dojo.provide("br.gov.serpro.alm.ValueSetProviderSistema");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
dojo.declare("br.gov.serpro.alm.ValueSetProviderSistema", null, {
getFilteredValueSet: function(attributeId, workItem, context, filter) {
// URL do webservice
//var url = "https://alm.serpro/wsalm/rest/serprodata/lista-sistemas?str_pesquisa="; // Produção e Treinamento
var sistema = filter;
var result= [];
// Monta a URL final, com o parâmetro (Nome do Sistema).
url = url + sistema;
var xmlhttp = null;
var xmlDoc = null;
var tagList = null;
// Obtém os dados do Portal meu Domínio, via webservice
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, false);
xmlhttp.setRequestHeader("Accept","application/json;charset=utf-8");
xmlhttp.send();
xmlDoc=xmlhttp.responseText;
var dadosSistema = JSON.parse(xmlDoc);
if (dadosSistema.length > 0) {
result.push(dadossistema[0].sg_id_sistema + " - " + dadossistema[0].nm_sistema);
}
else {
result.push("Não encontrou o Sistema.");
}
return result;
}
});
})();
Idea priority | Medium |
Needed By | Quarter |
By clicking the "Post Comment" or "Submit Idea" button, you are agreeing to the IBM Ideas Portal Terms of Use.
Do not place IBM confidential, company confidential, or personal information into any field.