Skip to content
Snippets Groups Projects
Commit 337a24e1 authored by Clément Aubin's avatar Clément Aubin
Browse files

[misc] Move NotificationEmailPreferenceClass to DocumentInitializer

parent 43971ca3
No related branches found
No related tags found
No related merge requests found
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.xwiki.notifications.preferences.internal;
import java.util.Arrays;
import java.util.List;
import javax.inject.Named;
import javax.inject.Singleton;
import org.xwiki.component.annotation.Component;
import org.xwiki.model.reference.LocalDocumentReference;
import com.xpn.xwiki.doc.AbstractMandatoryClassInitializer;
import com.xpn.xwiki.objects.classes.BaseClass;
/**
* Define the NotificationEmailPreferenceClass XClass.
*
* @version $Id$
* @since 9.7RC1
*/
@Component
@Named("XWiki.Notifications.Code.NotificationEmailPreferenceClass")
@Singleton
public class NotificationEmailPreferenceDocumentInitializer extends AbstractMandatoryClassInitializer
{
/**
* The path to the class parent document.
*/
private static final List<String> PARENT_PATH = Arrays.asList("XWiki", "Notifications", "Code");
/**
* Default constructor.
*/
public NotificationEmailPreferenceDocumentInitializer()
{
super(new LocalDocumentReference(PARENT_PATH, "NotificationEmailPreferenceClass"));
}
@Override
protected void createClass(BaseClass xclass)
{
xclass.addStaticListField("interval", "Notification interval", 64,
false, "hourly=Hourly|daily=Daily|weekly=Weekly|live=Live",
"select", "|, ");
}
}
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
* Define the NotificationPreferenceClass XClass. * Define the NotificationPreferenceClass XClass.
* *
* @version $Id$ * @version $Id$
* @since 9.7R1 * @since 9.7RC1
*/ */
@Component @Component
@Named("XWiki.Notifications.Code.NotificationPreferenceClass") @Named("XWiki.Notifications.Code.NotificationPreferenceClass")
......
org.xwiki.notifications.preferences.internal.DefaultModelBridge org.xwiki.notifications.preferences.internal.DefaultModelBridge
org.xwiki.notifications.preferences.internal.NotificationEmailPreferenceDocumentInitializer
org.xwiki.notifications.preferences.internal.NotificationPreferenceDocumentInitializer org.xwiki.notifications.preferences.internal.NotificationPreferenceDocumentInitializer
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<xwikidoc version="1.3" reference="XWiki.Notifications.Code.NotificationEmailPreferenceClass" locale="">
<web>XWiki.Notifications.Code</web>
<name>NotificationEmailPreferenceClass</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1497358819000</creationDate>
<parent>XWiki.Notifications.Code.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1497358927000</date>
<contentUpdateDate>1497358819000</contentUpdateDate>
<version>1.1</version>
<title>NotificationEmailPreferenceClass</title>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>true</hidden>
<content/>
<class>
<name>XWiki.Notifications.Code.NotificationEmailPreferenceClass</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<interval>
<cache>0</cache>
<customDisplay/>
<disabled>0</disabled>
<displayType>select</displayType>
<multiSelect>0</multiSelect>
<name>interval</name>
<number>1</number>
<picker>0</picker>
<prettyName>interval</prettyName>
<relationalStorage>0</relationalStorage>
<separator> </separator>
<separators>|, </separators>
<size>1</size>
<sort>none</sort>
<unmodifiable>0</unmodifiable>
<validationMessage/>
<validationRegExp/>
<values>hourly=Hourly|daily=Daily|weekly=Weekly|live=Live</values>
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
</interval>
</class>
<object>
<name>XWiki.Notifications.Code.NotificationEmailPreferenceClass</name>
<number>0</number>
<className>XWiki.DocumentSheetBinding</className>
<guid>609133cf-a400-43f0-ab5f-944859f90002</guid>
<class>
<name>XWiki.DocumentSheetBinding</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<sheet>
<customDisplay/>
<disabled>0</disabled>
<name>sheet</name>
<number>1</number>
<picker>0</picker>
<prettyName>Sheet</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<validationMessage/>
<validationRegExp/>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</sheet>
</class>
<property>
<sheet>XWiki.ClassSheet</sheet>
</property>
</object>
</xwikidoc>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment