[midPoint] Custom schema extension change location
mceylan
mrveceylan at gmail.com
Tue Jan 24 13:10:21 CET 2017
Thanks for you answer. I used the way you write. And then it looks like
this
[image: Satır içi resim 2]
and create tckn.xsd schema file. Ant hen it looks like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ Copyright (c) 2010-2013 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!-- This is a runtime schema that defines data types used in the
<extension> part of the objects. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="
http://prism.evolveum.com/xml/ns/demo/extension-electra"
xmlns:tns="http://prism.evolveum.com/xml/ns/demo/tckn"
xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3"
xmlns:c="
http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="UserExtensionType">
<xsd:annotation>
<xsd:appinfo>
<a:extension ref="c:UserType"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="tckn" type="xsd:string" minOccurs="0"
maxOccurs="1">
<xsd:annotation>
<xsd:appinfo>
<a:indexed>true</a:indexed>
<a:displayName>TCKN</a:displayName>
<a:displayOrder>120</a:displayOrder>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
You: I assume you manually added this constant
I don't know manually added
Thanks,
2017-01-24 11:14 GMT+02:00 Pavol Mederly <mederly at evolveum.com>:
> Hello Merve,
>
> sorry for the late answer.
>
> It can be done in this way:
>
> column = new AbstractColumn<SelectableBean<UserType>, String>(
> createStringResource("pageUsers.tckn")) {
>
> @Override
> public void populateItem(Item<ICellPopulator<SelectableBean<UserType>>>
> cellItem,
> String componentId, IModel<SelectableBean<UserType>>
> model) {
> String tckn = null;
> UserType user = model.getObject().getValue();
> if (user != null && user.getExtension() != null) {
> PrismProperty<String> tcknProperty =
> user.getExtension().asPrismContainerValue().findProperty(new
> QName("tckn"));
> if (tcknProperty != null) {
> tckn = tcknProperty.getRealValue();
> }
> }
> cellItem.add(new Label(componentId, tckn));
> }
> };
>
> And then it looks like this (place the column appropriately for your
> situation):
>
> You could probably replace new QName("tckn") with UserType.EXTENSION_TCKN
> - I assume you manually added this constant. (Although beware that UserType
> is a generated class, so this constant probably gets overwritten at "mvn
> clean install".)
>
> Hope this helps,
>
> Pavol Mederly
> Software developerevolveum.com
>
> On 24.01.2017 7:13, mceylan wrote:
>
> hi,
>
> create custom extension schema "tckn"
>
> I want Tckn is add admin page users list column. For Example
>
>
> name name givenName familyName tckn emailAddress
>
>
>
> PageUsers.java
>
> column = new PropertyColumn(createStringResource("Usertype.tckn"),
> UserType.EXTENSION_TCKN.getLocalPart(),SelectableBean.F_VALUE + ".tckn");
> columns.add(column);
>
>
>
> --
> Merve CEYLAN
>
>
> _______________________________________________
> midPoint mailing listmidPoint at lists.evolveum.comhttp://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>
--
Merve CEYLAN
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/0cfaf7ed/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TCKN Extension.png
Type: image/png
Size: 84695 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/0cfaf7ed/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fibiddpojigmpahg.png
Type: image/png
Size: 45738 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/0cfaf7ed/attachment-0001.png>
More information about the midPoint
mailing list