how to prevent adding wrong attribute and wrong value in web author
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
how to prevent adding wrong attribute and wrong value in web author
Post by shikhar_472 »
Hi Team,
Is there any way by which we can prevent adding the wrong attribute or wrong value to any element.
Thanks,
Shikhar.
Is there any way by which we can prevent adding the wrong attribute or wrong value to any element.
Thanks,
Shikhar.
Re: how to prevent adding wrong attribute and wrong value in web author
Hello,
You can use the AuthorDocumentFilter API, it includes a method called setAttribute that is invoked before setting the value of an attribute in the specified element and you can use it to reject the wrong attribute names or values.
Best Regards,
Mihaela
You can use the AuthorDocumentFilter API, it includes a method called setAttribute that is invoked before setting the value of an attribute in the specified element and you can use it to reject the wrong attribute names or values.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: how to prevent adding wrong attribute and wrong value in web author
Post by shikhar_472 »
is there any option.xml configuration in oxygen which will validate according through schema and prevent to add attribute
Re: how to prevent adding wrong attribute and wrong value in web author
Hi,
Can you please detail your use-case? You want the user not be able to insert an invalid attribute or just an attribute value?
For the moment there is no option like this but we can register an issue, depending on your request.
Best Regards,
Mihaela
Can you please detail your use-case? You want the user not be able to insert an invalid attribute or just an attribute value?
For the moment there is no option like this but we can register an issue, depending on your request.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: how to prevent adding wrong attribute and wrong value in web author
Post by shikhar_472 »
Thanks mihela,
It got worked for me is it possible when attribute is not getting added we can provide error message on UI of web author from right attribute pane saying attribute could not be added, because that UI is not in our control so is there any way to do that quickly
It got worked for me is it possible when attribute is not getting added we can provide error message on UI of web author from right attribute pane saying attribute could not be added, because that UI is not in our control so is there any way to do that quickly
Re: how to prevent adding wrong attribute and wrong value in web author
Hello,
There is no way for you to add a message in the Attributes panel from API.
You can use the AuthorDocumentFilter API that I mentioned in a previous message (setAttribute method) and check if the attribute is valid. If it is not you can reject the operation and present a message to the user.
Best Regards,
Mihaela
There is no way for you to add a message in the Attributes panel from API.
You can use the AuthorDocumentFilter API that I mentioned in a previous message (setAttribute method) and check if the attribute is valid. If it is not you can reject the operation and present a message to the user.
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: how to prevent adding wrong attribute and wrong value in web author
Post by shikhar_472 »
how to present the message to the user from backend is it possible without having the UI control
-
- Posts: 99
- Joined: Fri Jul 01, 2022 12:08 pm
Re: how to prevent adding wrong attribute and wrong value in web author
Post by shikhar_472 »
if (StringUtils.isNotBlank(value.getRawValue()) && validateAttributeAndValue(element, attributeName, value)) {
super.setAttribute(filterBypass, attributeName, value, element);
}else {
}
inside else block i want to throw error if attribute is not get added and that should be visible on UI
super.setAttribute(filterBypass, attributeName, value, element);
}else {
}
inside else block i want to throw error if attribute is not get added and that should be visible on UI
Re: how to prevent adding wrong attribute and wrong value in web author
Hello,
You can use the following API to present a warning to the user: ro.sync.exml.workspace.api.WorkspaceUtilities.showWarningMessage(String)
The code should be something like this:
Best Regards,
Mihaela
You can use the following API to present a warning to the user: ro.sync.exml.workspace.api.WorkspaceUtilities.showWarningMessage(String)
The code should be something like this:
Code: Select all
authorDocumentModel.getAuthorAccess().getWorkspaceAccess().showWarningMessage("Your message");
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service