var asearchFolder = userhome.childByNamePath("asearch");
if (asearchFolder === null) {
logger.log("asearch.searchprefs-ajax.post.json.js: Le répertoire asearch n'existe pas - creation");
asearchFolder = userhome.createFolder("asearch");
asearchFolder.addAspect("rtbfadvancedsearch:SearchPreferences");
logger.log("asearch.searchprefs-ajax.post.json.js: Répertoire créé -nodeRef=" + asearchFolder.nodeRef);
}
var savePrefs = {
init : function() {
var prefsNode = userhome.childByNamePath("asearch");
logger.log("asearch.searchprefs-ajax.post.json.js: prefsNode.nodeRef = " + prefsNode.nodeRef);
logger.log("asearch.searchprefs-ajax.post.json.js: prefsNode.hasAspect = " + prefsNode.hasAspect("rtbfadvancedsearch:SearchPreferences"));
if (prefsNode == null)
{
model.success = false;
model.errormsg = "Erreur - impossible de sauvegarder les preferences: noeud introuvable";
logger.log("asearch.searchprefs-ajax.post.json.js: Erreur - impossible de sauvegarder les preferences: noeud introuvable");
return;
}
prefsNode.properties["rtbfadvancedsearch:includeTitle"] = (json.get("incTitle") === null) ? true : json.get("incTitle");
prefsNode.properties["rtbfadvancedsearch:includeDescription"] = (json.get("incDescr") === null) ? true : json.get("incDescr");
prefsNode.properties["rtbfadvancedsearch:includeTags"] = (json.get("incTags") === null) ? true : json.get("incTags");
prefsNode.properties["rtbfadvancedsearch:includeFtx"] = (json.get("incFtx") === null) ? true : json.get("incFtx");
prefsNode.save();
logger.log("asearch.searchprefs-ajax.post.json.js: preferences sauvegardées");
model.prefsNode = prefsNode;
model.success = true;
}
}
savePrefs.init();
<?xml version="1.0" encoding="UTF-8"?>
<!– Custom Model –>
<!– Note: This model is pre-configured to load at startup of the Repository. So, all custom –>
<!– types and aspects added here will automatically be registered –>
<model name="rtbfadvancedsearch:rtbfadvancedsearchModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>RTBF Advanced Search Model</description>
<author>RTBF</author>
<version>1.0</version>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<!– Introduction of new namespaces defined by this model –>
<!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
<namespaces>
<namespace uri="rtbfadvancedsearch.model" prefix="rtbfadvancedsearch"/>
</namespaces>
<aspects>
<aspect name="rtbfadvancedsearch:SearchPreferences">
<title>Customer Details</title>
<properties>
<property name="rtbfadvancedsearch:IncludeTitle">
<title>Inclure le titre</title>
<type>d:boolean</type>
<default>true</default>
</property>
<property name="rtbfadvancedsearch:IncludeDescription">
<title>Inclure la description</title>
<type>d:boolean</type>
<default>true</default>
</property>
<property name="rtbfadvancedsearch:IncludeTags">
<title>Inclure les tags</title>
<type>d:boolean</type>
<default>true</default>
</property>
<property name="rtbfadvancedsearch:IncludeFtx">
<title>Inclure le full-text</title>
<type>d:boolean</type>
<default>true</default>
</property>
</properties>
</aspect>
</aspects>
</model>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.