As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hi all, I need help customizing the default SitePicker.js of the Aikau library to show only the choice only to sites with a specific "site preset".
The process is i select a site type from the standard "Create Site" dialog:
When select the "Custom Preset" i show my custom form dialog:
Now i click on the button "Parent Site" a classical "SitePicker" form control of Aikau, but i need to show only site with a specific "site preset".
I based my example on the "site-hierarchy addon" :
https://github.com/Acosix/alfresco-site-hierarchy/blob/master/share/src/main/site-webscripts/de/acosix/acosix-site-hierarchy/site-management-customisations-52/share/header/share-header.get.js#L188
And i need to make a customized version of the :
https://github.com/Alfresco/Aikau/blob/develop/aikau/src/main/resources/alfresco/forms/controls/SitePicker.js
For filter by "site preset".
Can anyone help with this or link me to some similar example ?
That's really not trivial. You would have to
Note: I am the original author of the site hierarchy addon
Hi afaust, It must be me who don't know aikau well yet, but I still can't get what I want.
Here main resource file structure:
Here the attachment of the files: https://drive.google.com/drive/folders/1WEm73VpeZBq98kcAbDc83LAEPN1vIJnX?usp=sharing
I'm lost on the 3rd point of the list:
"Create a customisation of alfresco/forms/controls/SitePicker which uses your customised, non-form SitePicker instead of the default"
i don't get how can i connect the code i made on the " alfresco/forms/controls/SitePresetPicker":
{ name: "alfresco/menus/AlfMenuBarItem", config: { label: "picker.allSites.label", publishTopic: "ALF_ADD_PICKER", publishPayload: { currentPickerDepth: 0, pickerLabel: "SitesPreset", picker: [ { name: "alfresco/lists/AlfSortablePaginatedList", config: { noDataMessage: "sitePicker.list.noSitesFound", dataFailureMessage: "sitePicker.list.errorLoadingSites", itemsProperty: "", loadDataPublishTopic: "ALF_GET_SITES_BY_SITE_PRESET", waitForPageWidgets: false, widgets: [sitesView] } } ] } } }
with method i made on "alfresco/services/SitePresetService"
getSitesBySitePreset: function alfresco_services_SitePresetService__getSites(payload) { // TODO: Clean this up. Choose on or other as the Aikau standard. var alfResponseTopic = payload.alfResponseTopic || payload.responseTopic; var config = { url: AlfConstants.PROXY_URI + "api/sites", // I'll do something here eventually method: "GET", alfTopic: alfResponseTopic }; this.serviceXhr(config); },
for clarification here the code of my share custom configuration.
<config evaluator="string-compare" condition="WebFramework" replace="false"> <web-framework> <dojo-pages> <packages> <package name="sitepresetservice" location="resources/service-site-hierarchy/aikau/alfresco/services/SitePresetService.js"/> <package name="sitepresetpicker" location="resources/service-site-hierarchy/aikau/alfresco/pickers/SitePresetPicker.js"/> <package name="sitepresetformcontrolpicker" location="resources/service-site-hierarchy/aikau/alfresco/forms/controls/SitePresetPicker.js"/> </packages> </dojo-pages> </web-framework> </config>
Sorry for the inconvenience, but it is something that I have to solve at all costs. I'm willing ot pay a small bounty for this.
In your site service you must have mapped the new "getSitesBySitePreset" function to a pubsub topic, similar to how all the default functions are mapped/registered. That topic is the connection - a widget publishes to that topic to trigger the request, and the site service actually publishes to a similar response topic (original topic with an added suffix) to send back the results (handled transparently by "serviceXhr" in your case)
.
Ty again, i have already do that on the service file:
https://drive.google.com/drive/u/1/folders/1MVl6w-et7C9GLxoNE90qrkAIVjH0lWrP
this.alfSubscribe("ALF_GET_SITES_BY_SITE_PRESET", lang.hitch(this, this.getSitesBySitePreset));
it's must be something else i'm not seeing or some dojo config i screwed up.
Like i said i'm willing to pay for a use case example on github, because I admit I'm completely lost.
If it helps you in your answers I am trying to add the following customizations to your "site-hierarchy" addon used as a starting point:
A site selector limited to sites of a specific type.
Show or hide elements of the site creation or display form depending on which value has been selected in the "type site" dropdown.
Ty for your help.