cq5. using pathField xtype in dialog - dialog

I want to use pathfield in dialog of my component.
According link
I added
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
plugins="customRootPathPlugin"
xtype="pathfield" />
to my dialog.xml
I tryed differents varians:
1
<?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"
jcr:primaryType="cq:Dialog"
title="Example Component Dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
plugins="customRootPathPlugin"
xtype="pathfield" />
/>
</items>
</items>
</jcr:root>
2
<?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"
jcr:primaryType="cq:Dialog"
title="Example Component Dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
plugins="customRootPathPlugin"
xtype="pathfield" />
</items>
</items>
</jcr:root>
3
<?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"
jcr:primaryType="cq:Dialog"
title="Example Component Dialog"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
plugins="customRootPathPlugin"
xtype="pathfield" />
</items>
</jcr:root>
4
<?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"
jcr:primaryType="cq:Dialog"
title="Example Component Dialog"
xtype="dialog">
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
plugins="customRootPathPlugin"
xtype="pathfield" />
</jcr:root>
5
<?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"
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
plugins="customRootPathPlugin"
xtype="pathfield" />
</jcr:root>
only in some cases after double click by component I see component reaction. But there are arise empty list :
What I need to read for resolve my problem ?

The linked answer presented how to implement an dynamic pathfield (eg. one that allows to set different root path depending on the current site). If you'd like to create a dialog with a single, normal pathfield widget, following code will do:
<?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"
title="Simple dialog"
xtype="dialog">
<items jcr:primaryType="cq:WidgetCollection">
<tabPanel
jcr:primaryType="cq:TabPanel"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Widget"
anchor="100%"
title="General"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<myPathComponent
jcr:primaryType="cq:Widget"
fieldLabel="My path component"
xtype="pathfield" />
</items>
</tab1>
</items>
</tabPanel>
</items>
</jcr:root>

Related

No stock_available section for newly created product via Prestashop webservices

as the title says, I can successfully create a new Product via Prestashop 1.6.1 webservice. The problem is that the new product XML has an empty stock_available section:
<stock_availables nodeType="stock_available" api="stock_availables" />
so I have no idea how to set the initial quantity for that product. If I set it manually from the back office, the stock_available section is filled.
Maybe there is something I'm missing in the XML request? Here it is:
<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<product>
<id/>
<id_manufacturer/>
<id_supplier/>
<id_category_default>52</id_category_default>
<new/>
<cache_default_attribute/>
<id_default_image/>
<id_default_combination/>
<id_tax_rules_group/>
<position_in_category/>
<type/>
<id_shop_default/>
<reference>A130</reference>
<supplier_reference/>
<location/>
<width/>
<height/>
<depth/>
<weight/>
<quantity_discount/>
<ean13/>
<upc/>
<cache_is_pack/>
<cache_has_attachments/>
<is_virtual/>
<on_sale/>
<online_only/>
<ecotax/>
<minimal_quantity/>
<price>1.30</price>
<wholesale_price/>
<unity/>
<unit_price_ratio/>
<additional_shipping_cost/>
<customizable/>
<text_fields/>
<uploadable_files/>
<active>1</active>
<redirect_type/>
<id_product_redirected/>
<available_for_order>1</available_for_order>
<available_date/>
<condition/>
<show_price>1</show_price>
<indexed>1</indexed>
<visibility/>
<advanced_stock_management/>
<date_add/>
<date_upd/>
<pack_stock_type/>
<meta_description>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</meta_description>
<meta_keywords>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</meta_keywords>
<meta_title>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</meta_title>
<link_rewrite>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</link_rewrite>
<name>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</name>
<description>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</description>
<description_short>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</description_short>
<available_now>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[product name]]></language>
</available_now>
<available_later>
<language id="1" xlink:href="http://www.mysite.it/prestashop/api/languages/1"><![CDATA[available later]]></language>
</available_later>
<associations>
<categories>
<category>
<id/>
</category>
<category>
<id>52</id>
</category>
</categories>
<images>
<image>
<id/>
</image>
</images>
<combinations>
<combination>
<id/>
</combination>
</combinations>
<product_option_values>
<product_option_value>
<id/>
</product_option_value>
</product_option_values>
<product_features>
<product_feature>
<id/>
<id_feature_value/>
</product_feature>
</product_features>
<tags>
<tag>
<id/>
</tag>
</tags>
<stock_availables>
<stock_available>
<id/>
<id_product_attribute/>
</stock_available>
</stock_availables>
<accessories>
<product>
<id/>
</product>
</accessories>
<product_bundle>
<product>
<id/>
<quantity/>
</product>
</product_bundle>
</associations>
</product>
</prestashop>
Thank you for any help!
Iuri
The problem was probably a bug with that version of Prestashop. With the latest version (1.6.1.17) it works correctly.

How to align a label and button at baseline?

Id like to place a label and a button (and a text field) in a horizontal layout. This works, but the baselines are unaligned. How to fix that?
The expected result is that the red lines (baselines of each control) are at the same height.
This is the FXML:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<HBox prefHeight="100.0" prefWidth="400.0" spacing="10.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label text="Label" />
<Button mnemonicParsing="false" text="Button" />
<TextField text="Lorem Ipsum" />
</children>
</HBox>
Add an alignment attribute to the HBox with value "BASELINE_LEFT":
<HBox alignment="BASELINE_LEFT" prefHeight="100.0" prefWidth="400.0" spacing="10.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label text="Label" />
<Button mnemonicParsing="false" text="Button" />
<TextField text="Lorem Ipsum" />
</children>
</HBox>

How to remove the specific attribute from XmlDocument

My Xml as below
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order>
<class>
<about></about>
</class>
<dataset>
<subjects>
<subject>
<addresses>
<address/>
</addresses>
</subject>
</subjects>
</dataset>
</order>
To reorder the xml element and to add namespace i did it as per below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order>
<class>
<about></about>
</class>
<dataset>
<subjects>
<subject>
</subject>
</subjects>
<addresses>
<address/>
</addresses>
</dataset>
</order>
I did using below code
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlClueReqToLexisNexis.NameTable);
nsmgr.AddNamespace("ab", "http://example.com/abc");
XmlNode order = xmlClueReqToLexisNexis.SelectSingleNode("//ab:order", nsmgr);
XmlNode dataset = xmlClueReqToLexisNexis.SelectSingleNode("//ab:order//ab:dataset", nsmgr);
var subjects = order.SelectSingleNode("//ab:order//ab:dataset//ab:subjects", nsmgr);
I am able to reorder and add namespace to it but it left behind xmlns attribute
as below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order>
<class>
<about></about>
</class>
<dataset>
<subjects>
<subject xmlns="">
</subject>
</subjects>
<addresses xmlns="">
<address/>
</addresses>
</dataset>
</order>
I want to remove only attribute xmlns="" out of addresses and subject
Please suggest me the best way to do that.

Is it possible to add a separator in a javafx choicebox in FXML?

This document describes how to add a separator to a javafx 2 choicebox by code:
http://docs.oracle.com/javafx/2/ui_controls/choice-box.htm
I would like to achieve the same using a FXML layout. Any ideas?
.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.HBox?>
<?import java.lang.*?>
<HBox xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2">
<ChoiceBox>
<String fx:value="Item 1" />
<String fx:value="Item 2" />
<Separator />
<String fx:value="Item 3" />
</ChoiceBox>
</HBox>
Don't forget to import the correct Class. With importing the correct classpath you can include any class and try to display it, even your self-made. Just open the FXML in your SceneBuilder and use Preview to see it in action without building a custom fxml loader for it.
This should do it. Replace the "Items" with your own content. Also, take a look at the FXML reference found here for more information on using FXML.
<ChoiceBox>
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="Item 1" />
<String fx:value="Item 2" />
<Separator fx:id="separator"/>
<String fx:value="Item 3" />
</FXCollections>
</items>
</ChoiceBox>

What is wrong with this Sharepoint workflow XML?

I am programmatically starting a workflow by calling workflowManager.StartWorkflow and passing it the XML for workflow below. The workflow just errors and fails. The workflow I am using is the OOTB Approval workflow. Is the structure for my XML incorrect?
<?xml version="1.0" encoding="UTF-8"?>
<dfs:myFields xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types"
xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields"
xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields"
xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes"
xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dfs:dataFields>
<d:SharePointListItem_RW>
<d:Approvers>
<Assignment>
<Assignee>
<pc:Person>
<pc:DisplayName>Jia Ji JOnes</pc:DisplayName>
<pc:AccountId>ZZZDomain\jjones</pc:AccountId>
<pc:AccountType>User</pc:AccountType>
</pc:Person>
</Assignee>
<d:Stage xsi:nil="true" />
<d:AssignmentType>Parallel</d:AssignmentType>
</Assignment>
<Assignment>
<Assignee>
<pc:Person>
<pc:DisplayName>Matthew Jones</pc:DisplayName>
<pc:AccountId>ZZZDomain\mjones</pc:AccountId>
<pc:AccountType>User</pc:AccountType>
</pc:Person>
</Assignee>
<d:Stage xsi:nil="true" />
<d:AssignmentType>Parallel</d:AssignmentType>
</Assignment>
<Assignment>
<Assignee>
<pc:Person>
<pc:DisplayName>Maree H Jones</pc:DisplayName>
<pc:AccountId>ZZZDomain\mhjones</pc:AccountId>
<pc:AccountType>User</pc:AccountType>
</pc:Person>
</Assignee>
<d:Stage xsi:nil="true" />
<d:AssignmentType>Parallel</d:AssignmentType>
</Assignment>
</d:Approvers>
<d:ExpandGroups>true</d:ExpandGroups>
<d:NotificationMessage>A skill rating has been created which requires your approval.</d:NotificationMessage>
<d:DueDateforAllTasks xsi:nil="true" />
<d:DurationforSerialTasks>5</d:DurationforSerialTasks>
<d:DurationUnits>Day</d:DurationUnits>
<d:CC />
<d:CancelonRejection>true</d:CancelonRejection>
<d:CancelonChange>false</d:CancelonChange>
<d:EnableContentApproval>true</d:EnableContentApproval>
</d:SharePointListItem_RW>
</dfs:dataFields>
</dfs:myFields>
The XML was invalid for the approval workflow. The correct XML is below.
<?xml version="1.0" encoding="UTF-8"?>
<dfs:myFields xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<dfs:queryFields />
<dfs:dataFields>
<d:SharePointListItem_RW>
<d:Approvers>
<Assignment>
<Assignee>
<pc:Person>
<pc:DisplayName>Jia Ji JOnes</pc:DisplayName>
<pc:AccountId>ZZZDomain\jjones</pc:AccountId>
<pc:AccountType>User</pc:AccountType>
</pc:Person>
<pc:Person>
<pc:DisplayName>Matthew Jones</pc:DisplayName>
<pc:AccountId>ZZZDomain\mjones</pc:AccountId>
<pc:AccountType>User</pc:AccountType>
</pc:Person>
</Assignee>
<d:Stage xsi:nil="true" />
<d:AssignmentType>Parallel</d:AssignmentType>
</Assignment>
</d:Approvers>
<d:ExpandGroups>true</d:ExpandGroups>
<d:NotificationMessage>test</d:NotificationMessage>
<d:DueDateforAllTasks xsi:nil="true" />
<d:DurationforSerialTasks>5</d:DurationforSerialTasks>
<d:DurationUnits>Day</d:DurationUnits>
<d:CC />
<d:CancelonRejection>false</d:CancelonRejection>
<d:CancelonChange>true</d:CancelonChange>
<d:EnableContentApproval>true</d:EnableContentApproval>
</d:SharePointListItem_RW>
</dfs:dataFields>
</dfs:myFields>

Resources