What is the correct xlink namesapce to use in Docbook 5? - docbook-5

If I have the following Docbook 5 XML:
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0">
<title>Test</title>
<section>
<title>LS command</title>
<para xml:id="ls">
This command is a synonym for <command linkend="dir">DIR</command> command.
</para>
<para xml:id="dir">
This command is a synonym for <command linkend="ls">LS</command> command.
</para>
<para>
<application xl:href="http://www.gnu.org/software/emacs/">Emacs</application>
</para>
</section>
</article>
and I attempt to validate it against the Docbook 5 DTD downloaded from here with:
xmllint --noout --dtdvalid docbook.dtd test.xml
I get the following error:
test.xml:1: element article: validity error : No declaration for attribute xmlns:xl of element article
test.xml:11: element application: validity error : No declaration for attribute href of element application
However, if I change the xl namespace to xlink, like so:
<article xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<title>Test</title>
<section>
<title>LS command</title>
<para xml:id="ls">
This command is a synonym for <command linkend="dir">DIR</command> command.
</para>
<para xml:id="dir">
This command is a synonym for <command linkend="ls">LS</command> command.
</para>
<para>
<application xlink:href="http://www.gnu.org/software/emacs/">Emacs</application>
</para>
</section>
</article>
Everything validates just fine. I got the xl namespace from the Docbook documentation here (and the example of using an article with an application that had a xref is straight from that documentation).
So why does xl fail when xlink succeeds?

The issue was actually that the DocBook 5.0 DTD specifically listed the xlink:href attribute, and any others were not valid.

Related

Moqui form shows up disabled

I am following the Moqui getting started tutorial. I have created a create form as below.
<?xml version="1.0" encoding="UTF-8"?>
<screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://staging.azpire.co.in/xsd/xml-screen-2.1.xsd"
require-authentication="anonymous-all">
<transition name="findTutorial"><default-response url="."/></transition>
<transition name="createTutorial">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
<actions>
<entity-find entity-name="tutorial.Tutorial" list="tutorialList">
<search-form-inputs/>
</entity-find>
</actions>
<widgets>
<container-dialog button-text="Create Tutorial" id="CreateTutorialDialog">
<form-single name="CreateTutorial" transition="createTutorial">
<auto-fields-entity entity-name="tutorial.Tutorial" field-type="edit"/>
<field name="submitButton">
<default-field title="Create"><submit/></default-field>
</field>
</form-single>
</container-dialog>
<form-list name="ListTutorials" list="tutorialList" transition="findTutorial">
<auto-fields-entity entity-name="tutorial.Tutorial" field-type="find-display"/>
</form-list>
</widgets>
</screen>
When I click "Create Tutorial", the form shows up. But, it is disabled(read only) including the submit button.
If you are following the Moqui getting started tutorial, you need import data about security screen as follow to fix this problem:
<moqui.security.ArtifactGroup artifactGroupId="TUTORIAL" description="Tutorial"/>
<moqui.security.ArtifactGroupMember artifactGroupId="TUTORIAL" artifactTypeEnumId="AT_XML_SCREEN"
inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- Full permissions for the ADMIN user group -->
<moqui.security.ArtifactAuthz artifactAuthzId="TUTORIAL_AUTHZ_ALL" userGroupId="ADMIN" artifactGroupId="TUTORIAL"
authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
If you are required temporary solution for one transition then you can use:
<transition name="createTutorial" read-only="true">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
If you are required a temporary solution but for more transition then you can use:
<always-actions>
<script>ec.artifactExecution.disableAuthz()</script>
</always-actions>
<transition name="createTutorial">
<service-call name="create#tutorial.Tutorial"></service-call>
<default-response url="."/>
</transition>
<transition name="createEmployee">
<service-call name="create#employee.Employee"></service-call>
<default-response url="."/>
</transition>
If you want permanent solution then create below seed data records:
If you want to authrize for availabe UserGroup(ADMIN) then you have to add following seed data:
<moqui.security.ArtifactGroup artifactGroupId="ADMIN_ARTIFACTS" description="Administrators"/>
<!-- for screen path -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactTypeEnumId="AT_XML_SCREEN" nameIsPattern="N" inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- for rest calls -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactName="/tutorial/fetch-records" artifactTypeEnumId="AT_REST_PATH" nameIsPattern="N" inheritAuthz="Y"/>
<!-- for service path -->
<moqui.security.ArtifactGroupMember artifactGroupId="ADMIN_ARTIFACTS" artifactName="TutorialServices.create#Records" artifactTypeEnumId="AT_SERVICE" nameIsPattern="N" inheritAuthz="Y"/>
<!-- Give authrization to UserGroup: -->
<moqui.security.ArtifactAuthz artifactAuthzId="ADMIN_AUTHZ" userGroupId="ADMIN" artifactGroupId="ADMIN_ARTIFACTS"
authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
If you want to create your own UserGroupType then you have to add following seed data:
<moqui.basic.Enumeration enumTypeId="UserGroupType" enumId="UgtMyAdmin" description="My Administrators"/>
// If you want to create your own UserGroup then you have to add following seed data:
<moqui.security.UserGroup groupTypeEnumId="UgtMyAdmin" userGroupId="MyAdmin" description="My Administrators"/>
// you can also create artifact group separately:
<moqui.security.ArtifactGroup artifactGroupId="MY_ADMIN_ARTIFACTS" description="My Administrators"/>
// Now you have to give screen permission to your own created UserGroup:
<!-- for screen path -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactTypeEnumId="AT_XML_SCREEN" nameIsPattern="N" inheritAuthz="Y" artifactName="component://tutorial/screen/tutorial.xml"/>
<!-- for rest calls -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactName="/tutorial/fetch-records" artifactTypeEnumId="AT_REST_PATH" nameIsPattern="N" inheritAuthz="Y"/>
<!-- for service path -->
<moqui.security.ArtifactGroupMember artifactGroupId="MY_ADMIN_ARTIFACTS" artifactName="TutorialServices.create#Records" artifactTypeEnumId="AT_SERVICE" nameIsPattern="N" inheritAuthz="Y"/>
<!-- Give authrization to UserGroup: -->
<moqui.security.ArtifactAuthz artifactAuthzId="MY_ADMIN_AUTH" userGroupId="MyAdmin" artifactGroupId="MY_ADMIN_ARTIFACTS" authzTypeEnumId="AUTHZT_ALWAYS" authzActionEnumId="AUTHZA_ALL"/>
You can also clone an example component from git:
I hope this will help!
If the transition exist and the user has permission to access it, then all fields disabled is a bug, please report it by create a issue.

Does xliff 1.2 supports custom annotations

I am working on a sample file in Xliff 1.2 but confused with annotation.As I didnot find anywhere whether it supports custom annotation or not?
Can anyone refer links for sample xliff1.2 file with annotations(if it supports any kind of annotations)
Thanks
you can read more about this in the following link:
http://docs.oasis-open.org/xliff/v1.2/cs02/xliff-core.html#note
This is an example:
<xliff version="1.2">
<file original="Graphic Example.psd"
source-language="en-US" target-language="ja-JP"
tool="Rainbow" datatype="photoshop">
<header>
<skl>
<external-file uid="3BB236513BB24732" href="Graphic Example.psd.skl"/>
</skl>
<phase-group>
<phase phase-name="extract" process-name="extraction"
tool="Rainbow" date="20010926T152258Z"
company-name="NeverLand Inc." job-id="123"
contact-name="Peter Pan" contact-email="ppan#example.com">
<note>Make sure to use the glossary I sent you yesterday.
Thanks.</note>
</phase>
</phase-group>
</header>
<body>
<trans-unit id="1" maxbytes="14">
<source xml:lang="en-US">Quetzal</source>
<target xml:lang="ja-JP">Quetzal</target>
</trans-unit>
<trans-unit id="3" maxbytes="114">
<source xml:lang="en-US">An application to manipulate and
process XLIFF documents</source>
<target xml:lang="ja-JP">XLIFF 文書を編集、または処理
するアプリケーションです。</target>
</trans-unit>
<trans-unit id="4" maxbytes="36">
<source xml:lang="en-US">XLIFF Data Manager</source>
<target xml:lang="ja-JP">XLIFF データ・マネージャ</target>
</trans-unit>
</body>
</file>
</xliff>

Enunciate Data Model Documentaton

I'm using Enunciate on a multi module maven project. I use version 1.28 and I just use it for documentation purposes on SOAP Services.
This works just fine for all the Services.
The targetNamespace and endpointInterface has to be declared in the #WebService annotation and everything works fine. I got my zip with wsdl/wadl/xsd/html output.
All javadoc is recognized and published through the output files.
BUT...I would not write here if there is no but...
All data model files won't! I tried the following options:
<api-import pattern="package.model.**" />
<modules>
<spring-app disabled="true" />
<docs docsDir="/docs" title="Web Service API" copyright="ME" />
<!-- Disable all the client generation tools -->
<basic-app disabled="true" />
<c disabled="true" />
<csharp disabled="true" />
<java-client disabled="true" />
<jaxws-client disabled="true" />
<jaxws-ri disabled="true" />
<jaxws-support disabled="true" />
<jersey disabled="true" />
<obj-c disabled="true" />
<xml forceExampleJson="true" />
<jaxws disabled="true" />
<amf disabled="true" />
</modules>
module is not included in webarchive but declared as dependency:
<dependency>
<groupId>package.model</groupId>
<artifactId>model</artifactId>
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
The DTOs and ENUMS in the Data Model are normally provided with:
#XmlType(namespace = "https://package/DTO")
And Javadoc on class and attributes.
But I tried Javadoc on getters and setters too.
I even tried some xml annotation from the example implementation in my project:
#javax.xml.bind.annotation.XmlType(name = "socialGroup", namespace = "http://api.ifyouwannabecool.com/link")
#javax.xml.bind.annotation.XmlRootElement(name = "socialGroup", namespace = "http://api.ifyouwannabecool.com/link")
Without success. The javadoc won't be included in xsd/wsdl/html files as it does for the SOAP Services.
Do you have any idea?
If the classes are in a different Maven module, as you have declared in a dependency, you have to explicitly tell Enunciate to "import" them in order to get the JavaDoc included.
So let's pretend your model classes are in a package called "org.mycompany.widgets.model" and in a package called "org.mycompany.gadgets.model". Tell Enunciate to import those like this:
<enunciate ...>
...
<api-import pattern="org.mycompany.gadgets.model.**"/>
<api-import pattern="org.mycompany.widgets.model.**"/>
...
Please add #XmlRootElement on top of the class so that enunciate will make them appear in Data Model documentation.
Example :
#XmlRootElement
public class Foo{
....
}
I think the problem is <scope>provided</scope>. If the classes aren't present in the classpath, enunciate will not be able to find them. Change it to <scope>compile</scope>, along with the #XmlRootElement annotations and it should work.

background image somehow covers up all the controls adobe flash builder 4.6

I created a skin using an image as background.
When my View imported the skin as skinClass, it covers up all the other controls.
How do i make all the controls display above the skin?
This is my Skin code called Background.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<!-- host component -->
<fx:Metadata>
[HostComponent("spark.components.supportClasses.SkinnableComponent")]
</fx:Metadata>
<s:Image source="assets/Sunflower.gif" smooth="true" left="0" right="0" top="0" bottom="0">
</s:Image>
<s:states>
<s:State name="normal" />
</s:states>
</s:Skin>
This is the main view under default package
<?xml version="1.0" encoding="utf-8"?>
<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"
skinClass="BackgroundImage"
>
<s:ViewNavigator label="Add" width="100%" height="100%" firstView="views.AddView"/>
<s:ViewNavigator label="List" width="100%" height="100%" firstView="views.ListView"/>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:TabbedViewNavigatorApplication>
It looks like your Z index should be adjusted for the controls.
You can change your z-index like this:
parent.setChildIndex(childObject, i)
So for example if you want your controls to always be on front you need:
myControls.parent.setChildIndex(myControls, myControls.parent.numChildren -1)
Hope this helps you, even tho it's hard to answer it without any code...

How do you get a Struts2 value from the .properties file programatically?

Say I have a struts.properties file with a defined value uploads.directory . How can I access that value from an Actioncontext programatically?
You can use getText("some.property.name") which return you the property value
http://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html
Create ActionSupport Object and by using getText() method of ActionSupport class.
ActionSupport actionSupport = new ActionSupport();
actionSupport.getText("foo.bar");
Create a resources folder under src.
In the struts.xml file add a constant e.g., <constant name="struts.custom.i18n.resources" value="global"></constant>
Here global is the name of properties file.
Now you will be able to use the properties in the entire application.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<!-- constant to define result path locations to project root directory -->
<!-- constant to define global resource bundle -->
<constant name="struts.custom.i18n.resources" value="global"></constant>
<package name="user" namespace="/" extends="struts-default">
<action name="home">
<result>/home.jsp</result>
</action>
<action name="welcome" class="com.waqar.struts2.actions.WelcomeAction">
<result name="success">/welcome.jsp</result>
</action>
</package>
</struts>
The welcome.jsp
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%# taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><s:property value="getText('action.welcome.title')"/></title>
</head>
<body>
<s:property value="getText('action.welcome.username')"/>: <s:property value="username"/><br>
</body>
</html>
global.properties
action.welcome.username=waqar
In action class
System.out.println(getText("action.welcome.username"));
You need to put the my.properties file or my_locale.propeties file in the package that houses your action class.
You need to put the values in properties files other than struts.properties for examples ApplicationResources.properties or my.properties which needs to be in the classpath. struts.properties file is used to load struts specific properties for example struts.i18n.encoding=UTF-8 or struts.devMode = false etc.
The thing you need to do in struts.properties after you create the properties file for your customized messages is you have to add the following property in struts.properties file
struts.custom.i18n.resources=ApplicationResources
If you have more than one custom message property files then you need to add them by separating with comma for example:
struts.custom.i18n.resources=ApplicationResources,my
Then in your action classes you can access the property values by using getText('propertyName')
you can get value from message resource file like this:
public class MyAction extends ActionSupport {
public String getUserDetails() {
if("First Name".equals(getText("label.firstName"))) {
System.out.println("In if block");
}
}
}
you can also get more information, how to get values from .properties files in java class or jsp files.
for JSP:
<s:text name="label.firstName" />
and
<s:property value="getText('label.age')" />
for more information you can go through this link:
get info here