[midPoint] Custom schema extension change location

Pavol Mederly mederly at evolveum.com
Tue Jan 24 15:36:15 CET 2017


No, it's

gui\admin-gui\src\main\resources\localization\Midpoint.properties

Best regards,

Pavol Mederly
Software developer
evolveum.com

On 24.01.2017 14:53, mceylan wrote:
>  hi, Where do we add the column name?
>
> schema.properties?   for example
>
> ObjectType.AccountType=Account
>
> tckn is add column name = ObjectType.tckn=TCKN ????
>
> 2017-01-24 15:18 GMT+02:00 Pavol Mederly <mederly at evolveum.com 
> <mailto:mederly at evolveum.com>>:
>
>     Hello.
>
>     I cannot see the screenshot in detail. What's the problem,
>     exactly? Maybe you see "pageUsers.tckn" as the column name. In
>     that case, be sure to either replace
>     createStringResource("pageUsers.tckn") with the exact string you
>     want to have as a column label, or create a "pageUsers.tckn" entry
>     in midpoint.properties file.
>
>>     I don't know manually added
>     Ah I see. It's OK then. Nothing more should be necessary, other
>     than fixing the column name.
>
>     Or is there any other problem?
>
>     Pavol Mederly
>     Software developer
>     evolveum.com <http://evolveum.com>
>
>     On 24.01.2017 13:10, mceylan wrote:
>>     Thanks for you answer.  I used the way you write. And then it
>>     looks like this
>>
>>     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
>>     <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
>>     <http://prism.evolveum.com/xml/ns/demo/extension-electra>"
>>     xmlns:tns="http://prism.evolveum.com/xml/ns/demo/tckn
>>     <http://prism.evolveum.com/xml/ns/demo/tckn>"
>>     xmlns:a="http://prism.evolveum.com/xml/ns/public/annotation-3
>>     <http://prism.evolveum.com/xml/ns/public/annotation-3>"
>>     xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3
>>     <http://midpoint.evolveum.com/xml/ns/public/common/common-3>"
>>     xmlns:xsd="http://www.w3.org/2001/XMLSchema
>>     <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
>>     <mailto: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 developer
>>         evolveum.com <http://evolveum.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 list
>>>         midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>>>         http://lists.evolveum.com/mailman/listinfo/midpoint
>>>         <http://lists.evolveum.com/mailman/listinfo/midpoint>
>>         _______________________________________________ midPoint
>>         mailing list midPoint at lists.evolveum.com
>>         <mailto:midPoint at lists.evolveum.com>
>>         http://lists.evolveum.com/mailman/listinfo/midpoint
>>         <http://lists.evolveum.com/mailman/listinfo/midpoint> 
>>
>>     -- 
>>     Merve CEYLAN
>>
>>     _______________________________________________
>>     midPoint mailing list
>>     midPoint at lists.evolveum.com <mailto:midPoint at lists.evolveum.com>
>>     http://lists.evolveum.com/mailman/listinfo/midpoint
>>     <http://lists.evolveum.com/mailman/listinfo/midpoint>
>     _______________________________________________ midPoint mailing
>     list midPoint at lists.evolveum.com
>     <mailto:midPoint at lists.evolveum.com>
>     http://lists.evolveum.com/mailman/listinfo/midpoint
>     <http://lists.evolveum.com/mailman/listinfo/midpoint> 
>
> -- 
> Merve CEYLAN
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/461e5366/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 84695 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/461e5366/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 45738 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170124/461e5366/attachment-0001.png>


More information about the midPoint mailing list