Default value when using metadata xml forms.

Help us to improve OpenKM! Be part of the Open Source Community.
Forum rules
Please, before asking something see the documentation wiki or use the forum search function.
Post Reply
cherifmad
Junior Boarder
Junior Boarder
Posts: 35
Joined: Tue Apr 03, 2018 6:22 pm

Default value when using metadata xml forms.

Post by cherifmad » Thu May 31, 2018 12:48 am

Good morning,
I have a problem.
I would like to know if it is possible to add a default value when we create an Xml metadata form.
for example :

Code: Select all

<property groups>>property groups
  property group label="Consulting" name="okg:consulting">"okg:consulting".
    <input label="Name" type="text" name="okp:consulting.name "value=" default name"/>" name"/>".
    <input label="Date" type="date" name="okp:consulting.date" value ="default text"/>>default text".
    <checkbox label="Important" name="okp:consulting.important"/>>".
    <textarea label="Comment" name="okp:consulting.comment" value=" textarea by default" />>"okp:consulting.comment" value=" textarea by default".
    <input label="Input label" name="okp:consulting.input1" />"Input label" name="okp:consulting.input1" />
    <separator label="Separator label" name="okp:consulting.separator" />"okp:consulting.separator" /> 
    <input label="Input label" name="okp:consulting.input2" />"Input label="Entrée label" name="okp:consulting.input2" />

    
  </group of goods>>group of goods
I'm trying but there's an error on my screen:

Application error
Class: com.openkm.core.ParseException
Message: Attribute "value" must be declared for element type "input".
Date: Thu May 31 00:46:12 UTC 2018

can you help to resolve it.
thanks for all

lnovoa
Senior Boarder
Senior Boarder
Posts: 59
Joined: Tue Mar 27, 2018 8:00 am

Re: Default value when using metadata xml forms.

Post by lnovoa » Thu May 31, 2018 3:27 pm

Hi!,
The xml was not well formed, if it is as you show in the post.
Try this example and you will see the default values.

https://docs.openkm.com/kcenter/view/ok ... field.html

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.9//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.9.dtd">
<property-groups> 
  <property-group label="Consulting" name="okg:consulting">
    <input label="Name" type="text" name="okp:consulting.name" value="default value"/>
      <input label="Date" type="date" name="okp:consulting.name" value="20100611221912"/>
       <checkbox label="Important" name="okp:consulting.important"/>
    <textarea label="Comment" name="okp:consulting.comment" value="textarea by default" />
    <input label="Input label" name="okp:consulting.input1"  value="default value" />
    <separator label="Separator label" name="okp:consulting.separator" />
    <input label="Input label" name="okp:consulting.input2" value="default value" />
        </property-group>
</property-groups>

cherifmad
Junior Boarder
Junior Boarder
Posts: 35
Joined: Tue Apr 03, 2018 6:22 pm

Re: Default value when using metadata xml forms.

Post by cherifmad » Thu May 31, 2018 4:11 pm

lnovoa wrote:
Thu May 31, 2018 3:27 pm
Hi!,
The xml was not well formed, if it is as you show in the post.
Try this example and you will see the default values.

https://docs.openkm.com/kcenter/view/ok ... field.html

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.9//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.9.dtd">
<property-groups> 
  <property-group label="Consulting" name="okg:consulting">
    <input label="Name" type="text" name="okp:consulting.name" value="default value"/>
      <input label="Date" type="date" name="okp:consulting.name" value="20100611221912"/>
       <checkbox label="Important" name="okp:consulting.important"/>
    <textarea label="Comment" name="okp:consulting.comment" value="textarea by default" />
    <input label="Input label" name="okp:consulting.input1"  value="default value" />
    <separator label="Separator label" name="okp:consulting.separator" />
    <input label="Input label" name="okp:consulting.input2" value="default value" />
        </property-group>
</property-groups>
Thanks Dear Inovoa, I have try it ( your script) But this error appear ...
how can I resolve and fix this problem
Attachments
erreur 2.png
erreur 1.png

lnovoa
Senior Boarder
Senior Boarder
Posts: 59
Joined: Tue Mar 27, 2018 8:00 am

Re: Default value when using metadata xml forms.

Post by lnovoa » Fri Jun 01, 2018 8:09 am

Hi,
In this link, you can see how it is built and then you simply have to add
the value properties and the date format mentioned in the previous post

https://docs.openkm.com/kcenter/view/ok ... ition.html

cherifmad
Junior Boarder
Junior Boarder
Posts: 35
Joined: Tue Apr 03, 2018 6:22 pm

Re: Default value when using metadata xml forms.

Post by cherifmad » Fri Jun 01, 2018 9:37 am

lnovoa wrote:
Fri Jun 01, 2018 8:09 am
Hi,
In this link, you can see how it is built and then you simply have to add
the value properties and the date format mentioned in the previous post

https://docs.openkm.com/kcenter/view/ok ... ition.html
I saw this link again, I set the default value, but the same error persists.
Please, can you write a script that works very well in your openKM and I will test at home to see where I make my mistakes?
thank you for your understanding

lnovoa
Senior Boarder
Senior Boarder
Posts: 59
Joined: Tue Mar 27, 2018 8:00 am

Re: Default value when using metadata xml forms.

Post by lnovoa » Fri Jun 01, 2018 11:23 am

Hi!,

for example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.7//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.7.dtd">
<property-groups> 
  <property-group label="Consulting" name="okg:consulting">
    <checkbox label="Important" name="okp:consulting.important"/>
    <textarea label="Comment" name="okp:consulting.comment" value="textarea by default" />
    <input label="Input label" name="okp:consulting.input1"  value="default value" />
    <separator label="Separator label" name="okp:consulting.separator" />
    <input label="Input label" name="okp:consulting.input2" value="default value" />
    <input label="Date" type="date" name="okp:consulting.name" value="20100611221912"/>
   </property-group>
</property-groups>

cherifmad
Junior Boarder
Junior Boarder
Posts: 35
Joined: Tue Apr 03, 2018 6:22 pm

Re: Default value when using metadata xml forms.

Post by cherifmad » Sat Jun 02, 2018 1:07 am

lnovoa wrote:
Fri Jun 01, 2018 11:23 am
Hi!,

for example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.7//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.7.dtd">
<property-groups> 
  <property-group label="Consulting" name="okg:consulting">
    <checkbox label="Important" name="okp:consulting.important"/>
    <textarea label="Comment" name="okp:consulting.comment" value="textarea by default" />
    <input label="Input label" name="okp:consulting.input1"  value="default value" />
    <separator label="Separator label" name="okp:consulting.separator" />
    <input label="Input label" name="okp:consulting.input2" value="default value" />
    <input label="Date" type="date" name="okp:consulting.name" value="20100611221912"/>
   </property-group>
</property-groups>
Sorry, I have executed your Script but an over error appear ... See the screenshot
Thanks for your understanding
Attachments
erreur 2.png
erreur 1.png

jllort
Moderator
Moderator
Posts: 10037
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: Default value when using metadata xml forms.

Post by jllort » Sat Jun 02, 2018 4:35 pm

Community DTD latest version is 2.3 not 2.7 as you can see here https://docs.openkm.com/kcenter/view/ok ... table.html

Try with:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.3//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.3.dtd">
<property-groups>
  <property-group label="Consulting" name="okg:consulting">
    <input label="Input label"  name="okp:consulting.input" value="test" />
  </property-group>
</property-groups>

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest