Page 1 of 1
get line number using offset position thorough API
Posted: Fri Feb 05, 2010 11:51 pm
by guna@ebscohost.com
Hi,
Is there a way to get the line number of caret offset in oxygen author mode.
Re: get line number using offset position thorough API
Posted: Mon Feb 08, 2010 10:50 am
by Radu
Hi Guna,
The text is presented in the Author page with all text normalized and with many of the line breaks removed. Only on serialization (on Save) the text is formatted and line breaks are added to it.
So while working in the Author mode there is no way to map the current offset to the original line in the XML document.
What exactly are you trying to accomplish? Maybe we can give you a workaround.
Regards,
Radu
Re: get line number using offset position thorough API
Posted: Mon Feb 08, 2010 5:06 pm
by guna@ebscohost.com
hi,
we have external links(like links to yahoo,google,etc..) inside the xml document, we have provided an icon to validate all the links inside the xml document(the validate opration, would go an check where the url is active and correct).
while doing so, if there is an error url. we want to direct the user to fix the issue by showing them the line number, saying that link is borken.
Re: get line number using offset position thorough API
Posted: Mon Feb 08, 2010 5:17 pm
by Radu
Hi,
Maybe you can present in a not modal dialog's list all the problems to the users.
For each problem you will keep the AuthorNode for which the problem had occurred.
Then the user can click the problem in the list and you will select the node in the Author page like:
Code: Select all
authorAccess.getEditorAccess().select(problemNode.getStartOffset(), problemNode.getEndOffset());
In this way the user has instant feedback for each problem.
Regards,
Radu