Trying to read an RSS and select information using Linq but can't seem to get it working.
Here is my code:
XDocument feedXML = XDocument.Load(
"http://eventful.com/atom/performers/bliminal-/P0-001-000192452-0");
var feeds = from feed in feedXML.Descendants("entry")
select new
{
Title = feed.Element("title").Value,
Link = feed.Element("link").Value,
Description = feed.Element("content").Value
};
And here is the format of my RSS:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US" xmlns:g="http://base.google.com/ns/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<id>http://eventful.com/atom/performers/bliminal-/P0-001-000192452-0</id>
<link href="http://eventful.com/atom/performers/bliminal-/P0-001-000192452-0" type="application/atom+xml" rel="self" />
<link href="http://eventful.com/performers/bliminal-/P0-001-000192452-0" type="text/html" rel="alternate" />
<title>B-Liminal Tour Dates in 2009, B-Liminal Concert Schedule - Eventful</title>
<subtitle>Up-to-date event feeds from eventful.com, the world's leading event website.</subtitle>
<rights type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
Copyright © 2006
Eventful, Inc. All rights reserved. Use subject to terms of use:
http://eventful.com/terms
</div>
</rights>
<generator version="1.0">EVDB::Atom</generator>
<opensearch:totalResults></opensearch:totalResults>
<opensearch:startIndex>1</opensearch:startIndex>
<updated>2009-09-13T11:48:52+00:00</updated>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<id>http://eventful.com/jupiter/events/bliminal-free-fan-appreciation-show-/E0-001-024704319-1</id>
<published>2009-09-13T15:09:00+00:00</published>
<updated>2009-09-13T15:48:12+00:00</updated>
<link href="http://eventful.com/jupiter/events/bliminal-free-fan-appreciation-show-/E0-001-024704319-1" type="text/html" rel="alternate" />
<gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed" />
<gd:visibility value="http://schemas.google.com/g/2005#event.public" />
<gd:transparency value="http://schemas.google.com/g/2005#event.transparent" />
<title>B-Liminal FREE fan appreciation show!</title>
<gd:when startTime="2009-09-19T02:00:00+00:00" endTime="2009-09-19T02:00:00+00:00" />
<georss:where>
<gml:Point>
<gml:pos>26.9342076 -80.0922588</gml:pos>
</gml:Point>
</georss:where>
<gd:where rel="http://schemas.google.com/g/2005#event" valueString="Corners near 71 East Indiantown Road , Jupiter, Florida, 33458, United States">
<gd:entryLink>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:media="http://search.yahoo.com/mrss/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<id>http://eventful.com/jupiter/venues/corners-/V0-001-001473018-9</id>
<link href="http://eventful.com/jupiter/venues/corners-/V0-001-001473018-9" type="text/html" rel="alternate" />
<title>Corners</title>
<georss:where>
<gml:Point>
<gml:pos>26.9342076 -80.0922588</gml:pos>
</gml:Point>
</georss:where>
<gd:contactSection label="Corners">
<gd:postalAddress>
71 East Indiantown Road
Jupiter, Florida 33458, United States
</gd:postalAddress>
<gd:geoPt lat="26.9342076" lon="-80.0922588" />
</gd:contactSection>
<content type="html">
<div class='vcard'>
<a class='fn org url uid' href='http://eventful.com/venues/V0-001-001473018-9'>Corners</a>
<div class='adr'>
<span class='street-address'>71 East Indiantown Road</span>, <span class='locality'>Jupiter</span>, <span class='region'>Florida</span> <span class='postal-code'>33458</span> <span class='country-name'>United States</span></div>
</div>
</content>
<media:text type="html">
<div class='vcard'>
<a class='fn org url uid' href='http://eventful.com/venues/V0-001-001473018-9'>Corners</a>
<div class='adr'>
<span class='street-address'>71 East Indiantown Road</span>, <span class='locality'>Jupiter</span>, <span class='region'>Florida</span> <span class='postal-code'>33458</span> <span class='country-name'>United States</span></div>
</div>
</media:text>
<category scheme="http://eventful.com/venues/tags/" term="americantowns" label="American Towns" />
<category scheme="http://eventful.com/venues/tags/" term="americantownscom" label="americantowns.com" />
<category scheme="http://eventful.com/venues/tags/" term="artistdatacom" label="artistdata.com" />
<category scheme="http://eventful.com/venues/tags/" term="barnightclub" label="BarNight Club" />
<category scheme="http://eventful.com/venues/tags/" term="community" label="community" />
<category scheme="http://eventful.com/venues/tags/" term="local" label="local" />
<category scheme="http://eventful.com/venues/tags/" term="townsquare" label="town square" />
<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#contact" />
<author>
<name>evdb</name>
<uri>http://eventful.com/users/evdb</uri>
</author>
</entry>
</gd:entryLink>
</gd:where>
The problem is that the entry elements are in an XML namespace (the xmlns attribute in each entry).
You need to do this:
XNamespace atom = "http://www.w3.org/2005/Atom";
var feeds = from feed in feedXML.Descendants(atom + "entry")
select new {
Title = feed.Element(atom + "title").Value,
Link = feed.Element(atom + "link").Value,
Description = feed.Element(atom + "content").Value
};
This code uses an implicit cast to create an XNamespace object, then uses XNamespace's overloaded + operator to create an XName. For more information, see here.
Related
Hallo i'm hosting a Private Gallery of Visual Studio Extensions.
I have 1 Extension for Visual Stduio 2019 only and
one version for Visual Studio 2022 only but when i'm looking into Visual Studio 2019 | 2022 ->Tools->Manage Extensions -> Online -> Private Gallery it shows me both version.
Wher is my mistake ?
Feedfile:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Private Gallery</title>
<id>1111111-2222-3333-444-5555555555</id>
<updated>2022-02-10T08:06:27Z</updated>
<subtitle>Add this feed to Visual Studio's extension manager from Tools -> Options -> Environment -> Extensions and Updates</subtitle>
<link rel="alternate" href="http://test.de/Vsix/Zoom.xml" />
<entry>
<Id>555555-4444-3333-2222-111111111111</Id>
<title type="text">Zoom Support for Visual Studio</title>
<link rel="alternate" href="http://test.de/Vsix/Zoom\doku" />
<link rel="releasenotes" type="text/html" href="http://test.de/Vsix/Zoom/changelog" />
<summary type="text">Built-in support for Zooming with Microsoft Visual Studio.</summary>
<published>2020-01-14T12:54:26Z</published>
<updated>2022-10-11T07:14:41Z</updated>
<author>
<name>Test GmbH</name>
</author>
<content type="application/octet-stream" src="http://test.de/Vsix/Zoom/Zoom.vsix" />
<link rel="icon" href="http://test.de/Vsix/Zoom/Zoom.ico" />
<link href="http://test.de/Vsix/Zoom/Zoom.ico" rel="previewimage" />
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
<Id>555555-4444-3333-2222-111111111111</Id>
<Version>3.19</Version>
<VersionRange>[16.0,17.0)</VersionRange>
<References />
<Installations>
<VersionRange>[16.0,17.0)</VersionRange>
</Installations>
</Vsix>
</entry>
<entry>
<id>22222222-999-888-7777-55555555555</id>
<title type="text">Zoom Support for Visual Studio</title>
<link rel="alternate" href="http://test.de/Vsix/Zoom\doku" />
<link rel="releasenotes" type="text/html" href="http://test.de/Vsix/Zoom/changelog" />
<summary type="text">Built-in support for Zooming with Microsoft Visual Studio.</summary>
<published>2020-01-14T12:54:26Z</published>
<updated>2022-10-13T08:11:10Z</updated>
<author>
<name>Test GmbH</name>
</author>
<content type="application/octet-stream" src="http://test.de/Vsix/Zoom/Zoom_2022.vsix" />
<link rel="icon" href="http://test.de/Vsix/Zoom/Zoom.ico" />
<link href="http://test.de/Vsix/Zoom/Zoom.ico" rel="previewimage" />
<Vsix xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/developer/vsx-syndication-schema/2010">
<Id>66666666-777-8888-9999-111111111111</Id>
<Version>1.39</Version>
<VersionRange>[17.0,18.0)</VersionRange>
<ProductArchitecture>amd64</ProductArchitecture>
<References />
<Installations>
<VersionRange>[17.0,18.0)</VersionRange>
</Installations>
</Vsix>
</entry>
</feed>
I want to read an xml file. And to all its attribute I need.
High Time tag is repeated 36 times
<?xml version="1.0" encoding="utf-8"?>
<weatherdata>
<!-- ... -->
<forecast>
<tabular>
<time from="2016-09-28T15:30:00" to="2016-09-28T18:30:00" period="2">
<!-- Valid from 2016-09-28T15:30:00 to 2016-09-28T18:30:00 -->
<symbol number="1" numberEx="1" name="Clear sky" var="01d" />
<precipitation value="0" />
<!-- Valid at 2016-09-28T15:30:00 -->
<windDirection deg="225.9" code="SW" name="Southwest" />
<windSpeed mps="7.5" name="Moderate breeze" />
<temperature unit="celsius" value="24" />
<pressure unit="hPa" value="1007.5" />
</time>
<time from="2016-09-28T18:30:00" to="2016-09-29T00:30:00" period="3">
<!-- Valid from 2016-09-28T18:30:00 to 2016-09-29T00:30:00 -->
<symbol number="3" numberEx="3" name="Partly cloudy" var="mf/03n.89" />
<precipitation value="0" />
<!-- Valid at 2016-09-28T18:30:00 -->
<windDirection deg="219.1" code="SW" name="Southwest" />
<windSpeed mps="4.6" name="Gentle breeze" />
<temperature unit="celsius" value="19" />
<pressure unit="hPa" value="1008.5" />
</time>
etc.
First question:
I want to implement a preview of the document in the form of the task-edit of the workflows... How can I do this? I try to adapt the document-details.xml and document-details.ftl to workflow-details.xml and workflow-details.ftl but not works. I tried to copy the components that have web-preview of the document-details files to workflow-details. Any hint to make this?
I have this in workflow-details.ftl:
<#include "include/alfresco-template.ftl" />
<#templateHeader>
<#script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>
<#link rel="stylesheet" type="text/css" href="${url.context}/res/components/document-details/document-details-panel.css" group="document-details"/>
<#link rel="stylesheet" type="text/css" href="${url.context}/res/components/workflow/task-edit-header.css" group="workflow-details"/>
<#templateHtmlEditorAssets />
</#>
<#templateBody>
<#markup id="alf-hd">
<div id="alf-hd">
<#region scope="global" id="share-header" chromeless="true"/>
<#region id="title" scope="template"/>
<#if page.url.args.nodeRef??>
<#region id="path" scope="template"/>
</#if>
</div>
</#>
<#markup id="bd">
<div id="bd">
<div class="share-form">
<#region id="data-header" scope="page" />
<div class="yui-gc">
<div class="yui-u first">
<#if (config.scoped['WorkflowDetails']['workflow-details'].getChildValue('display-web-preview') == "true")>
<#region id="web-preview" scope="template"/>
</#if>
</div>
</div>
<#region id="data-form" scope="page" />
<#region id="data-actions" scope="page" />
</div>
</div>
</#>
</#>
<#templateFooter>
<#markup id="alf-ft">
<div id="alf-ft">
<#region id="footer" scope="global"/>
<#region id="data-loader" scope="page" />
</div>
</#>
</#>
In workflow-details.xml I add this component:
<component>
<region-id>web-preview</region-id>
<sub-components>
<sub-component id="default">
<evaluations>
<evaluation>
<evaluators>
<evaluator type="config.component.evaluator">
<params>
<element>WorkflowDetails/workflow-details/display-web-preview</element>
</params>
</evaluator>
</evaluators>
<url>/components/preview/web-preview</url>
<properties>
<nodeRef>{nodeRef}</nodeRef>
<api>api</api>
<proxy>alfresco</proxy>
<dependencyGroup>workflow-details</dependencyGroup>
</properties>
</evaluation>
</evaluations>
</sub-component>
</sub-components>
</component>
This not shows the web-preview, only creates:
<div id="template_x002e_web-preview_x002e_workflow-details">
<div id="template_x002e_web-preview_x002e_workflow-details_x0023_default"> </div>
</div>
What's my error?
Second question:
In the preview of the Aikau page I get: Warning: unimplemented annotation type: Widget signature in the console of the firebug of the Mozilla Firefox and the document is displayed without the digital signatures... But, for example, if I upload a document with a digital signature, I can see the document with the signature in the page of document-details of the document. The preview of this page is different? How can I implement this preview?
The main problem you have here is that the you don't have any nodeRef request parameter when viewing a workflow task (this is mapped to the {nodeRef} token that is assigned to the <nodeRef> element in the web-preview component. As a result the web-preview WebScript will not have a node to render.
You are either going to need to make a customization such that the nodeRef of the attached file is included as a request parameter when viewing the workflow task or use your own WebScript (other than the web-preview WebScript) in order to access the nodeRef of the document to preview.
A couple of other things to consider here, is that it is entirely possible to have more than one document assigned to a workflow, so you'd need to handle that scenario (i.e. which document is previewed, or how to preview all documents).
I don't think that this is going to be a simple customization though.
It can be easier to just use the javascript previewer that is integrated in share (pdf.js). If you use directly the javascript library, it shouldn't be difficult to open a preview.
There are examples in the official site of the project: pdf.js
you can use the share webscript to initialise the javascript with the list of urls of the documents attached to the workflow. If the document attached is not a pdf, you will need to use its pdf rendition.
For future references. You can do it as follows (example):
Create Share extension and add the following container to the /src/main/amp/config/alfresco/templates/org/alfresco/workflow-details.ftl:
<div class="yui-gc">
<div class="yui-u first">
<#if (config.scoped['DocumentDetails']['document-details'].getChildValue('display-web-preview') == "true")>
<#region id="web-preview" scope="template"/>
</#if>
</div>
</div>
Also add the same #templateHeader as in the document-details.ftl. Your workflow-details.ftl will look like this:
<#include "include/alfresco-template.ftl" />
<#templateHeader>
<#script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/>
<#link rel="stylesheet" type="text/css" href="${url.context}/res/components/document-details/document-details-panel.css" group="document-details"/>
<#templateHtmlEditorAssets />
</#>
<#templateBody>
<#markup id="alf-hd">
<div id="alf-hd">
<#region scope="global" id="share-header" chromeless="true"/>
<#region id="title" scope="template"/>
<#if page.url.args.nodeRef??>
<#region id="path" scope="template"/>
</#if>
</div>
</#>
<#markup id="bd">
<div id="bd">
<div class="share-form">
<#region id="data-header" scope="page" />
<#region id="data-form" scope="page" />
<div class="yui-gc">
<div class="yui-u first">
<#if (config.scoped['DocumentDetails']['document-details'].getChildValue('display-web-preview') == "true")>
<#region id="web-preview" scope="template"/>
</#if>
</div>
</div>
<#region id="data-actions" scope="page" />
</div>
</div>
</#>
</#>
<#templateFooter>
<#markup id="alf-ft">
<div id="alf-ft">
<#region id="footer" scope="global"/>
<#region id="data-loader" scope="page" />
</div>
</#>
</#>
Add the WebPreview component to the \src\main\amp\config\alfresco\site-data\template-instances\workflow-details.xml:
<!-- WebPreview -->
<component>
<region-id>web-preview</region-id>
<sub-components>
<sub-component id="default">
<evaluations>
<evaluation>
<evaluators>
<evaluator type="config.component.evaluator">
<params>
<element>DocumentDetails/document-details/display-web-preview</element>
</params>
</evaluator>
</evaluators>
<url>/components/preview/web-preview</url>
<properties>
<nodeRef>{nodeRef}</nodeRef>
<api>api</api>
<proxy>alfresco</proxy>
<dependencyGroup>document-details</dependencyGroup>
</properties>
</evaluation>
</evaluations>
</sub-component>
</sub-components>
</component>
Your workflow-details.xml will look like this:
<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
<template-type>org/alfresco/workflow-details</template-type>
<properties>
<pageFamily>documentlibrary</pageFamily>
</properties>
<components>
<!-- Site Navigation -->
<component>
<region-id>navigation</region-id>
<sub-components>
<sub-component id="default">
<evaluations>
<!-- if referred from my tasks page: Task toolbar -->
<evaluation id="tasks">
<evaluators>
<evaluator type="equals.component.evaluator">
<params>
<referrer>{referrer}</referrer>
<tasks>tasks</tasks>
</params>
</evaluator>
</evaluators>
<url>/components/workflow/task-toolbar</url>
</evaluation>
<!-- if referred from my workflows page: Workflows toolbar -->
<evaluation id="workflows">
<evaluators>
<evaluator type="equals.component.evaluator">
<params>
<referrer>{referrer}</referrer>
<workflows>workflows</workflows>
</params>
</evaluator>
</evaluators>
<url>/components/workflow/workflow-toolbar</url>
</evaluation>
<!-- if in site: Site navigation -->
<evaluation id="site">
<evaluators>
<evaluator type="site.component.evaluator"/>
</evaluators>
<url>/components/navigation/collaboration-navigation</url>
</evaluation>
</evaluations>
</sub-component>
</sub-components>
</component>
<!-- WebPreview -->
<component>
<region-id>web-preview</region-id>
<sub-components>
<sub-component id="default">
<evaluations>
<evaluation>
<evaluators>
<evaluator type="config.component.evaluator">
<params>
<element>DocumentDetails/document-details/display-web-preview</element>
</params>
</evaluator>
</evaluators>
<url>/components/preview/web-preview</url>
<properties>
<nodeRef>{nodeRef}</nodeRef>
<api>api</api>
<proxy>alfresco</proxy>
<dependencyGroup>document-details</dependencyGroup>
</properties>
</evaluation>
</evaluations>
</sub-component>
</sub-components>
</component>
<!-- Path -->
<component>
<region-id>path</region-id>
<sub-components>
<sub-component id="default">
<evaluations>
<!-- if in site: Site title -->
<evaluation id="site">
<evaluators>
<evaluator type="site.component.evaluator"/>
</evaluators>
<url>/components/document-details/path</url>
</evaluation>
<!-- otherwise: Repository title -->
<evaluation id="repo">
<url>/components/document-details/repo/path</url>
</evaluation>
</evaluations>
</sub-component>
</sub-components>
</component>
</components>
</template-instance>
If you want to place the component in an arbitrary region, you may need to use JavaScript, for example:
...
var container = YAHOO.util.Dom.get('user-list');
var web_preview = YAHOO.util.Dom.get('template_x002e_web-preview_x002e_workflow-details_x0023_default');
YAHOO.util.Dom.insertAfter(web_preview, container);
...
The container with ID==user-list I placed in the userdetails.ftl which added to the share-config-custom.xml as follows:
...
<field id="mswf:userDetails" set="userDetails" label="...">
<control template="/org/alfresco/components/form/controls/workflow/userdetails.ftl" />
</field>
...
The result may look as shown below.
Here is an easier solution that handles multiple documents and uses web-preview component:
In your share-config-custom.xml override packageItems field:
<field id="packageItems" set="items">
<control template="/com/yourdomain/components/form/controls/workflow/packageitems.ftl" />
</field>
Control template (/com/yourdomain/components/form/controls/workflow/packageitems.ftl):
<#include "/org/alfresco/components/form/controls/workflow/packageitems.ftl" />
<#assign el>${controlId}-wp</#assign>
<#assign dependencyGroup="web-preview">
<#include "/org/alfresco/components/preview/include/web-preview-css-dependencies.lib.ftl" />
<#include "/org/alfresco/components/preview/include/web-preview-js-dependencies.lib.ftl" />
<div class="yui-g" id="${el}"></div>
<script type="text/javascript">//<![CDATA[
(function(){
var nodeRefs = ("${field.value?html}" || "").split(',');
for (var ni = 0; ni < nodeRefs.length; ni++) {
Alfresco.util.loadWebscript({
url: Alfresco.constants.URL_SERVICECONTEXT + "components/preview/web-preview",
properties: { nodeRef: nodeRefs[ni], htmlid: "${el}-preview-" + ni},
target: "${el}"
});
}
})();
//]]></script>
I'm trying to run simple Seam PageFlow example NumberGuss. I have deployed it on Jboss Server. When I access the URL it lands on the first page but if I hit any of the button provided on that page it says "The page isn't redirecting properly".On server log I found
SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-16) Error Rendering View[/debug.xhtml]: org.jboss.weld.context.NonexistentConversationException: WELD-000321: No conversation found to restore for id 1.
I'm using wildfly-8.1.0 and jboss-seam-2.3.1
Attaching pageflow.jpdl.xml and numberGuess.xhtml for reference. Please help me resolve the issue I'm facing.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.org/schema/seam/taglib">
<h:head>
<title>Guess a number...</title>
<link href="niceforms.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="niceforms.js"><!-- --></script>
</h:head>
<body>
<h1>Guess a number...</h1>
<h:form id="NumberGuessMain" styleClass="niceform">
<div>
<h:messages id="messages" globalOnly="true"/>
<h:outputText id="Higher"
value="Higher!"
rendered="#{numberGuess.randomNumber gt numberGuess.currentGuess}"/>
<h:outputText id="Lower"
value="Lower!"
rendered="#{numberGuess.randomNumber lt numberGuess.currentGuess}"/>
</div>
<div>
I'm thinking of a number between <h:outputText id="Smallest" value="#{numberGuess.smallest}"/> and
<h:outputText id="Biggest" value="#{numberGuess.biggest}"/>. You have
<h:outputText id="RemainingGuesses" value="#{numberGuess.remainingGuesses}"/> guesses.
</div>
<div>
Your guess:
<h:inputText id="inputGuess" value="#{numberGuess.currentGuess}" required="true" size="3"
rendered="#{(numberGuess.biggest-numberGuess.smallest) gt 20}">
<f:validateLongRange maximum="#{numberGuess.biggest}"
minimum="#{numberGuess.smallest}"/>
</h:inputText>
<h:selectOneMenu id="selectGuessMenu" value="#{numberGuess.currentGuess}" required="true" rendered="#{numberGuess.selectMenuRendered}">
<s:selectItems id="PossibilitiesMenuItems" value="#{numberGuess.possibilities}" var="i" label="#{i}"/>
</h:selectOneMenu>
<h:selectOneRadio id="selectGuessRadio" value="#{numberGuess.currentGuess}" required="true" rendered="#{numberGuess.radioButtonRendered}">
<s:selectItems id="PossibilitiesRadioItems" value="#{numberGuess.possibilities}" var="i" label="#{i}"/>
</h:selectOneRadio>
<h:commandButton id="GuessButton" value="Guess" action="guess"/>
<s:button id="CheatButton" value="Cheat" action="cheat"/>
<s:button id="GiveUpButton" value="Give up" action="giveup"/>
</div>
<div>
<h:message id="message" for="inputGuess" style="color: red"/>
</div>
</h:form>
</body>
</html>
<!--
An example of pageflow in jPDL. This exemplifies the
approach where action handlers are attached transitions
and decision nodes, instead of view components.
An alternative approach would be to attach all action
handlers to view components, and let the jPDL define
only the navigation rules.
-->
<pageflow-definition
xmlns="http://jboss.org/schema/seam/pageflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.org/schema/seam/pageflow http://jboss.org/schema/seam/pageflow-2.3.xsd"
name="numberGuess">
<start-page name="displayGuess" view-id="/numberGuess.xhtml">
<redirect/>
<transition name="guess" to="evaluateGuess">
<action expression="#{numberGuess.guess}"/>
</transition>
<transition name="giveup" to="giveup"/>
<transition name="cheat" to="cheat"/>
</start-page>
<decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
<transition name="true" to="win"/>
<transition name="false" to="evaluateRemainingGuesses"/>
</decision>
<decision name="evaluateRemainingGuesses" expression="#{numberGuess.lastGuess}">
<transition name="true" to="lose"/>
<transition name="false" to="displayGuess"/>
</decision>
<page name="giveup" view-id="/giveup.xhtml">
<redirect/>
<transition name="yes" to="lose"/>
<transition name="no" to="displayGuess"/>
</page>
<process-state name="cheat">
<sub-process name="cheat"/>
<transition to="displayGuess"/>
</process-state>
<page name="win" view-id="/win.xhtml">
<redirect/>
<end-conversation/>
</page>
<page name="lose" view-id="/lose.xhtml">
<redirect/>
<end-conversation/>
</page>
</pageflow-definition>
Resolved the issue.Weld is scanning the archive, which seems to cause the problem.The Weld Docs says:
You can either set this up for your deployment only by adding the following content to the META-INF/jboss-all.xml file of your application.
jboss-all.xml file goes to your META-INF for ear archive and likely to WEB-INF for war archive
<jboss xmlns="urn:jboss:1.0">
<weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
</jboss>
It worked for me.
I have a tree im my mxml that uses a XMLListCollection as dataProvider. It´s XML is like:
<list>
<conta nome="Plano de Contas" id="1">
<conta nome="Creditos" id="2" />
<conta nome="Vendas" id="4" />
<conta nome="Juros" id="5" />
<conta nome="Debitos" id="3" />
</conta>
</list>
How can I make the node for, say, id==4 visible AND selected?
Thank you.
var xml:XML =
<list>
<conta nome="Plano de Contas" id="1">
<conta nome="Creditos" id="2" />
<conta nome="Vendas" id="4" />
<conta nome="Juros" id="5" />
<conta nome="Debitos" id="3" />
</conta>
</list>;
//find node conta with id=4 using xml selectors
var node:XML = xml.descendants("conta").(#id == 4)[0];
tree.selectedItem = node;
You might need to open node parents if they are not, mx:Tree might not do this automatically.
For selection you can use, this.myTree.selectedIndex=4, that done, it should become visible automatically.