Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.
Aviso

Os serviços do Corpore RM com as funcionalidades para utilização do TOTVS | HTML Framework estarão disponíveis em 2016. No momento versões controladas serão disponibilizadas para as equipes de Segmentos envolvidas no projeto de Experiências de Uso

Nota
titleVersão

 Disponível à partir da versão 12.1.6 da linha RM.

Get

Retorna o registro do dataserver representado pelo identificador da URL {id}. O FrameHTML faz a manipulação dos dados considerando que o mesmo possui um campo id como chave. Isso causa limitações no RM visto que a maior parte das chaves primárias do RM são compostas. Para contornar esse problema foi necessário concatenar o valor dos campos da chave primária e um campo chamado id (Caso já exista um campo id na tabela, esse será renomeado no json para "RESTDS_TEMP_id").

O id é o resultado da concatenação da chave primária utilizando como separador a string "$_$". Se for tomado como exemplo a tabela local de estoque e um registro cujos campos CodColigada, CodFilial e CodLoc possuem, respectivamente, os valores 1, 1 e 06, o identificador que será gerado no json de retorno será "1$_$1$_$06".

O analista não deve manipular o valor do campo id, uma vez que ele é para uso interno do FrameHTML e do RM Host.

HTML
<script type="text/javascript" language="javascript">
/* @license ! jQuery-mutate - v0.0.2 - 
* Licensed under the MIT license
* http://www.opensource.org/licenses/mit-license.php
* Date: 2015-04-19 */

!function(t){mutate_event_stack=[{name:"width",handler:function(a){var e=t(a);return e.data("mutate-width")||e.data("mutate-width",e.width()),e.data("mutate-width")&&e.width()!=e.data("mutate-width")?(e.data("mutate-width",e.width()),!0):!1}},{name:"height",handler:function(a){var e=t(a);return e.data("mutate-height")||e.data("mutate-height",e.height()),e.data("mutate-height")&&e.height()!=e.data("mutate-height")?(e.data("mutate-height",e.height()),!0):void 0}},{name:"top",handler:function(a){var e=t(a);return e.data("mutate-top")||e.data("mutate-top",e.css("top")),e.data("mutate-top")&&e.css("top")!=e.data("mutate-top")?(e.data("mutate-top",e.css("top")),!0):void 0}},{name:"bottom",handler:function(a){var e=t(a);return e.data("mutate-bottom")||e.data("mutate-bottom",e.css("bottom")),e.data("mutate-bottom")&&e.css("bottom")!=e.data("mutate-bottom")?(e.data("mutate-bottom",e.css("bottom")),!0):void 0}},{name:"right",handler:function(a){var e=t(a);return e.data("mutate-right")||e.data("mutate-right",e.css("right")),e.data("mutate-right")&&e.css("right")!=e.data("mutate-right")?(e.data("mutate-right",e.css("right")),!0):void 0}},{name:"left",handler:function(a){var e=t(a);return e.data("mutate-left")||e.data("mutate-left",e.css("left")),e.data("mutate-left")&&e.css("left")!=e.data("mutate-left")?(e.data("mutate-left",e.css("left")),!0):void 0}},{name:"hide",handler:function(a){var e=t(a),r=e.is(":hidden"),d=void 0==e.data("prev-hidden")?r:e.data("prev-hidden");return e.data("prev-hidden",r),r&&r!=d?!0:void 0}},{name:"show",handler:function(a){var e=t(a),r=e.is(":visible"),d=void 0==e.data("prev-visible")?r:e.data("prev-visible");return e.data("prev-visible",r),r&&r!=d?!0:void 0}},{name:"scrollHeight",handler:function(a){var e=t(a);return e.data("prev-scrollHeight")||e.data("prev-scrollHeight",e[0].scrollHeight),e.data("prev-scrollHeight")&&e[0].scrollHeight!=e.data("prev-scrollHeight")?(e.data("prev-scrollHeight",e[0].scrollHeight),!0):void 0}},{name:"scrollWidth",handler:function(a){var e=t(a);return e.data("prev-scrollWidth")||e.data("prev-scrollWidth",e[0].scrollWidth),e.data("prev-scrollWidth")&&e[0].scrollWidth!=e.data("prev-scrollWidth")?(e.data("prev-scrollWidth",e[0].scrollWidth),!0):void 0}},{name:"scrollTop",handler:function(a){var e=t(a);return e.data("prev-scrollTop")||e.data("prev-scrollTop",e[0].scrollTop()),e.data("prev-scrollTop")&&e[0].scrollTop()!=e.data("prev-scrollTop")?(e.data("prev-scrollTop",e[0].scrollTop()),!0):void 0}},{name:"scrollLeft",handler:function(a){var e=t(a);return e.data("prev-scrollLeft")||e.data("prev-scrollLeft",e[0].scrollLeft()),e.data("prev-scrollLeft")&&e[0].scrollLeft()!=e.data("prev-scrollLeft")?(e.data("prev-scrollLeft",e[0].scrollLeft()),!0):void 0}}]}(jQuery);
HTML
/* @license ! jQuery-mutate - v0.0.1 - 
* Licensed under the MIT license
* http://www.opensource.org/licenses/mit-license.php
* Date: 2015-04-19 */

!function(a){function b(){var c=mutate;"undefined"!=c.event_stack&&c.event_stack.length&&a.each(c.event_stack,function(a,b){mutate.add_event(b)}),c.event_stack=[],a.each(c.stack,function(b,d){a(d.selector).each(function(a,b){c.events[d.event_name](b)===!0?d.callback&&d.callback(b,d):d.false_callback&&d.false_callback(b,d)})}),setTimeout(b,mutate.speed)}mutate={speed:100,event_stack:mutate_event_stack,stack:[],events:{},add_event:function(a){mutate.events[a.name]=a.handler},add:function(a,b,c,d){mutate.stack[mutate.stack.length]={event_name:a,selector:b,callback:c,false_callback:d}}},b(),a.fn.extend({mutate:function(){var b=!1,c=arguments[1],d=this,e=arguments[2]?arguments[2]:function(){};return"extend"==arguments[0].toLowerCase()?(mutate.add_event(c),this):(a.each(a.trim(arguments[0]).split(" "),function(a,f){b=f,mutate.add(b,d,c,e)}),this)}})}(jQuery);
</script>
HTML
<style type="text/css">
.expand-container{
margin-top:5px !important;
font-weight: normal !important;
}

.expand-control{
margin-bottom: 5px !important;
}

pre{
white-space: inherit !important;
}

table tr:nth-child(odd), table tr:nth-child(odd) > *{
   background: transparent !important;
border: 0 !important;
}

.pdl .codeContent .gutter{
    border-right: 1px solid #ccc !important;
}

.wiki-content .innerCell {
    overflow-y: hidden;
}

.HiddenDiv .confluence-information-macro {
    width: calc(100% - 25px);
    background: #fff !important; 
    border: 0 !important;
    -moz-border-radius: 0px !important;
    -webkit-border-radius: 0px !important;
    border-radius: 0px !important;
    color: #333;
    margin: 10px 0 1em 0;
    min-height: 20px;
    padding: 10px;
    position: relative;
}

.HiddenDiv .confluence-information-macro .confluence-information-macro pre{
    display: none;
}
.HiddenDiv .wiki-content a:link, .HiddenDiv .wiki-content a, .HiddenDiv .tab-nav-link, .HiddenDiv .current{
     color: #000 !important; 
}

.wiki-content a:link {
    color: #000 !important;
}

</style>

Exemplo de utilização


HTML
<div style="border:1px solid #aab8c6;padding:5px;-moz-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;background: #f7f7f7">      
      <div style="background:#f7f7f7;width:calc(100% - 10px);height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 1px solid #aab8c6;margin-bottom:14px">
           <span style="float:left"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/folder3.png?version=2&modificationDate=1509366835661&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px">{{ProjectName}}</span>
           <span style="float:left;padding:0px 5px">&raquo</span>
           <span style="float:left"><img  style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/transfer3.png?version=2&modificationDate=1509366835358&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px">{{Domain}}</span>
           <span style="float:left;padding:0px 5px">&raquo</span>
           <span style="float:left"><img  style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/190516500/copy.png?version=1&modificationDate=1509567801070&api=v2"/></span>
           <span style="float:left;font-size:inherit;padding-left:5px">1$_$1$_$06</span>
           <span style="float:left;padding:0px 5px">&raquo</span>
           <span style="float:left"><img  style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/190516500/programming-code-signs.png?version=1&modificationDate=1509568429032&api=v2"/></span>
           <span style="float:left;font-size:inherit;padding-left:5px">GET 1$_$1$_$06 1</span>
     </div>
<div style="border: 1px solid #aab8c6">      
       <div style="background:#f7f7f7;width:calc(100% - 10px);height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 0px;">
           <span style="float:left;margin-top: 4px"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/cogwheel-arrow.png?version=1&modificationDate=1509556752957&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 3px">Fórmula Visual: Configuração de Atividades</span>
      </div>
<div style="background:#f0f0f0;width:calc(100% - 10px);height:auto;min-height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 0px;">
           <div><span style="float:left;margin-top: 4px;font-weight:normal !important"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/workflow.png?version=1&modificationDate=1509556254724&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 4px;font-weight:normal !important">Fórmula Visual <b>"teste_formula"</b></span><span style="float:right;margin-top: 4px;padding-right:5px;cursor:pointer" onclick="Show('hiddenDiv22', 'img22');"><img id="img22" name="img22" style="width: 16px; height: 16px; margin-top: 3px" src="/download/attachments/309398329/add.png?version=1&modificationDate=1509382756808&api=v2"></span></div>
      </div>
<div style="background: #e2e2e2;">
<div id="hiddenDiv22" class="HiddenDiv" style="visibility:hidden;height: 0px; line-height: 30px; padding-left: 5px; background: #e2e2e2;">
No grid principal da Fórmula Visual, existe um parâmetro <strong>"Definição dos Parâmetros de Execução"</strong>, clique em <strong>[...]</strong>, para definir os parâmetros que serão utilizados na Fórmula Visual .
<div style="background: #fff; padding:10px;text-align:center;width:calc(100% - 25px);">



HTML
</div>

Definindo os parâmetros da Fórmula Visual: 

HTML
<div style="background: #fff; padding:10px;text-align:center;width:calc(100% - 25px);">



HTML
</div>
</div>
</div>
</div>
<div style="padding:7px"></div>
<div style="border: 1px solid #aab8c6">      
       <div style="background:#f7f7f7;width:calc(100% - 10px);height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 0px;">
           <span style="float:left;margin-top: 4px"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/xml-file.png?version=1&modificationDate=1509371596771&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 3px">Modelo XML</span>
      </div>
      <div style="background:#f0f0f0;width:calc(100% - 10px);height:auto;min-height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 0px;">
           <div><span style="float:left;margin-top: 4px;font-weight:normal !important"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/programming-code.png?version=1&modificationDate=1509451197195&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 4px;font-weight:normal !important">GetParams <b>(Requisição e Resposta)</b></span><span style="float:right;margin-top: 4px;padding-right:5px;cursor:pointer" onclick="Show('hiddenDiv16', 'img16');"><img id="img16" name="img16" style="width: 16px; height: 16px; margin-top: 3px" src="/download/attachments/309398329/add.png?version=1&modificationDate=1509382756808&api=v2"></span></div>
      </div>
<div style="background: #e2e2e2;">
<div id="hiddenDiv16" class="HiddenDiv" style="visibility:hidden;height: 0px; line-height: 30px; padding-left: 5px; background: #e2e2e2;">
<strong>Descrição:</strong> Recupera os Parâmetros de uma Fórmula Visual.
Informações
iconfalse
Deck of Cards
id.
Card
labelRequest
Bloco de código
languagexml
firstline1
titleRequest
linenumberstrue
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tot="http://www.totvs.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <tot:GetParameters>
         <!--Optional:-->
         <tot:codColigada>?</tot:codColigada>
         <!--Optional:-->
         <tot:idFormula>?</tot:idFormula>
      </tot:GetParameters>
   </soapenv:Body>
</soapenv:Envelope> 
Card
labelResponse
Bloco de código
languagexml
titleResponse
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <GetParametersResponse xmlns="http://www.totvs.com/">
         <GetParametersResult>
	         	<Parameters>
	  			<xs:schema id="Parameters" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
	    				<xs:element name="Parameters" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
	      				<xs:complexType>
	        					<xs:choice minOccurs="0" maxOccurs="unbounded">
		          				<xs:element name="GCOLIGADA">
		            					<xs:complexType>
		              						<xs:sequence>
		                						<xs:element name="CODCOLIGADA" msdata:Caption="Coligada" type="xs:int" minOccurs="0" />
		              						</xs:sequence>
		            					</xs:complexType>
		          				</xs:element>
	        					</xs:choice>
	      				</xs:complexType>
	    				</xs:element>
	  			</xs:schema>
			</Parameters>
		</GetParametersResult>
      </GetParametersResponse>
   </s:Body>
</s:Envelope>
HTML
</div>
</div>
</div>
<div style="padding:7px"></div>
<div style="border: 1px solid #aab8c6">      
       <div style="background:#f7f7f7;width:calc(100% - 10px);height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 0px;">
           <span style="float:left;margin-top: 4px"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/preference.png?version=1&modificationDate=1509369965368&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 3px">Parâmetros</span>
      </div>
      <div style="background:#f0f0f0;width:calc(100% - 10px);height:auto;min-height:30px;color: #000;font-weight:bold;font-size: 16px;padding:5px;border-bottom: 0px;">
           <div style="width:100%;height: 30px;border-bottom:1px solid #d0d0d0;padding-bottom:5px;"><span style="float:left;margin-top: 4px;font-weight:normal !important"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/cube.png?version=1&modificationDate=1509370590936&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 4px;font-weight:normal !important">CodColigada <b>(Opcional)</b></span><span style="float:right;margin-top: 4px;padding-right:5px;cursor:pointer" onclick="Show('hiddenDiv17', 'img17');"><img id="img17" name="img17" style="width: 16px; height: 16px; margin-top: 3px" src="/download/attachments/309398329/add.png?version=1&modificationDate=1509382756808&api=v2"></span></div>
<div style="background: #e2e2e2;">
<div id="hiddenDiv17" style="visibility:hidden;height: 0px; line-height: 30px; padding-left: 5px; background: #e2e2e2;font-weight:normal">
<strong>Descrição:</strong> Código da Coligada em que a Fórmula Visual foi criada.<br>
<strong>Tipo</strong>: Inteiro
</div>
</div>
<div style="width:100%;height: 30px;padding-top:5px"><span style="float:left;margin-top: 4px;font-weight:normal !important"><img style="width: 16px; height: 16px; margin-top:3px" src="/download/attachments/309398329/cube.png?version=1&modificationDate=1509370590936&api=v2" /></span>
           <span style="float:left;font-size:inherit;padding-left:5px;margin-top: 4px;font-weight:normal !important">IdFormula <b>(Opcional)</b></span><span style="float:right;margin-top: 4px;padding-right:5px;cursor:pointer" onclick="Show('hiddenDiv18', 'img18');"><img id="img18" name="img18" style="width: 16px; height: 16px; margin-top: 3px" src="/download/attachments/309398329/add.png?version=1&modificationDate=1509382756808&api=v2"></span></div>
<div style="background: #e2e2e2;">
<div id="hiddenDiv18" style="visibility:hidden;height: 0px; line-height: 30px; padding-left: 5px; background: #e2e2e2;font-weight:normal">
<strong>Descrição:</strong> Código Identificador da Fórmula Visual.<br>
<strong>Tipo</strong>: Cadeia de Caracteres (String)
</div>
</div>
      </div>
</div>
</div>

Método: GET

URL: http://localhost:8051/rmsrestdataserver/rest/EstLOCData/1$_$1$_$06

Resposta da requisição

Expandir

HTML
<script type="text/javascript" language="javascript">

Show = function(divName, imgName){
window["currentElement"] = divName;
if(typeof divName === "string"){
	if(document.getElementById(divName).offsetHeight < 2){
     $("#" + divName).animate({height: $("#" + divName).get(0).scrollHeight + 7});
     $("#" + divName).css("visibility", "visible")
     $("#" + imgName).attr('src', '/download/attachments/309398329/remove.png?version=1&modificationDate=1509386912062&api=v2');  
     $(".HiddenDiv .tab-nav-link").on("click", function(){
          window["currentElement"] = $(this).parents().find(".HiddenDiv").attr("id");
     });  
	 $(".HiddenDiv .confluence-information-macro").mutate('height',function (element,info){
          this.selector.each(function(index, element){
             if($(this).parent().attr("id") == window["currentElement"])
             $(this).parent().height($(this).outerHeight() + 61);
          });		
     });
    }
    else{
     $("#" + divName).animate({height: "0px"});
     $("#" + divName).css("visibility", "hidden")
     $("#" + imgName).attr('src', '/download/attachments/309398329/add.png?version=1&modificationDate=1509382756808&api=v2');
    }
}
}
</script>