mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-1144 & RM-1145 - changes to file to action - post review changes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@61188 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.alfresco.repo.web.scripts.substitutionsuggestions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -31,13 +32,14 @@ import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
/**
|
||||
* Implementation for Java backed webscript to get substitution suggestions
|
||||
* given a text fragment (e.g. date.month for 'mon').
|
||||
*
|
||||
*
|
||||
* @author Mark Hibbins
|
||||
* @since 2.2
|
||||
*/
|
||||
public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
|
||||
{
|
||||
private final static String FRAGMENT_PARAMETER = "fragment";
|
||||
private final static String PATH_PARAMETER = "path";
|
||||
|
||||
private final static String SUBSTITUTIONS_MODEL_KEY = "substitutions";
|
||||
|
||||
@@ -57,11 +59,25 @@ public class RmSubstitutionSuggestionsGet extends DeclarativeWebScript
|
||||
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
|
||||
{
|
||||
String fragment = req.getParameter(FRAGMENT_PARAMETER);
|
||||
List<String> substitutionSuggestions = this.parameterProcessorComponent.getSubstitutionSuggestions(fragment);
|
||||
String path = req.getParameter(PATH_PARAMETER);
|
||||
|
||||
List<String> substitutionSuggestions = new ArrayList<String>();
|
||||
|
||||
substitutionSuggestions.addAll(getSubPathSuggestions(path, fragment));
|
||||
substitutionSuggestions.addAll(this.parameterProcessorComponent.getSubstitutionSuggestions(fragment));
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>();
|
||||
model.put(SUBSTITUTIONS_MODEL_KEY, substitutionSuggestions);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
private List<String> getSubPathSuggestions(final String path, final String fragment) {
|
||||
List<String> pathSuggestions = new ArrayList<String>();
|
||||
if(path != null)
|
||||
{
|
||||
// TODO - populate path suggestions
|
||||
}
|
||||
return pathSuggestions;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user