I have a PostGIS table published in Geoserver.PostGIS table
How can I use the "color" column to styling polygon in Geoserver by using SLD?
I try using CQL expression but not working. Any idea? Thank you.
you can use Attribute-based line in sld styling:
<FeatureTypeStyle>
<Rule>
<Name>local-road</Name>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>type</ogc:PropertyName>
<ogc:Literal>local-road</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#009933</CssParameter>
<CssParameter name="stroke-width">2</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<Name>secondary</Name>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>type</ogc:PropertyName>
<ogc:Literal>secondary</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0055CC</CssParameter>
<CssParameter name="stroke-width">3</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<Name>highway</Name>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>type</ogc:PropertyName>
<ogc:Literal>highway</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FF0000</CssParameter>
<CssParameter name="stroke-width">6</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
reference:
https://docs.geoserver.org/stable/en/user/styling/sld/cookbook/lines.html#example-lines-layer
Related
I have a existing user flow which is working as expected with verify code and continue button action. Currently the issue is user has to click so many action buttons to login if MFA is enabled. So the expected user flow should skip or bypass the step of continue where verify action button will handle both validation of otp as well as continue user flow in single click. I am trying to combine step to verify code and continue button in one action. Any kind of help is appreciated and thanks in advance. Attaching image for better understanding too. Below is my code
<DisplayControls>
<DisplayControl Id="emailVerificationControl" UserInterfaceControlType="VerificationControl">
<DisplayClaims>
<DisplayClaim ClaimTypeReferenceId="email" Required="true" />
<DisplayClaim ClaimTypeReferenceId="verificationCode" ControlClaimType="VerificationCode" Required="true" />
</DisplayClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="email" />
</OutputClaims>
<Actions>
<Action Id="SendCode">
<ValidationClaimsExchange>
<ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SelfAsserted-GenerateOtp" />
<ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SendGridSendOtp" />
</ValidationClaimsExchange>
</Action>
<Action Id="VerifyCode">
<ValidationClaimsExchange>
<ValidationClaimsExchangeTechnicalProfile TechnicalProfileReferenceId="SelfAsserted-VerifyOtp" />
</ValidationClaimsExchange>
</Action>
</Actions>
</DisplayControl>
<ClaimsProvider>
<DisplayName>SelfAsserted-VerifyOtp</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="SelfAsserted-VerifyOtp">
<DisplayName>Verify one time password</DisplayName>
<Protocol
Name="Proprietary"
Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
/>
<Metadata>
<Item Key="Operation">VerifyCode</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="identifier" />
<InputClaim ClaimTypeReferenceId="verificationCode" PartnerClaimType="otpToVerify" />
</InputClaims>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
<ClaimsProvider>
<DisplayName>SelfAsserted-GenerateOtp</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="SelfAsserted-GenerateOtp">
<DisplayName>Generate one time password</DisplayName>
<Protocol
Name="Proprietary"
Handler="Web.TPEngine.Providers.OneTimePasswordProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
/>
<Metadata>
<Item Key="Operation">GenerateCode</Item>
<Item Key="CodeExpirationInSeconds">1200</Item>
<Item Key="CodeLength">6</Item>
<Item Key="CharacterSet">0-9</Item>
<Item Key="ReuseSameCode">true</Item>
<Item Key="NumRetryAttempts">5</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="identifier" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="otp" PartnerClaimType="otpGenerated" />
</OutputClaims>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
Existing User Flow
Expected User Flow
You cannot merge the Verify code and Continue buttons in one button using Custom Policy. You need to work with a front-end developer to use a custom HTML page for your signup/sign-in with JavaScript/CSS for this purpose.
You may consider using JavaScript MutationObserver to detect that the Continue button has been enabled, then automate the clicks with javascript
we are trying to set a custom user attribute
we have managed to show to define it the TrustFrameworkExtensions.xml ClaimsSchema
<ClaimType Id="extension_GDPR_CONSENT">
<DisplayName>extension_GDPR_CONSENT</DisplayName>
<DataType>string</DataType>
<UserInputType>CheckboxMultiSelect</UserInputType>
<Restriction>
<Enumeration Text="Accept" Value="true" SelectByDefault="false" />
</Restriction>
</ClaimType>
and also we menaged to show in our signup form
<DisplayName>Local Account</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
<DisplayClaims>
<DisplayClaim DisplayControlReferenceId="emailVerificationControl"/>
<!--DisplayClaim ClaimTypeReferenceId="displayName" Required="true" />
<DisplayClaim ClaimTypeReferenceId="givenName" Required="true" />
<DisplayClaim ClaimTypeReferenceId="surName" Required="true" /-->
<DisplayClaim ClaimTypeReferenceId="newPassword" Required="true" />
<DisplayClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
<DisplayClaim ClaimTypeReferenceId="extension_GDPR_CONSENT" Required="true" />
We have also updated the
<TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
<Metadata>
<Item Key="Operation">Write</Item>
<Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">true</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
<InputClaims>
<InputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" Required="true" />
</InputClaims>
<PersistedClaims>
<!-- Required claims -->
<PersistedClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" />
<PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password"/>
<PersistedClaim ClaimTypeReferenceId="displayName" DefaultValue="TestCustomPolicy" />
<PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration" />
<PersistedClaim ClaimTypeReferenceId="extension_GDPR_CONSENT"/>
Adding the directory extension to the persistent claim
But it gives us a validation error?
Regards
To enable extension attributes in the custom policy, provide Application ID and Application Object ID in the AAD-Common technical profile metadata.
<ClaimsProvider>
<DisplayName>Azure Active Directory</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="AAD-Common">
<Metadata>
<!--Insert b2c-extensions-app application ID here, for example: 11111111-1111-1111-1111-111111111111-->
<Item Key="ClientId"></Item>
<!--Insert b2c-extensions-app application ObjectId here, for example: 22222222-2222-2222-2222-222222222222-->
<Item Key="ApplicationObjectId"></Item>
</Metadata>
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>
Check Out the link to know more : https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-flow-custom-attributes?pivots=b2c-custom-policy
From the Watson Dialog document, it indicates the configuration setups for connecting with NLC. But it is hard to understand how this works without a running sample application. Most of examples can be googled are without such settings. I were trying to find some examples which using the indicated setups from 'classifier' settings and 'INTENT:{xxxxxx}' settings etc. per docuemnt . It will be great if someone could help on this, very appreciated.
Here is an example using the demo NLC training data. Save that text to a CSV file.
Create your NLC service. Name of the service doesn't matter.
Once created, click the "Access Beta Toolkit". You will need to login again, and allow the toolkit access to the NLC service.
Click the "Upload training data" button. Select your CSV file you saved earlier. If it works, you will see your intents + questions. If it fails, most common issue is not giving it a csv file extension.
Click "Create classifier". Name is not important.
Clicking training data/classifiers to see if it has finished compiling. It can take some time to complete.
Once the classifier finishes compiling it should show you the classifier id value. Example: 3d84bfx43-nlc-10356
Copy the text below to an XML file. Where you see CLASSIFIER_ID_GOES_HERE change to your classifier id.
<?xml version="1.0" encoding="UTF-8"?>
<dialog xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<flow>
<folder label="Main">
<output>
<prompt selectionType="RANDOM">
<item>Enter your weather related question.</item>
</prompt>
<getUserInput>
<search ref="folder_200143"/>
<default>
<output>
<prompt selectionType="RANDOM">
<item>I couldn't determine what you are asking about.</item>
</prompt>
</output>
</default>
</getUserInput>
</output>
</folder>
<folder label="Library">
<folder label="NLC Intents" id="folder_200143">
<input isAutoLearnCandidate="false" isRelatedNodeCandidate="true">
<grammar>
<item>conditions</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>I believe you are asking about conditions. </item>
</prompt>
</output>
</input>
<input>
<grammar>
<item>temperature</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>I believe you are asking about temperture. </item>
</prompt>
</output>
</input>
</folder>
</folder>
<folder label="Global"/>
<folder label="Concepts"/>
</flow>
<constants>
<var_folder name="Home"/>
</constants>
<variables>
<var_folder name="Home">
<var name="CLASSIFIER_CLASS_0" type="TEXT" description="auto-created"/>
<var name="CLASSIFIER_CONF_0" type="TEXT" description="auto-created"/>
<var name="CLASSIFIER_CLASS_1" type="TEXT" description="auto-created"/>
<var name="CLASSIFIER_CONF_1" type="TEXT" description="auto-created"/>
</var_folder>
</variables>
<settings>
<setting name="AUTOLEARN" type="USER">false</setting>
<setting name="LANGUAGE" type="USER">en-US</setting>
<setting name="RESPONSETIME" type="USER">-2</setting>
<setting name="MAXAUTOLEARNITEMS" type="USER">4</setting>
<setting name="NUMAUTOSETRELATED" type="USER">0</setting>
<setting name="TIMEZONEID" type="USER">Australia/Sydney</setting>
<setting name="AUTOSETRELATEDNODEID" type="USER">0</setting>
<setting name="INPUTMASKTYPE" type="USER">0</setting>
<setting name="CONCEPTMATCHING" type="USER">0</setting>
<setting name="DNR_NODE_ID">-15</setting>
<setting name="MULTISENT">0</setting>
<setting name="USE_CONCEPTS">3</setting>
<setting name="ENTITIES_SCOPE">3</setting>
<setting name="USER_LOGGING">2</setting>
<setting name="USE_TRANSLATIONS">3</setting>
<setting name="USE_STOP_WORDS">3</setting>
<setting name="USE_SPELLING_CORRECTIONS">3</setting>
<setting name="USE_AUTOMATIC_STOPWORDS_DETECTION">0</setting>
<setting name="PLATFORM_VERSION">10.1</setting>
<setting name="UI_COLOUR"></setting>
<setting name="PARENT_ACCOUNT"></setting>
<setting name="AL_NONE_LABEL">None of the above</setting>
<setting name="CLS_SEARCH_MODE">0</setting>
<setting name="CLS_MODEL">0</setting>
<setting name="CLS_ENDPOINT"></setting>
<setting name="CLS_USERNAME"></setting>
<setting name="CLS_PASSWORD"></setting>
<setting name="CLS_MODELNAME">CLASSIFIER_ID_GOES_HERE</setting>
<setting name="CLS_ADVANCED_SETTINGS">false</setting>
<setting name="CLS_MAXNBEST">3</setting>
<setting name="CLS_USE_OFFTOPIC">false</setting>
<setting name="DEFAULT_DNR_RETURN_POINT_CANDIDATE">-1</setting>
</settings>
<specialSettings>
<specialSetting label="DNR Join Statement">
<variations/>
</specialSetting>
<specialSetting label="AutoLearn Statement">
<variations/>
</specialSetting>
</specialSettings>
</dialog>
Upload that file to your dialog service and test it.
I'm designing Watson dialog to support following scenario: user to select intent 1,2, or 3. When user select intent 2, Watson will ask user to specify either option 1 or 2 or alternatively other valid intents.
Following is my current dialog file:
<?xml version="1.0" encoding="UTF-8"?>
<dialog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="WatsonDialogDocument_1.0.xsd">
<flow>
<folder label="Main" id="Main">
<output id="start">
<prompt selectionType="RANDOM">
<item>DIALOG START - asking for user input</item>
</prompt>
<goto ref="processUserInput_start"/>
</output>
<getUserInput id="processUserInput_start">
<search ref="library_supported-intents"/>
<default>
<output>
<prompt selectionType="RANDOM">
<item>I am sorry, I did not understand your intents. Please choose intent1, intent2, or intent3.</item>
</prompt>
</output>
</default>
</getUserInput>
<getUserInput id="processUserInput_intent2">
<search ref="library_supported-intents"/>
<input>
<grammar>
<item>option1</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 2 with option 1</item>
</prompt>
</output>
<goto ref="processUserInput_start"/>
</input>
<input>
<grammar>
<item>option2</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 2 with option 2</item>
</prompt>
</output>
<goto ref="processUserInput_start"/>
</input>
<output>
<prompt selectionType="RANDOM">
<item>Sorry, I can only understand option1 and option2 for intent2. Try again</item>
</prompt>
<goto ref="processUserInput_intent2"/>
</output>
</getUserInput>
</folder>
<folder label="Library" id="Library">
<folder label="Main Input" id="library_supported-intents">
<input>
<grammar>
<item>intent1</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 1</item>
</prompt>
</output>
</input>
<input>
<grammar>
<item>intent2</item>
</grammar>
<goto ref="intent2-detail"/>
</input>
<input>
<grammar>
<item>intent3</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 3</item>
</prompt>
</output>
</input>
</folder>
<folder label="Intent 2 Input" id="library_intent2">
<output id="intent2-detail">
<prompt selectionType="RANDOM">
<item>OK. I need further info to execute intent 2. Choose option1 or option2</item>
</prompt>
<goto ref="processUserInput_intent2"/>
</output>
</folder>
</folder>
<folder label="Concepts" id="Concepts"></folder>
</flow>
</dialog>
Unfortunately, I could not get appropriate invalid dialog message being displayed - e.g. Watson shows invalid option instead of invalid intent message, as following:
How should I structure recovery dialog flow to achieve above scenario?
try to put the goto inside the output node
<input>
<grammar>
<item>option1</item>
</grammar>
<output>
<prompt selectionType="RANDOM">
<item>OK. Executing intent 2 with option 1</item>
</prompt>
<goto ref="processUserInput_start"/>
</output>
</input>
I am trying to create a dialog with image preview on it. I am able to create dialog with all the fields but i am facing issue with image. I have seen the image component where you can drag drop image but i need the image to be shown when i open dialog component. Is there any component for this without drag drop.
I have tried with html5smartimage image but not working. Please see code below:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}500"
title="Test Dialog"
width="{Long}800"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Component Details">
<items jcr:primaryType="cq:WidgetCollection">
<image
jcr:primaryType="cq:Widget"
cropParameter="./imageCrop"
ddGroups="[media]"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
mapParameter="./imageMap"
name="./file"
requestSuffix=".img.png"
rotateParameter="./imageRotate"
title="Image"
xtype="html5smartimage">
<icon.png jcr:primaryType="nt:file">
<jcr:content
jcr:data="{Binary}"
jcr:lastModified="{Date}2015-07-28T19:27:46.878+05:30"
jcr:lastModifiedBy="admin"
jcr:mimeType="image/png"
jcr:primaryType="nt:resource"
jcr:uuid="754c14c8-4423-45df-b982-06bfc13dc6e3"/>
</icon.png>
</image>
</items>
</tab1>
</items>
</items>
</jcr:root>
Please help me out on this.
I don't think there is a need to use the html5smartimage if all that you want to do is, display a static image in the dialog (which needn't get submitted too).
You can make use of the xtype displayfield and use the html property as shown below.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0"
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}500"
title="Test Dialog"
width="{Long}800"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Component Details">
<items jcr:primaryType="cq:WidgetCollection">
<displayimage jcr:primaryType="cq:Widget"
html="<img src='/content/dam/geometrixx/icons/target.png'>"
xtype="displayfield" />
</items>
</tab1>
</items>
</items>
</jcr:root>
Replace the image src with the path to your image which you want to display in the dialog.