Image formats of theme not recognized - sulu

I want to add Thumbnail-Settings for my theme.
I'm using the default theme for the moment.
There is already a image-formats.xml in the themes config.
<?xml version="1.0" encoding="UTF-8"?>
<formats xmlns="http://schemas.sulu.io/media/formats"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/media/formats http://schemas.sulu.io/media/formats-1.0.xsd">
<format>
<name>640x480</name>
<commands>
<command>
<action>resize</action>
<parameters>
<parameter name="x">640</parameter>
<parameter name="y">480</parameter>
</parameters>
</command>
</commands>
</format>
<format>
<name>1200x</name>
<commands>
<command>
<action>scale</action>
<parameters>
<parameter name="x">1200</parameter>
</parameters>
</command>
</commands>
</format>
</formats>
The corresponding config looks like that:
# LIIP Theme Configuration
liip_theme:
themes: ["default"]
active_theme: "default"
load_controllers: false
If i dump the images in my assets the new format (the 1200x) is not shown.
I tried to reload the config and clear the cache. I also cleared the web/uploads/media folder.
What else can it be?
Here is the dump of the image in the template.
As you see, my own format is not appearing.
Media {#2167 ▼
#url: "/media/12/download/1.png?v=1"
#formats: array:10 [▼
"400x400" => "/uploads/media/400x400/02/12-1.png?v=1"
"400x400-inset" => "/uploads/media/400x400-inset/02/12-1.png?v=1"
"200x200" => "/uploads/media/200x200/02/12-1.png?v=1"
"190x" => "/uploads/media/190x/02/12-1.png?v=1"
"170x170" => "/uploads/media/170x170/02/12-1.png?v=1"
"150x100" => "/uploads/media/150x100/02/12-1.png?v=1"
"100x100" => "/uploads/media/100x100/02/12-1.png?v=1"
"100x100-inset" => "/uploads/media/100x100-inset/02/12-1.png?v=1"
"50x50" => "/uploads/media/50x50/02/12-1.png?v=1"
"640x480" => "/uploads/media/640x480/02/12-1.png?v=1"
]
#locale: "de"
#version: null
#additionalVersionData: array:1 [▶]
#fileVersion: FileVersion {#2754 ▶}
#file: File {#2751 ▶}
#entity: Media {#2748 ▶}
}
FileVersionMeta {#2759 ▼
-id: 12
-title: "1"
-description: null
-copyright: null
-locale: "de"
-fileVersion: FileVersion {#2754 ▼
-name: "1.png"
-version: 1
-size: 105564
-mimeType: "image/png"
-storageOptions: "{"segment":"04","fileName":"1.png"}"
-storageType: null
-downloadCounter: 0
-created: DateTime {#2742 ▶}
-changed: DateTime {#2743 ▶}
-id: 12
-contentLanguages: PersistentCollection {#2761 ▶}
-publishLanguages: PersistentCollection {#2763 ▶}
-meta: PersistentCollection {#2758 ▶}
-file: File {#2751 ▶}
-tags: PersistentCollection {#2756 ▶}
-changer: User {#2430 ▶ …2}
-creator: User {#2430 ▶ …2}
-defaultMeta: FileVersionMeta {#2759}
-properties: "[]"
}
}

Image Formats are stored in the container by compiler pass in the sulu_media.image.formats parameter. When you add a new image format a cache delete for BOTH Kernels is needed.
app/console cache:clear -e yourenvironment
app/webconsole cache:clear -e yourenvironment

Seems that there was a Caching problem. I already deleted the cache-folder, but it didn't work. I restarted my VM and now it works. Semms to be a problem on my side :-)

Related

Magento 2 How to change "Grand Total to be Charged" text in order emails

In Magento 2 how to change "Grand Total to be Charged" text in emails?
Text is found in this file vendor/magento/module-sales/Block/Order/Totals.php
How to override this file to my theme or module?
Thanks
Santosh
To override this class, you need to create your own class and extend the original class.
You need to declare override class in the di.xml file. Follow the steps below:
app/code/MilanDev/ExtendsCore/etc/module.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MilanDev_ExtendsCore" setup_version="1.0.0">
<sequence>
<module name="Magento_Sales"/>
</sequence>
</module>
</config>
app/code/MilanDev/ExtendsCore/etc/di.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Sales\Block\Order\Totals" type="MilanDev\ExtendsCore\Rewrite\Magento\Sales\Block\Order\Totals"/>
</config>
app/code/MilanDev/ExtendsCore/Rewrite/Magento/Sales/Block/Order/Totals.php
<?php
namespace MilanDev\ExtendsCore\Rewrite\Magento\Sales\Block\Order;
class Totals extends \Magento\Sales\Block\Order\Totals
{
/**
* Initialize order totals array
*
* #return $this
*/
protected function _initTotals()
{
// ...........
if ($this->getOrder()->isCurrencyDifferent()) {
$this->_totals['base_grandtotal'] = new \Magento\Framework\DataObject(
[
'code' => 'base_grandtotal',
'value' => $this->getOrder()->formatBasePrice($source->getBaseGrandTotal()),
'label' => __('Your custom text'), // changed
'is_formated' => true,
]
);
}
// ........
}
}

Which Attribute Of The Queues is Referenced In Diverts?

The examples of diverts have the same name for the queue as the entry so I am not clear which I use for the divert reference. e.g.
<jms-destinations>
<jms-queue name="VendorQueue">
<entry name="queue/vendor"/>
<entry name="java:jboss/exported/queue/vendor"/>
<durable>false</durable>
</jms-queue>
</jms-destinations>
Is this correct?
jms-queue add --queue-address=monitoring --entries=queue/monitoring
/subsystem=messaging/hornetq-server=default/divert=my-divert:add(divert-address=jms.queue.VendorQueue,forwarding-address=jms.queue.monitoring,exclusive=false)
i.e. is the divert-address supposed to be jms.queue.VendorQueue or jms.queue.vendor?
To get the correct divert-address you need to run this
/subsystem=messaging/hornetq-server=default:read-children-names(child-type="jms-queue")
Then prefix jms.queue
e.g.
{
"outcome" => "success",
"result" => [
"VendorQueue",
"monitoring"
]
}
becomes
jms.queue.VendorQueue
In reference to the xml, the jms-queue name is the attribute you reference not the entry name.

Kie Workbench Execute Rules

May be this question has been asked number of times but I could not figure out the actual solution by going through them. I have a decision table in KIEWorkbench which takes the input from one fact and sets it into another fact. I am trying to call the rules by invoking the endpoint: http://localhost:8085/kie-server-6.4.0.Final-ee7/services/rest/server/containers/instances/pocResult
In the header, I have set the Content-Type as application/xml.
<batch-execution lookup="ksession">
<insert out-identifier="Subject">
<demo.pocFindResult.Subject>
<bCode> ABC</bCode>
<bGCode>XY</bGCode>
<pCode>L0001</pcode>
<subjectType>CA</subjectType>
</demo.pocFindResult.Subject>
</insert>
<fire-all-rules />
<get-objects out-identifier="Result">
<demo.pocFindResult.result/>
</get-objects>
My Decision table is as below:
package demo.pocFindResult;
//from row number: 1
rule "Row 1 findrules"
ruleflow-group "fire-rules"
dialect "java"
lock-on-active true
no-loop true
when
sub : Subject( bCode == "ABC" , bGCode == "XY" , subjectType == "CA" , pCode == "L0001" )
then
Result rs = new Result();
rs.setResultStartDate( "*TODAY" );
rs.setResultEndDate( "*YEAREND" );
rs.setResultContentStartDate( "*TODAY" );
rs.setResultContentEndDate( "*YEAREND" );
insert( rs );
end
How can I get the Result object as the response? Here is my response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Container pocResult successfully called.">
<execution-results>
<results>
<item key="Subject">
<value xsi:type="jaxbListWrapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<type>LIST</type>
</value>
</item>
</results>
<facts>
<item key="Subject"/>
</facts>
</execution-results>
</response>
I want the result object with the dates set.
What is the response you get?
I would firstly try to place fire-all-rules tag after your return object. Otherwise, I would try:
<batch-execution lookup="ksession">
<insert out-identifier="Subject">
<demo.pocFindResult.Subject>
<bCode> ABC</bCode>
<bGCode>XY</bGCode>
<pCode>L0001</pcode>
<subjectType>CA</subjectType>
</demo.pocFindResult.Subject>
</insert>
<insert out-identifier="Result" return-object="true" entry-point="DEFAULT">
<demo.pocFindResult.result/>
</insert>
<fire-all-rules/>
</batch-execution>
I am using JBPM 7.0.0-SNAPSHOT and got the same result as yours. When I used the same rules in 6.2.0.Final, I had result back.
EDIT:
The key problem is the header:
Authorization:Basic YWRtaW46YWRtaW4=
Content-Type:application/xml ,
Then I added another header:
"X-KIE-ContentType : XSTREAM"
<batch-execution lookup="defaultKieSession">
<insert return-object="true">
<com.bp.PageContext>
<ID>AID</ID>
</com.bp.PageContext>
</insert>
<insert out-identifier="Group" return-object="true">
<com.bp.GroupData>
</com.bp.GroupData>
</insert>
<insert out-identifier="ERR" return-object="true">
<com.bp.ErrorMessage/>
</insert>
<fire-all-rules/>
<get-objects/>
</batch-execution>
I've got the result back:
<org.kie.server.api.model.ServiceResponse>
<type>SUCCESS</type>
<msg>Container bpcontainr successfully called.</msg>
<result class="execution-results">
<result identifier="Group">
<com.bp,GroupData>
<Code>TEST,QA</Code>
</com.bp.GroupData>
</result>
<result identifier="ERR">
<com.bp.ErrorMessage/>
</result>
<fact-handle identifier="Group" external-form="0:8:567620710:567620710:8:DEFAULT:NON_TRAIT:com.bp.GroupData"/>
<fact-handle identifier="ERR" external-form="0:9:1581854082:1581854082:9:DEFAULT:NON_TRAIT:com.bp.ErrorMessage"/>
</result>
</org.kie.server.api.model.ServiceResponse>

Inserting new tag in XML in xmlDB

Is it possible to insert new tag in the XML which is there in the XML-database?
For example; below is my example which is exists in the database:
<PurchaseOrder
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://localhost:8080/source/schemas/poSource/xsd/purchaseOrder.xsd">
<Reference>SBELL-2002100912333601PDT</Reference>
<Actions>
<Action>
<User>SVOLLMAN</User>
</Action>
</Actions>
<Reject/>
<Requestor>Sarah J. Bell</Requestor>
<User>SBELL</User>
<CostCenter>S30</CostCenter>
<SpecialInstructions>Air Mail</SpecialInstructions>
<LineItems>
<LineItem ItemNumber="1">
<Description>A Night to Remember</Description>
<Part Id="715515009058" UnitPrice="39.95" Quantity="2"/>
</LineItem>
</LineItems>
</PurchaseOrder>
I need to insert new tag <sender>xxxx</sender> where <costCente> is 'S30'.
After inserting/updating the XML, it should be like below:
<PurchaseOrder
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://localhost:8080/source/schemas/poSource/xsd/purchaseOrder.xsd">
<Reference>SBELL-2002100912333601PDT</Reference>
<sender>xxx</sender>
<Actions>
<Action>
<User>SVOLLMAN</User>
</Action>
</Actions>
<Reject/>
<Requestor>Sarah J. Bell</Requestor>
<User>SBELL</User>
<CostCenter>S30</CostCenter>
<SpecialInstructions>Air Mail</SpecialInstructions>
<LineItems>
<LineItem ItemNumber="1">
<Description>A Night to Remember</Description>
<Part Id="715515009058" UnitPrice="39.95" Quantity="2"/>
</LineItem>
</LineItems>
</PurchaseOrder>
Is it really a possible scenario?
Can any one give me query to do this, if it is possible.
Thanks in advance.
Below query worked for me.
UPDATE TABLENAME dd SET dd.object_value =
insertXMLbefore(dd.object_value,
'/c:PurchaseOrder/c:Reference',
XMLType('<d:sender xmlns:d="http://www.w3.org/2001/XMLSchema-instance">XXXX</d:sender>'),
xmlns:c="http://www.w3.org/2001/XMLSchema-instance"')
WHERE dd.id in (SELECT dd.id FROM TABLENAME dd,XMLTable(XMLNAMESPACES(
DEFAULT 'http://www.w3.org/2001/XMLSchema-instance' AS "c"),
'/PurchaseOrder' PASSING dd.object_value COLUMNS sender VARCHAR2(8 CHAR) PATH 'c:PurchaseOrder/c:Reference/text()',
rp VARCHAR2(8 CHAR) PATH 'CostCenter/text()') li
WHERE sender is null and rp = 'S30');

XQuery Transformation Mapping Error: {err}FORG0005: expected exactly one item, got 0 items

I'm having trouble doing XQuery mapping. The error reads as follows:
Error at analyzing XML: {err}FORG0005: expected exactly one item, got 0 items.
This is the response document I recieve:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:cgi="http://tempuri.org/Servicios/CGI"/>
<soap:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GetConsumosResponse xmlns="http://tempuri.org/Servicios/CGI">
<GetConsumosResult>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Consumos diffgr:id="Consumos1" msdata:rowOrder="0">
...
</Consumos>
...
</NewDataSet>
</diffgr:diffgram>
</GetConsumosResult>
</GetConsumosResponse>
</soap:Body>
</soapenv:Envelope>
In my OSB console I have the following binding...
Replace [ entire node ] of [ . ]
in [ getConsumosResponse ] with [ XQuery Resource... ]
XQuery resource: OSBSettlementProxy/XQuery/NGCombustibleXQResponse
Variable names and bindings:
newDataSet1: $getConsumosResponse/GetConsumosResponse/GetConsumosResult/diffgr:diffgram/NewDataSet
I already defined the diffgr in my namespaces, so I know that is not the problem...
It looks like GetConsumosResponse and GetConsumosResult are in the default namespace http://tempuri.org/Servicios/CGI. However, it looks like your path expression doesn't use this namespace. You might try adding a new namespace definition "cgi"="http://tempuri.org/Servicios/CGI" and then change your path to this:
$getConsumosResponse/cgi:GetConsumosResponse/cgi:GetConsumosResult/diffgr:diffgram/NewDataSet