I am trying to create a folder at a location different from the application installation location which happens to be C:\Program Files(x86). I am using the following fragment
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="PhotosDir" Name="Photos" />
</DirectoryRef>
<!--<SetDirectory Id="PhotosDir" Value="[TARGETDIR]Photos" Sequence="execute"></SetDirectory>-->
</Fragment>
I tried with a SetDirectory element as shown above and also with a CustomAction as shown below. (If I use both, I get an error saying Id is duplicated. Hence I commented it.)
<CustomAction Id="SetPhotosDir" Directory="PhotosDir" Value="[TARGETDIR]Photos"></CustomAction>
<InstallExecuteSequence>
<Custom Action="SetPhotosDir" Before="CreateFolders"/>
</InstallExecuteSequence>
I have a component also defined for this directory element as below.
<Component Id="cmpPhotosDir" Guid="{8F757344-CA0A-42BC-B292-A51CE86B19E2}" KeyPath="yes" Directory="PhotosDir"><CreateFolder/></Component>
But the directory called Photos is always getting created in D drive, even though it is nested inside of TARGETDIR. I actually want to control the location where this directory gets created, probably through UI. I googled for SetDirectory element example, but couldn't find a proper working sample. All I get to see is that I have to use a custom action type 35 or 51. But it is not clear what code should go inside of these custom actions. Also, I am not sure, if these custom actions are required in addition to the SetDirectory element or not. Can anyone please help me achieve this, with some working sample?
The problem is your directory identifier is not PUBLIC. Change its name to include no lower-case letters; use only upper-case letters, numbers, and underscores. (This came up in reverse pretty recently over here.)
I would also probably schedule the action to After="CostFinalize" , or just set the property of the same name Before="CostInitialize. Neither of those are likely to be relevant to your symptoms, however.
Related
I'm trying to change the base path in a Blazor server application. Instead of having it at
http://localhost:5000/ I want to have it at http://localhost:5000/CoolApp/
I followed this instructions, but the application crashes with:
InvalidOperationException: Cannot find the fallback endpoint specified by route values: { page: /CoolApp/{**path:nonfile}, area: }.
Here's the sample
I had this exact problem. I explored it for about an hour or so as well. The problem was that in my component I had a
href="#($"/myPageComponent/{id}")"
...When I removed the / and made it
href="#($"myPageComponent/{id}")"
then it worked. Basically, check your child's component and make sure that you have no slash in the beginning. As the slash is saying "Go to the root". Also, in my specific case, I had to include a separate web.config file that prevented the app from inheriting parent configuration features. Like So
`<configuration>
<location path="." inheritInChildApplications="false">
<configuration/>`
You should removing the app.PathBase():
app.Map("/CoolApp", coolApp =>
{
coolApp.MapBlazorHub();
coolApp.MapFallbackToPage("/_Host");
});
This will mean nothing will run unless it is on the /CoolApp endpoint - and you don't need to worry about appending the /CoolApp route to anything.
In future if you don't want the /CoolApp base path - move the inside of the Map() function out and remove it, replacing coolApp with app.
Let me know if this works for you!
I've found a bug in pickerresults.lib.ftl that i have already reported
Briefly: if the user does not have the permission on a file parent, the line
<#if row.item.parent??>"parentName": "${row.item.parent.name!""}",
will fail, failing the entire script (and the user can't see any file)
So, waiting for the bug being resolved i need to patch this. I'd like to override the macro "pickerResultsJSON" defined in the file removong the line or putting a string value in place of "${row.item.parent.name!""}" that cause the exception
I have no idea of how to redefine the macro and where to place the file inside my amp. Can someone help me?
UPDATE
I'm using the Alfresck SDK 2.0 and my project structure is:
I've tryed to put a file "custom-pickerresults.lib.ftl" with the following content (as suggested by sev) but it does not seem to be the right position. Or should i "register" it in some way?
<#macro pickerResultsJSON results>
<#-- new code here -->
</#macro>
<#global pickerResultsJSON = pickerResultsJSON />
Since macros are just variables, you might be able to do something like this:
<#macro pickerResultsJSON>
<#-- new code here -->
</#macro>
<#global pickerResultsJSON = pickerResultsJSON />
As to where you would put that... you could put it in any file that is included globally on your project. It might require a little trial and error since I'm not sure what your project structure is.
Many thanks to sev, he pointed me the right way.
I realized that pickerresults.lib.ftl is used by the webservice pickerchildren.get.desc.xml and pickerchildren.post.desc.xmlso, the solution is to copy the web service definition and files along with the library in
/alfresco-myamp-repo/src/main/amp/config/alfresco/extension/templates/webscripts/com/my/repository/forms/
(repository/forms/ just becouse the original files are inside config/alfresco/templates/webscripts/org/alfresco/repository/forms/ but any other folder under /alfresco-myamp-repo/src/main/amp/config/alfresco/extension shuld do)
and change the library like this:
...
"type": "${row.item.typeShort}",
"parentType": "${row.item.parentTypeShort!""}",
<#-- from here -->
<#attempt>
<#if row.item.parent??>"parentName": "${row.item.parent.name!""}",</#if>
<#recover>
"parentName": "<unknown>",
</#attempt>
<#-- to here -->
"isContainer": ${row.item.isContainer?string},
<#if row.container??>"container": "${row.container!""}",</#if>
...
This way even if the user has not the permissions to read the parent's name the template can complete without errors (i don't know if the value "unknown" in place of the parent name can cause any troubles, but i did not notice nothing right now)
In Alfresco, if a type name is removed/changed all nodes of that type will disappears but still exists.
Using alfresco 5.0.c I've added some custom types:
eg:
<type name="my:test">
<title>Test folder</title>
<parent>cm:folder</parent>
</type>
now i deploy it and create a folder of this type (a simple folder, then change type)
Now i edit the type like this:
<type name="my:test2"> <!-- from my:test to my:test2 -->
<title>Test folder</title>
<parent>cm:folder</parent>
</type>
Deploying this: any "my:test" folder will disappear, but, if I try to create another folder with the same name I get an error becouse the node still exists.
These nodes will not be not even listed within the folder child:
print(document.getChildren());
How can I recover (if possible using the the javascript console) all the "broken" nodes and be able to change the type?
A little preface: as widely stated by Alfresco, if you want to change your custom content model you should change it only incrementally.
This means that you can't remove any properties, types or aspect at definition level of the model, you only can add new definitions in the content model of Alfresco.
So it is a very bad practice to change types "on the fly".
A good practice is to always start with a model as small as you can and then add features as long as you need them.
In your case you should have deleted all nodes referencing my:test type BEFORE changing the model and then safely remove it and finally you should have performed a full reindex. This could be the reason why the repository tells you that the folder exists even if you cannot see it anymore.
As far as I know it is not possible to delete this inconsistent nodes through the console, so my advice is to perform a full reindex. If the issues come up again then you should consider to start again from scratch.
Another approach next time is to add the new type and programmatically hide the older one.
I am trying to configure cd_storage and getting issue in setting up dynamic component presentation as they get over written by child and published to same folder from every publication.
I know we can define the publication level settings but once we define that then it expect us to define everything inside that publication tag. We do not want to define every thing 50 times in publication tag.
Could any one suggest the best practice for same.
this is for sdl tridion 2011 sp1
Thanks in advance...
Your problem is in how you defined your storage configuration for the storage which you use to store ComponentPresentations. There is a flag in the definition of a storage which sets exactly this type of behavior: defaultFilesystem. You probably have it set to false which causes all ComponentPresentations from all publications to be stored in the same location. By setting this flag to true you will get ComponentPresentations from different publications stored in different locations. I will give an example to show how this works in cd_storage_conf.xml:
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultCPs" defaultFilesystem="true">
<Root Path="c:\temp\cpRoot" />
</Storage>
....
<ItemTypes defaultStorageId="defaultFile" cached="true">
<Item typeMapping="ComponentPresentation" itemExtension=".jsp" storageId="defaultCPs"/>
....
This is really easy to maintain and will make the Broker to store ComponentPresentations to locations like: c:\temp\cpRoot\pub109\dcp\jsp\*** (here I have publicationId=109).
Hope this helps.
I have created a configuration section designer project to represent nodes of a custom section necessary to read and save from my web application. I am able to successfully create instances of the configuration elements and collections, however when I save the configuration using the referenced System.Configuration.Configuration object and issuing save, the elements get merged into their parents as attributes. An example of the issue is outlined below:
After calling the referenced Configuration.save, the output is as follows:
<savedReports xmlns="SavedReportSchema.xsd">
<resultsSets dataViewId="1" id="4203bb88-b0c4-4d57-8708-18e48f0a1d2d">
<selects keyId="1" sortOrder="1" />
</resultsSets>
</savedReports>
As defined in my configuration section designer project (confirmed by the resulting xsd as well) the output should match the following:
<savedReports xmlns="SavedReportSchema.xsd">
<resultsSets>
<savedReport id="1">
<selects>
<select keyId="1" sortOrder="1"/>
</selects>
</savedReport>
</resultsSets>
</savedReports>
Any ideas? The element collection types are set to BasicMapAlternate however when I set them to AddRemoveClearMapAlternate they are not merged but they are prefixed by "add" rather than "select" or "savedReport" causing the validation to be off.
Turns out AddRemoveClearMapAlternate was the option I needed to correct my problem referenced in the question.