I have created a CMS site with 4 pages in EPIServer. Now I want to set the page with id '5' as the start page. in episerver.config section I am not finding the sitesettings section . I am developing the MVC application template provided by .NET. But not getting any option for setting pagesstarid. Where to set taht in episever.config file.
My configuration file is like this:
<episerver xmlns="http://EPiServer.Configuration.EPiServerSection">
<workflowSettings>
<workflowHost type="EPiServer.WorkflowFoundation.AspNetWorkflowManager,EPiServer.WorkflowFoundation" />
<definitions>
<!-- definition: Workflow definitions that should be predefined, that is if no definition with
specified type exists it will be created-->
<!--
<definition name="Sequential Approval" description="A sequential approval workflow for pages" type="EPiServer.WorkflowFoundation.Workflows.SequentialApproval,EPiServer.WorkflowFoundation"/>
<definition name="Parallel Approval" description="A paralell approval workflow for pages" type="EPiServer.WorkflowFoundation.Workflows.ParallelApproval,EPiServer.WorkflowFoundation"/>
<definition name="Request for feedback" description="Assigns request for feedback tasks to users/roles" type="EPiServer.WorkflowFoundation.Workflows.RequestForFeedback,EPiServer.WorkflowFoundation"/>
<definition name="Ready for translation" description="Assigns translation tasks to users/roles" type="EPiServer.WorkflowFoundation.Workflows.ReadyForTranslation,EPiServer.WorkflowFoundation"/>
-->
</definitions>
<externalServices>
<!-- externalService: Custom services that is to be registered with workflow runtime-->
<externalService type="EPiServer.WorkflowFoundation.Workflows.ApprovalService,EPiServer.WorkflowFoundation" />
<externalService type="EPiServer.WorkflowFoundation.Workflows.ReadyForTranslationService,EPiServer.WorkflowFoundation" />
<externalService type="EPiServer.WorkflowFoundation.Workflows.RequestForFeedbackService,EPiServer.WorkflowFoundation" />
</externalServices>
<references>
<!-- reference: References for xoml based workflows, used at compiling of xoml based workflows-->
<!-- reference path="C:\Inetpub\wwwroot\mysiste\bin\customdependency.dll" /-->
</references>
</workflowSettings>
<applicationSettings httpCacheability="Public" pageValidateTemplate="false" uiShowGlobalizationUserInterface="true" urlRebaseKind="ToRootRelative" uiUrl="~/EPiServer/CMS/" utilUrl="~/util/" />
</episerver>
In EPiServer 7, you can change the start page if you go to admin mode / config / Manage websites.
Hope this helps
Related
Plugin UI are developed in a separate MVC project and CMS 12 is in another projects. Following is a test solution that just to explain the issue we are having.
Solution structure
Please consider followings
The TestAddon project is a Simple MVC project with basic UI. We need to get this UI rendered in a CMS 12 Admin menu. We have created a menu provider as well.
Then build the TestAddon project and copied DLLs to CMS-> bin folder.
Created module/_protected folder and added TestAddon/TestAddon.zip
module.config was created as described in the documentation(https://world.optimizely.com/documentation/developer-guides/CMS/configuration/Configuring-moduleconfig/)
<module productName="TestAddon" loadFromBin="false" tags="EPiServerModulePackage" clientResourceRelativePath="1.0.0">
<assemblies>
<add assembly="TestAddon" />
<add assembly="TestAddon.Views" />
</assemblies>
<route url="{controller}/{action}" >
<defaults>
<!--<add key="moduleArea" value="TestAddon" />-->
<add key="controller" value="CustomAdminPage" />
<add key="action" value="Index" />
</defaults>
</route>
<clientResources>
<!-- <add name="myscript" path="ClientResources/index.js" resourceType="Script" ></add> -->
</clientResources>
<clientModule>
<moduleDependencies>
<add dependency="CMS" />
<add dependency="Shell"/>
<add dependency="EPiServer.Cms.UI.Admin" type="RunAfter"/>
<add dependency="EPiServer.Cms.UI.Settings" type="RunAfter"/>
</moduleDependencies>
<requiredResources>
</requiredResources>
</clientModule>
</module>
Set Auto discovery in startup file
services.Configure<ProtectedModuleOptions>(x => x.AutoDiscovery = EPiServer.Shell.Configuration.AutoDiscoveryLevel.Modules);
When we then start the project it is giving following error
Error Screenshot
Stacktrace
When we removed the auto discovery setting form startup class. It works to build the project
Does anyone have experienced this?
Please point me in a correct direction
You don't need to copy files to your sample project for local testing. You can add a project reference to your add-on project instead, then add this in your sample project's startup so the files are loaded correctly:
var moduleName = typeof(SomeClassInYourAddOn).Assembly.GetName().Name;
services.Configure<CompositeFileProviderOptions>(options =>
{
options.BasePathFileProviders.Add(new MappingPhysicalFileProvider(
$"/EPiServer/{moduleName}",
string.Empty,
Path.GetFullPath($"..\\..\\src\\{moduleName}")));
});
services.Configure<ProtectedModuleOptions>(options =>
{
options.Items.Add(new ModuleDetails { Name = moduleName });
});
Not sure if this is needed, but I don't think protected modules are auto discovered. So if you have a configuration method in your add-on that consumers of your add-on need to call, then you can add this in the method:
var moduleName = typeof(SomeClassInYourAddOn).Assembly.GetName().Name;
services.Configure<ProtectedModuleOptions>(options =>
{
if (!options.Items.Any(i => i.Name.Equals(moduleName, StringComparison.OrdinalIgnoreCase)))
{
options.Items.Add(new ModuleDetails() { Name = moduleName });
}
});
Then your add-on is added even if auto discovery is not enabled.
I have a WPF application and I've created an MSI to install it with the WixToolset 3.11 and Visual Studio Extension 2019. I'm trying to add either XmlFile or XmlConfig item to change values in the config file. I'm getting the following error:
Failed to open XML file C:\Program Files(x86)\CO Apps\Main App\OurApp.exe.config. system error: -2147024786
The file path is the full filepath because I gave it the full path trying to resolve the issue. Here's the important parts of the wxs file
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:wixutil="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="9E76F000-5525-4BDF-8262-AE46B035D9CE"
Name="Our App"
Language="1033"
Version="2.0.0.0"
Manufacturer="CO Apps"
UpgradeCode="7CFB1B51-F5D5-4AD4-A509-F5C9BC05F875">
<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Description="Our production application." />
<Directory Id="ProgramFilesFolder">
<Directory Id="VTAPPSDIR" Name="CO Apps">
<Directory Id="INSTALLFOLDER" Name="Our App">
<Component Id="MainExecutable" Guid="748368D7-7581-4809-A8FE-DFB1093D6A02">
<File Id="MainFile" Name="$(var.OurApp.TargetFileName)" DiskId="1" Source="$(var.OurApp.TargetDir)OurApp.exe" KeyPath="yes"></File>
<File Id="OurApp.exe.config" ReadOnly="no" Source="$(var.OurApp.TargetDir)OurApp.exe.config"></File>
... More File items for DLLs
<wixutil:XmlFile Id="SetAppMode" Action="setValue" File="C:\Program Files (x86)\CO Apps\Our App\OurApp.exe.confg" ElementPath="configuration/userSettings/OurApp.Properties.Settings/setting/AppMode/value" Value="Main" />
</Directory>
</Directory>
</Directory>
So I'm trying to set the "AppMode" value to "Main" when this installs. What I'm trying to set isn't the point it's that it can't seem to find or open the file. I've tried putting the XmlFile in its own component. I've tried several variations of File paths including [INSTALLDIR] and [INSTALLLOCATION] and the filename by itself. Without that line everything works great. With that line in, I get the error and it rolls back the install. I also tried XmlConfig instead of XmlFile:
<wixutil:XmlConfig Id="ClearConfigAppMode" Action="delete" File="[INSTALLLOCATION]OurApp.exe.config" ElementPath="userSettings/OurApp.Properties.Settings" Name="AppMode" />
<wixutil:XmlConfig Id="SetAppMode" Action="create" File="[INSTALLLOCATION]OurApp.exe.config" ElementPath="userSettings/OurApp.Properties.Settings" On="install" Node="element">
<wixutil:XmlConfig Id="SetConfigAppModeName" ElementId="SetAppMode" File="[INSTALLLOCATION]OurApp.exe.config" Name="name" Value="AppMode" />
<wixutil:XmlConfig Id="SetConfigAppModeSerializeAs" ElementId="SetAppMode" File="[INSTALLLOCATION]OurApp.exe.config" Name="serializeAs" Value="String" />
</wixutil:XmlConfig>
<wixutil:XmlConfig Id="SetAppModeValue" Action="create" File="[INSTALLLOCATION]OurApp.exe.config" ElementPath="userSettings/OurApp.Properties.Settings" On="install" Node="element" Sequence="2">
<wixutil:XmlConfig Id="SetAppModeVAlueMain" ElementId="SetAppModeValue" File="[INSTALLLOCATION]OurApp.exe.config" Name="Value" Value="Main" />
</wixutil:XmlConfig>
Since XmlConfig doesn't have setValue on an existing element I used the delete action to remove the item for use in development and insert a new one. Same error. It happens logged on as myself or as Administrator. Does anyone have a working example of WiX with WPF creating a MSI? I'm not looking for something as complex as WixBA. I just need to modify the app.exe.config file on install.
Thanks,
Mike
Example: Though I rarely use this feature, I have this working example here (my test project for XML): https://github.com/glytzhkof/WiXUpdateXmlFile. Snippets of the sample here and here.
Disclaimer: I am not sure if follows best practice for XML updates, since I prefer to do XML updates from application launch code instead - if possible (single source, easier debugability and in general more familiar territory for most developers).
app.config/web.config appsettings: Maybe check out this answer regarding appsettings or this answer (looks better) - just for your review, not necessarily a suggestion. Keeping deployed files read-only helps a lot to overwrite them reliably during updates and the file you generate can be kept untouched by the installer (the file is de-coupled from installer - it never touches them). Or as I wrote: HKCU can also be used to write "the few settings you actually have to change". Not so nice conceptually?
Clouded Settings: Personally I think settings should never be file-based but clouded in our day and age (kept in a remote database). See section 6 and 7 here. How realistic this is for your application I don't know. New challenges and problems - no doubt (network issues, firewalls, launch problems, etc...), but benefits: versioned settings, recovery and management (enforce new settings). Not sure about all the practicalities - never been involved that much, but would love to get rid of settings files - especially for corporate apps. However, sometimes nice concepts don't meet reality well - maybe it is too involved?
Hi earlier we were using below authorizationEntry to access(read/write) queues starting with "queue.".
Corresponding entry from activemq.xml
<authorizationEntry queue="queue.>"
read="test" write="test" admin="test" />
As per the latest requirement from client(External system), is there a possibility to access queues starting with "queue.".without credentials(username/password)
please let us know what changes we have to make in activemq.xml or configuration to achieve the same i.e., access queues without credentials
These queues are used in routes created using apache-camel ,spring DSL language
as said in doc :
To allow anonymous access to the broker, use anonymousAccessAllowed
attribute and set it to true as shown above. Now, when the client
connects without username and password provided, a default username
(anonymous) and group (anonymous) will be assigned to its security
context. You can use this username and password to authorize client's
access to appropriate broker resources (see the next section). You can
also change username and group that will be assigned to anonymous
users by using anonymousUser and anonymousGroup attributes.
src http://activemq.apache.org/security.html#Security-Anonymousaccess
so i think this can do the stuff
<simpleAuthenticationPlugin anonymousAccessAllowed="true">
<users>
<authenticationUser username="system" password="manager" groups="users,admins" />
<authenticationUser username="user" password="password" groups="users" />
<authenticationUser username="guest" password="password" groups="guests" />
<authenticationUser username="test" password="test" groups="test" />
</users>
</simpleAuthenticationPlugin>
<authorizationEntry queue="queue.>" read="test,anonymous" write="test,anonymous" admin="test,anonymous" />
if you use Advisory you have to add authorized groups to create Advisory topics :
<authorizationEntry topic="ActiveMQ.Advisory.>" read="anonymous" write="anonymous" admin="anonymous"/>
We are trying to do a single setup with Shibboleth Identity Provider 3 and 1 service.
We have configured the Shibboleth IDP3 to use the OpenLDAP service that we are running. This is working as authentication is succesful. (see green underlined part image). This is with a user we created in the LDAP who is named 'test'.
Now the problem is that the entire transaction fails because we seem to lack a nameid in our SAML response.
We have made multiple attempts to fix this, here are some of the changes we tried.
In attribute-resolver-ldap.xml we added:
<resolver:AttributeDefinition id="mail" xsi:type="ad:Simple" sourceAttributeID="mail">
<resolver:Dependency ref="myLDAP" />
<resolver:AttributeEncoder xsi:type="enc:SAML1String" name="urn:mace:dir:attribute-def:mail" encodeType="false" />
<resolver:AttributeEncoder xsi:type="enc:SAML2String" name="urn:oid:0.9.2342.19200300.100.1.3" friendlyName="mail" encodeType="false" />
</resolver:AttributeDefinition>
In attribute-resolver.xml we added an attributedefinition and a dataconnector as follows:
<!--
Attribute definition that expects to get the 'email' attribute from the ldap connector
defined as its dependency and encode it as a SAML 2 name identifier.
-->
<resolver:AttributeDefinition xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="googleNameID"
sourceAttributeID="cn">
<!--
The data connector expected to provide the source attribute, email. Note how the
value of the 'ref' attribute is the identifier given to the LDAP data connector.
-->
<resolver:Dependency ref="ldap" />
<!-- Encoder that transforms the attribute into a SAML2 NameID -->
<resolver:AttributeEncoder xsi:type="SAML2StringNameID" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
nameFormat="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" />
</resolver:AttributeDefinition>
dataconnector (the <..> values are filled in correctly):
<!-- An LDAP connector that pulls in, at least, an attribute called email. -->
<resolver:DataConnector xsi:type="LDAPDirectory" xmlns="urn:mace:shibboleth:2.0:resolver:dc"
id="ldap"
ldapURL="ldap://localhost:389"
baseDN="dc=<FIRSTDC>,dc=<SECONDDC>"
principal="cn=admin,dc=<FIRSTDC>,dc=<SECONDDC>"
principalCredential="<PASS>">
<FilterTemplate>
<![CDATA[
(cn=test)
]]>
</FilterTemplate>
</resolver:DataConnector>
In the saml-nameid.xml file we added a nameIDgenerator (we did this for both SAML1 and 2):
<bean parent="shibboleth.SAML2AttributeSourcedGenerator"
p:format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
p:attributeSourceIds="#{ {'mail'} }" />
In our ldap.properties file we assume we have configured everything correctly as the authentication itself works fine.
The error at the service side is that it can't process the SAML message:
Caused by: org.opensaml.common.SAMLException: NameID element must be present as part of the Subject in the Response message, please enable it in the IDP configuration
There could be many reason for this. There are some issues I could see in the configuration you have provided:
In attribute-resolver.xml, you have defined AttributeDefinition ID as id="googleNameID" while AttributeSourceIDs in saml-nameid.xml is set as p:attributeSourceIds="#{ {'mail'} }". These IDs should be exactly same. Change your AttributeDefinition in attribute-resolver.xml to:
<resolver:AttributeDefinition xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
id="mail" sourceAttributeID="cn">
<resolver:Dependency ref="ldap" />
<resolver:AttributeEncoder xsi:type="enc:SAML2String" name="mail" friendlyName="mail"/>
</resolver:AttributeDefinition>
In conf/saml-nameid.properties, uncomment and set default NameID as EmailAddress like this:
idp.nameid.saml2.default = urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
You have not defined any Attribute Filter Policy. Add the following to the conf/attribute-filter.xml:
<afp:AttributeFilterPolicy id="ldapAttributes">
<afp:PolicyRequirementRule xsi:type="basic:ANY" />
<afp:AttributeRule attributeID="mail">
<afp:PermitValueRule xsi:type="basic:ANY"/>
</afp:AttributeRule>
</afp:AttributeFilterPolicy>
I've created an application using Ext JS 4. controllers property in my app.js contains only the main controller:
Ext.application({
name: 'MyApp',
appFolder: 'app',
controllers: [
"main.App"
],
loadController: function(controller) {
var oController = this.getController(controller);
oController.init(this);
oController.onLaunch(this);
}
});
MyApp.main.App controller loads additional controllers by name using getController() approach (see loadController() method). These controllers are loaded dynamically and are not listed in my index.html file.
In order to generate production version for deployment to server I am using Sencha Cmd by issuing the following command in my application folder:
sencha app build
Tool finishes normally and compresses all files into one big all-classes.js. The problem is that my dynamically loaded controllers are not included in that file.
Which is the correct way to make dynamically loaded controllers (over 100 in total) to be minified and processed by Sencha Cmd?
I know, that I can list them in my app.js, or include in some file using Ext.require, but I am seeking for correct approach for including over than 100 different controllers, views, models and stores automatically in my build. I believe that are other users of Ext JS, which are creating large-scale applications and are building somehow and I'll be grateful for any suggestions or just success stories, which will help me to find the correct way to build.
I would put all controllers into the uses array. These should force the tool to keep track on them and include them into the build. On the other hand uses does not require the class to be available at definition time but guarantee them to be available the time the onReady(one is within the application) block(s) is(are) called.
Note that you will need to use the fully qualified names within the
uses array!
I do not use the buildtool therefore I cannot test it but it should work.
Update from the comments example provided by #bhovhannes
bhovhannes: I've added a code in build.xml, which collects all names of
my controllers into uses array when I do sencha app build. This way I
fill nothing in uses array during development, just add controllers
into controller folder, because all them are loaded dynamically from
my app
app.js
Ext.application({
name: 'MyApp',
appFolder: 'app',
controllers: [
"main.App"
],
uses: [
/*ant-generated-content-start*/ /*ant-generated-content-end*/
],
autoCreateViewport: true,
});
build.xml
<?xml version="1.0" encoding="utf-8"?>
<project name="MyApp" default=".help">
<import file="${basedir}/.sencha/app/build-impl.xml"/>
<target name="-before-build">
<echo message="Collecting all controllers in application class property ... "/>
<fileset id="app_controllers" dir="${app.dir}/app/controller" casesensitive="yes">
<include name="**/*.js"/>
</fileset>
<pathconvert pathsep="," property="app_controller_names" refid="app_controllers" targetos="unix">
<chainedmapper>
<globmapper from="${app.dir}/app/*" to="${ant.project.name}/*" casesensitive="no" handledirsep="yes"/>
<chainedmapper>
<regexpmapper from="^(.*)\.js$$" to='"\1"'/>
<filtermapper>
<replacestring from="/" to="."/>
<replacestring from="\" to="."/>
</filtermapper>
</chainedmapper>
</chainedmapper>
</pathconvert>
<echo message="Collected controllers: ${app_controller_names}"/>
<echo message="Injecting into app.js ..."/>
<replaceregexp file="${app.dir}/app/app.js"
match="/\*ant-generated-content-start\*/(.*)/\*ant-generated-content-end\*/"
replace="/*ant-generated-content-start*/ ${app_controller_names} /*ant-generated-content-end*/"
byline="true"
/>
</target>
<target name="-after-build">
<echo message="Reverting to original app.js ..."/>
<replaceregexp file="${app.dir}/app/app.js"
match="/\*ant-generated-content-start\*/(.*)/\*ant-generated-content-end\*/"
replace="/*ant-generated-content-start*/ /*ant-generated-content-end*/"
byline="true"
/>
</target>
</project>