Autor: andrey silva souza
Chamar Um NCL a partir de outro NCL
11 de Outubro de 2007, 17:54 - | Ninguém seguindo este artigo por enquanto.
Visualizado 32 vezes
Alguem sabe se é possivel chamar um documento NCL a partir de outro NCL, e como?
1212 comentários
xmlns="http://www.ncl.org.br/NCL3.0/EDTVProfile">
<head>
<importedDocumentBase>
<importNCL alias="meuImport" documentURI="exemplo06.ncl" />
</importedDocumentBase>
</head> <body>
<port id="pInicio" component="referBody" /> <context id="referBody" refer="meuImport#exemplo06" />
<media id="referVideo1" refer="meuImport#video1" />
</body>
</ncl> Esse exemplo mostra como: -referenciar o contexto principal, ou seja, o "body". Basta você concatenar o "alias" com o "id" do documento. Ex.: o elemento com id=referBody. -referenciar outros nós (como "media", "switch" e "context"). Basta você concatenar o "alias" com o "id" do nó. Ex.: o elemento com id=referVideo1. Se você quiser testar esse arquivo que fiz basta baixar também o exemplo 6 daqui do site. Um abraço, Rafael
<head>
<connectorBase> <causalConnector id="onSelectionStopNStartN">
<connectorParam name="keyCode"/>
<simpleCondition key="$keyCode" role="onSelection"/>
<compoundAction operator="par">
<simpleAction role="stop" max="unbounded" qualifier="par"/>
<simpleAction role="start" max="unbounded" qualifier="par"/>
</compoundAction>
</causalConnector> </connectorBase>
<regionBase>
<region left="15%" top="15%" width="70%" height="70%" id="rgTV" zIndex="0">
<region id="region1" left="10%" top="10%" width="25%" height="25%" zIndex="1"/>
<region id="region2" left="40%" top="10%" width="25%" height="25%" zIndex="1"/>
<region id="region3" left="70%" top="10%" width="25%" height="25%" zIndex="1"/>
</region>
</regionBase>
<descriptorBase> <descriptor id="drgTV" region="rgTV" />
<descriptor id="dOpcao1" region="region1" focusIndex="1" moveRight="2"/>
<descriptor id="dOpcao2" region="region2" focusIndex="2" moveRight="3" moveLeft="1" focusBorderColor="blue"/>
<descriptor id="dOpcao3" region="region3" focusIndex="3" moveLeft="2" focusBorderColor="blue"/>
</descriptorBase>
<importedDocumentBase>
<importNCL alias="import" documentURI="Conteudo1.ncl" />
</importedDocumentBase>
</head>
<body>
<port id="Popcao1" component="opcao1"/>
<port id="Popcao2" component="opcao2"/>
<port id="Popcao3" component="opcao3"/>
<port id="Pbackground" component="background"/>
<media id="background" type="image/jpeg" src="media/background.jpg" descriptor="drgTV"/>
<media id="opcao1" type="image/jpeg" src="media/curso1.jpg" descriptor="dOpcao1"/>
<media id="opcao2" type="image/jpeg" src="media/curso2.jpg" descriptor="dOpcao2"/>
<media id="opcao3" type="image/jpeg" src="media/curso3.jpg" descriptor="dOpcao3"/>
<context id="refer" refer="import#C1" />
<link id="LSelecaoOpcao1" xconnector="onSelectionStopNStartN">
<bind component="opcao1" role="onSelection">
<bindParam name="keyCode" value="VK_ENTER"/>
</bind>
<bind component="opcao1" role="stop" />
<bind component="opcao2" role="stop" />
<bind component="opcao3" role="stop" />
<bind component="background" role="stop" />
<bind component="refer" role="start" />
</link>
</body>
</ncl> ----------------- Conteudo1.ncl -------------------- <?xml version="1.0" encoding="ISO-8859-1"?> <ncl id="C1" xsi:schemaLocation="http://www.ncl.org.br/NCL3.0/EDTVProfile www.ncl.org.br/NCL3.0/profiles/NCL30EDTV.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ncl.org.br/NCL3.0/EDTVProfile">
<head>
<connectorBase> <causalConnector id="onSelectionStopNStartN">
<connectorParam name="keyCode"/>
<simpleCondition key="$keyCode" role="onSelection"/>
<compoundAction operator="par">
<simpleAction role="stop" max="unbounded" qualifier="par"/>
<simpleAction role="start" max="unbounded" qualifier="par"/>
</compoundAction>
</causalConnector> </connectorBase>
<regionBase>
<region left="15%" top="15%" width="70%" height="70%" id="rgTV" zIndex="0">
<region id="region1" left="10%" top="10%" width="25%" height="25%" zIndex="1"/>
</region>
</regionBase>
<descriptorBase> <descriptor id="drgTV" region="rgTV" />
<descriptor id="dFigura" region="region1" />
</descriptorBase>
<importedDocumentBase>
<importNCL alias="import" documentURI="Menu.ncl" />
</importedDocumentBase>
</head>
<body>
<port id="Popcao1" component="figura"/>
<port id="Pbackground" component="background"/>
<media id="background" type="image/jpeg" src="media/background.jpg" descriptor="drgTV"/>
<media id="figura" type="image/gif" src="media/botao_amarelo.gif" descriptor="dFigura"/>
<context id="refer" refer="import#MENU" />
<link id="LSelecaoMenu" xconnector="onSelectionStopNStartN">
<bind component="figura" role="onSelection">
<bindParam name="keyCode" value="MENU"/>
</bind>
<bind component="figura" role="stop" />
<bind component="background" role="stop" />
<bind component="refer" role="start" />
</link>
</body>
</ncl> Oq eu quero é retornar ao Menu inicial qd o usuario clicar em "MENU" Vlw!
<head>
<connectorBase> <causalConnector id="onSelectionStopNStartN">
<connectorParam name="keyCode"/>
<simpleCondition key="$keyCode" role="onSelection"/>
<compoundAction operator="par">
<simpleAction role="stop" max="unbounded" qualifier="par"/>
<simpleAction role="start" max="unbounded" qualifier="par"/>
</compoundAction>
</causalConnector> </connectorBase>
<regionBase>
<region left="15%" top="15%" width="70%" height="70%" id="rgTV" zIndex="0">
<region id="region1" left="10%" top="10%" width="25%" height="25%" zIndex="1"/>
<region id="region2" left="40%" top="10%" width="25%" height="25%" zIndex="1"/>
<region id="region3" left="70%" top="10%" width="25%" height="25%" zIndex="1"/>
</region>
</regionBase>
<descriptorBase> <descriptor id="drgTV" region="rgTV" />
<descriptor id="dOpcao1" region="region1" focusIndex="1" moveRight="2"/>
<descriptor id="dOpcao2" region="region2" focusIndex="2" moveRight="3" moveLeft="1" focusBorderColor="blue"/>
<descriptor id="dOpcao3" region="region3" focusIndex="3" moveLeft="2" focusBorderColor="blue"/>
</descriptorBase>
<importedDocumentBase>
<importNCL alias="import" documentURI="Conteudo1.ncl" />
</importedDocumentBase>
</head>
<body>
<port id="Popcao1" component="opcao1"/>
<port id="Popcao2" component="opcao2"/>
<port id="Popcao3" component="opcao3"/>
<port id="Pbackground" component="background"/>
<media id="background" type="image/jpeg" src="media/background.jpg" descriptor="drgTV"/>
<media id="opcao1" type="image/jpeg" src="media/curso1.jpg" descriptor="dOpcao1"/>
<media id="opcao2" type="image/jpeg" src="media/curso2.jpg" descriptor="dOpcao2"/>
<media id="opcao3" type="image/jpeg" src="media/curso3.jpg" descriptor="dOpcao3"/>
<context id="refer" refer="import#C1" />
<link id="LSelecaoOpcao1" xconnector="onSelectionStopNStartN">
<bind component="opcao1" role="onSelection">
<bindParam name="keyCode" value="VK_ENTER"/>
</bind>
<bind component="opcao1" role="stop" />
<bind component="opcao2" role="stop" />
<bind component="opcao3" role="stop" />
<bind component="background" role="stop" />
<bind component="refer" role="start" />
</link> <link id="LSelecaoMenu" xconnector="onSelectionStopNStartN">
<bind component="refer" interface ="figura" role="onSelection">
<bindParam name="keyCode" value="MENU"/>
</bind>
<bind component="refer" role="stop" /> <bind component="opcao1" role="start" />
<bind component="opcao2" role="start" />
<bind component="opcao3" role="start" />
<bind component="background" role="start" />
</link>
</body>
</ncl> Não olhei o resto do documento para ver se existe algum erro. A princípio vai tudo funcionar. Só atente para o código das teclas que você está usando para seleção. Uma abraço, Rafael