Problem when trying to deploy Community Page on salesforce - visual-studio

I'm getting this error when I'm trying to deploy a community page to one sandbox. I pull the same thing from another sandbox.
These are my errors:
Here is my package.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>CommunityTemplateDefinition</name>
</types>
<types>
<members>Dealer_Community</members>
<name>CustomSite</name>
</types>
<types>
<members>Dealer Community</members>
<name>Network</name>
</types>
<types>
<members>Dealer_Community1</members>
<name>ExperienceBundle</name>
</types>
<version>55.0</version>
</Package>
And this is the folder that generates error with loginAppPageId:
{
"forgotPasswordRouteId" : null,
"isAvailableToGuests" : false,
"isFilteredComponentsView" : false,
"isProgressiveRenderingEnabled" : true,
"loginAppPageId" : null,
"mainAppPageId" : "2fe3359b-d766-429e-9d67-ec8afe81cc47",
"preferredDomain" : "none",
"selfRegistrationRouteId" : null,
"type" : "site"
}
Any ideea on this? Thanks!

Related

WSO2 Payload Factory not working as expected

I am having troubles configuring the Payload Factory to make it work as expected.
I am trying to process the response of a backend service, which is:
<Documents xmlns="http://ws.wso2.org/dataservice">
<Document>
<Data>
{ "_id" : { "$oid" : "5bbce6ec9e0aae7e5c3a150a"} , "Plan" : "XXXX"}
</Data>
</Document>
<Document>
<Data>
{ "_id" : { "$oid" : "5bbce7279e0aae7e5c3a150b"} , "Plan" : "YYYY"}
</Data>
</Document>
</Documents>
I need to extract the json in each Data tag and construct a JSON that looks something like:
{
Data:
{
_id: {...},
Plan: ...
}
}
Just for testing purposes, I was trying to use the Payload Factory Mediator to get all Data tags using XPath. This is the outSequence of my API (again, the response that comes from the backend is just like the one above):
<outSequence>
<payloadFactory media-type="xml">
<format>
<newTestData>$1</newTestData>
</format>
<args>
<arg evaluator="xml" expression="//Data" />
</args>
</payloadFactory>
<log level="full" />
</outSequence>
The problem is that the log shows that the newTestData tag is empty after the Payload Factory process the response message.
The XPath was tested in an XPath Online Tester and it is correct so: what am I doing wrong?

Issues with https and Service Fabric

While trying to implement https on our ServiceFabric backend, following this guide, I found my local cluster throwing following error:
There was an error during CodePackage activation.The service host
terminated with exit code:1
and sometimes the following would pop up:
fabric:/Dev.Project/Api is not ready, 1
partitions remaining. => Something is taking too long, the application
is still not ready.
In the Diagnostic Events I find this
{
"Timestamp": "2018-08-20T12:01:21.6423999+02:00",
"ProviderName": "Microsoft-ServiceFabric",
"Id": 23083,
"Message": "ApplicationHostTerminated: ApplicationId=fabric:/Dev.Project, ServiceName=fabric:/Dev.Project/Api, ServicePackageName=ApiPkg, ServicePackageActivationId=1d4426dc-3d5e-41ea-aa44-6e9794ff7c69, IsExclusive=True, CodePackageName=Code, EntryPointType=Exe, ExeName=Setup.bat, ProcessId=29024, HostId=77c22be7-b993-46c6-92dd-7c7ed0c8af1c, ExitCode=1, UnexpectedTermination=True, StartTime=12:01:21.568939 (151,099.982 MSec). ",
"ProcessId": 25768,
"Level": "Informational",
"Keywords": "0x4000000000000001",
"EventName": "Hosting",
"ActivityID": null,
"RelatedActivityID": null,
"Payload": {
"eventInstanceId": "6dbdc967-85ed-429a-ae6a-939aeeea1e3f",
"applicationName": "fabric:/Dev.Project",
"ServiceName": "fabric:/Dev.Project/Api",
"ServicePackageName": "ApiPkg",
"ServicePackageActivationId": "1d4426dc-3d5e-41ea-aa44-6e9794ff7c69",
"IsExclusive": true,
"CodePackageName": "Code",
"EntryPointType": 1,
"ExeName": "Setup.bat",
"ProcessId": 29024,
"HostId": "77c22be7-b993-46c6-92dd-7c7ed0c8af1c",
"ExitCode": 1,
"UnexpectedTermination": true,
"StartTime": "2018-08-20T12:01:21.5689395+02:00"
}
}
The Id being the Id of my Api-service. It probably has something to do with the Setup.bat that's not being executed correctly, or errors are thrown while running it, but I can't figure out what to do about it. As stated in the guide, I added the
<Principals>
<Users>
<User Name="SetupAdminUser">
<MemberOf>
<SystemGroup Name="Administrators" />
</MemberOf>
</User>
</Users>
</Principals>
part, and added the RunAsPolicy to the service as well
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="ApiPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides>
<ConfigOverride Name="Config">
...
</ConfigOverride>
</ConfigOverrides>
<EnvironmentOverrides CodePackageRef="Code">
...
</EnvironmentOverrides>
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="SetupAdminUser" EntryPointType="Setup" />
</Policies>
</ServiceManifestImport>
I searched all over, but I can't find what the problem is. Any input is welcome!
Thanks in advance!
This works for me.
I have added LocalSystem instead of Admin user.
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="SetupLocalSystem" EntryPointType="Setup" />
</Policies>
<Principals>
<Users>
<User Name="SetupLocalSystem" AccountType="LocalSystem" />
</Users>
Also take care of DNS name in SetCertAccess.ps1 file, it should be same as cluster name.
$subject="your cluster DNS name"

FetchXML Localization

I have a FetchXML Query that returns the correct entities for my portal.
How do I get the translated values stored in my CRM
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="testentity">
<attribute name="xyz_testclassification" />
<attribute name="xyz_schemaname" />
</entity>
</fetch>
Working with XML and assuming attribute "xyz_testclassification" is an option set type your FetchXML query could return a resultset like this:
<resultset morerecords="0">
<result>
<xyz_testclassification name="Option One" formattedvalue="10003">10003</xyz_testclassification><xyz_schemaname>One</xyz_schemaname>
</result>
<result />
<result>
<xyz_testclassification name="Option Two" formattedvalue="10004">10004</xyz_testclassification><xyz_schemaname>Two</xyz_schemaname>
</result>
<result>
<xyz_testclassification name="Option Three" formattedvalue="10001">10001</xyz_testclassification><xyz_schemaname>Three</xyz_schemaname>
</result>
</resultset>
Here XML attribute "name" contains the display name of the option value. Attribute "formattedvalue" is only useful for numeric attributes (int, decimal, double, money).
When you are using FetchXML in C#, method IOrganizationService.RetrieveMultiple will return Entity objects. The Entity class has a FormattedValues collection containing the display values.
All values are returned according to the language and formatting settings of the user on behalf of whom the system is queried.
I agree with Henk van Boeijen. I'd like to add that if you using the Web Api endpoint it is also possible by adding "Prefer: odata.include-annotations="OData.Community.Display.V1.FormattedValue" in the header of the request.
HTTP/1.1 200 OK
Content-Type: application/json; odata.metadata=minimal
OData-Version: 4.0
Preference-Applied: odata.include-annotations="OData.Community.Display.V1.FormattedValue"
{
"#odata.context": "[Organization URI]/api/data/v8.2/$metadata#accounts(name,donotpostalmail,accountratingcode,numberofemployees,revenue)",
"value": [
{
"#odata.etag": "W/"502170"",
"name": "Fourth Coffee (sample)",
"donotpostalmail#OData.Community.Display.V1.FormattedValue": "Allow",
"donotpostalmail": false,
"accountratingcode#OData.Community.Display.V1.FormattedValue": "Default Value",
"accountratingcode": 1,
"numberofemployees#OData.Community.Display.V1.FormattedValue": "9,500",
"numberofemployees": 9500,
"revenue#OData.Community.Display.V1.FormattedValue": "$100,000.00",
"revenue": 100000,
"accountid": "89390c24-9c72-e511-80d4-00155d2a68d1",
"transactioncurrencyid_value": "50b6dd7b-f16d-e511-80d0-00155db07cb1" } ]
}
For more details: https://msdn.microsoft.com/en-us/library/gg334767.aspx

Get component parameters return empty value on joomla 3.4.1

I have in my component in admin section my "config.xml", the config inputs are ok on the administration of Joomla.
I have for example a field with "my_custom_test" and I set a value, for example "test". I click on "save" button.
If I'm in a view and I want to get my value I'm writing that
$compo_params = JComponentHelper::getParams('com_xxxxx');
var_dump($compo_params).'<br />';
echo $compo_params->get('my_custom_test', 'EMPTY');
The result is that
object(Joomla\Registry\Registry)#19 (2) { ["data":protected]=> object(stdClass)#20 (1) { ["params"]=> object(stdClass)#57 (1) { ["my_custom_test"]=> string(4) "test" } } ["separator"]=> string(1) "." }
EMPTY
The result is "EMPTY" instead of "test".
Do you have any idea ?
Actually I have found the source of the problem, it is in the component config.xml file. If you have the parameters enclosed in a tag (which was the standard practice for Joomla in the past), then the parameters are stored inside an object called "params", eg
<?xml version="1.0" encoding="utf-8"?>
<config>
<fields name="params" label="Some label">
<fieldset name="basic" label="Basic Options" description="">
<field name="some_option" label="label" type="text" description="" />
</fieldset>
</fields>
</config>
To correct the problem, just leave out the tag:-
<?xml version="1.0" encoding="utf-8"?>
<config>
<fieldset name="basic" label="Basic Options" description="">
<field name="some_option" label="label" type="text" description="" />
</fieldset>
</config>
If you look at any of the core Joomla component config.xml files this is how they do it now.
Then the standard method of getting the component params works:-
$compo_params = JComponentHelper::getParams('com_xxxxx');
$my_custom_test = $compo_params->get('my_custom_test', '');
The solution is
echo $compo_params->get('params')->my_custom_test;

Ruby to_xml with repeating same nodes

I would like to generate something like:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Test>
<Car>
<engine>A</engine>
<wheels>4</wheels>
</Car>
<Car>
<engine>B</engine>
<wheels>2</wheels>
</Car>
</Test>
but doing:
{"Car"=>[{"engine"=>"A", "wheels"=>"4"}, {"engine"=>"B", "wheels"=>"2"}]}.to_xml(:root => "Test")
returns:
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Test>
<Car type=\"array\">
<Car>
<engine>A</engine>
<wheels>4</wheels>
</Car>
<Car>
<engine>B</engine>
<wheels>2</wheels>
</Car>
</Car>
</Test>
You see, I don't want the parent node "<Car type=\"array\">"
Any idea how to achieve this?
Thank you!
For this simple case you can use Array#to_xml like so
values = {"Car"=>[{"engine"=>"A", "wheels"=>"4"}, {"engine"=>"B","wheels"=>"2"}]}.values.pop
#=> [{"engine"=>"A", "wheels"=>"4"}, {"engine"=>"B", "wheels"=>"2"}]
values.to_xml(:root => "Test", skip_types: true, children: "Car")
#=>"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Test>\n <Car>\n <engine>A</engine>\n <wheels>4</wheels>\n </Car>\n <Car>\n <engine>B</engine>\n <wheels>2</wheels>\n </Car>\n</Test>\n"
So More Concisely
{"Car"=>[{"engine"=>"A", "wheels"=>"4"}, {"engine"=>"B", "wheels"=>"2"}]}.values.pop.to_xml(:root => "Test", skip_types: true, children: "Car")
Will Return
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Test>
<Car>
<engine>A</engine>
<wheels>4</wheels>
</Car>
<Car>
<engine>B</engine>
<wheels>2</wheels>
</Car>
</Test>
Array#to_xml allows you to pass in root and children options so you can name the root "Test" and the children "Car" as requested. If this was just an example and the case is more complex then there could be concerns with this in which case I would recommend looking at builder which allows you immense control over nodes and their naming conventions.
How about utilizing the :skip_types => true option?
{"Car"=>[{"engine"=>"A", "wheels"=>"4"}, {"engine"=>"B", "wheels"=>"2"}]}.to_xml(:root => "Test", :skip_types => true)

Resources