Refresh KeyDefinitionInfo values
Posted: Fri Sep 30, 2016 2:25 pm
Hello
We use Webapp 18.0.0.6
In our application we use different reuse elements like this:
In one moment value of this Keyword is changed and I need refresh it in editor.
I use KeyDefinitionManager and fill KeyDefinitionInfo for this editor with.
Then I need refresh editor to change values.
For this I use JS:
but it does not help. I must get request on Servlet to take content for this reuse elements but it does not happen.
How can I update "keyref" or "conkeyref" in editor ?
We use Webapp 18.0.0.6
In our application we use different reuse elements like this:
Code: Select all
<ph keyref="keyword_q"/>
I use KeyDefinitionManager and fill KeyDefinitionInfo for this editor with.
Code: Select all
public class WorkspacePluginExtension implements WorkspaceAccessPluginExtension {
private static WebappKeyDefinitionManager keyManager = new WebappKeyDefinitionManager();
@Override
public void applicationStarted(final StandalonePluginWorkspace workspace) {
final WebappPluginWorkspace webappWorcspace = (WebappPluginWorkspace) workspace;
webappWorcspace.setDITAKeyDefinitionManager(keyManager);
..........
Code: Select all
public class WebappKeyDefinitionManager extends KeyDefinitionManager {
....
private void fillKeys(final URL url, final List<KeyDefinitionElement> list) {
final String editorUID = Utils.getEditorUID(url.toString());
List<KeyDefinitionInfo> keyDefinitions = keysMap.get(editorUID);
if (keyDefinitions == null) {
keyDefinitions = new ArrayList<>();
keysMap.put(editorUID, keyDefinitions);
} else {
keyDefinitions.clear();
}
for (final KeyDefinitionElement element : list) {
final KeyDefinitionInfo info = new KeyDefinitionInfo();
final String query = url.getQuery();
final StringBuilder dwUrl = new StringBuilder();
...
final URL correct = CorrectURLUtil.correct(new URL(dwUrl.toString()));
info.setProperty(KeyDefinitionInfo.DEFINITION_LOCATION, correct);
info.setProperty(KeyDefinitionInfo.NAME, element.getName());
info.setProperty(KeyDefinitionInfo.HREF, element.getLocation());
....
keyDefinitions.add(info);
}
}
For this I use JS:
Code: Select all
editor.restoreContent();
but it does not help. I must get request on Servlet to take content for this reuse elements but it does not happen.
How can I update "keyref" or "conkeyref" in editor ?