001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.model;
016    
017    import com.liferay.portal.model.ModelWrapper;
018    
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link DDMTemplate}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       DDMTemplate
030     * @generated
031     */
032    public class DDMTemplateWrapper implements DDMTemplate,
033            ModelWrapper<DDMTemplate> {
034            public DDMTemplateWrapper(DDMTemplate ddmTemplate) {
035                    _ddmTemplate = ddmTemplate;
036            }
037    
038            public Class<?> getModelClass() {
039                    return DDMTemplate.class;
040            }
041    
042            public String getModelClassName() {
043                    return DDMTemplate.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("uuid", getUuid());
050                    attributes.put("templateId", getTemplateId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("userId", getUserId());
054                    attributes.put("userName", getUserName());
055                    attributes.put("createDate", getCreateDate());
056                    attributes.put("modifiedDate", getModifiedDate());
057                    attributes.put("structureId", getStructureId());
058                    attributes.put("name", getName());
059                    attributes.put("description", getDescription());
060                    attributes.put("type", getType());
061                    attributes.put("mode", getMode());
062                    attributes.put("language", getLanguage());
063                    attributes.put("script", getScript());
064    
065                    return attributes;
066            }
067    
068            public void setModelAttributes(Map<String, Object> attributes) {
069                    String uuid = (String)attributes.get("uuid");
070    
071                    if (uuid != null) {
072                            setUuid(uuid);
073                    }
074    
075                    Long templateId = (Long)attributes.get("templateId");
076    
077                    if (templateId != null) {
078                            setTemplateId(templateId);
079                    }
080    
081                    Long groupId = (Long)attributes.get("groupId");
082    
083                    if (groupId != null) {
084                            setGroupId(groupId);
085                    }
086    
087                    Long companyId = (Long)attributes.get("companyId");
088    
089                    if (companyId != null) {
090                            setCompanyId(companyId);
091                    }
092    
093                    Long userId = (Long)attributes.get("userId");
094    
095                    if (userId != null) {
096                            setUserId(userId);
097                    }
098    
099                    String userName = (String)attributes.get("userName");
100    
101                    if (userName != null) {
102                            setUserName(userName);
103                    }
104    
105                    Date createDate = (Date)attributes.get("createDate");
106    
107                    if (createDate != null) {
108                            setCreateDate(createDate);
109                    }
110    
111                    Date modifiedDate = (Date)attributes.get("modifiedDate");
112    
113                    if (modifiedDate != null) {
114                            setModifiedDate(modifiedDate);
115                    }
116    
117                    Long structureId = (Long)attributes.get("structureId");
118    
119                    if (structureId != null) {
120                            setStructureId(structureId);
121                    }
122    
123                    String name = (String)attributes.get("name");
124    
125                    if (name != null) {
126                            setName(name);
127                    }
128    
129                    String description = (String)attributes.get("description");
130    
131                    if (description != null) {
132                            setDescription(description);
133                    }
134    
135                    String type = (String)attributes.get("type");
136    
137                    if (type != null) {
138                            setType(type);
139                    }
140    
141                    String mode = (String)attributes.get("mode");
142    
143                    if (mode != null) {
144                            setMode(mode);
145                    }
146    
147                    String language = (String)attributes.get("language");
148    
149                    if (language != null) {
150                            setLanguage(language);
151                    }
152    
153                    String script = (String)attributes.get("script");
154    
155                    if (script != null) {
156                            setScript(script);
157                    }
158            }
159    
160            /**
161            * Returns the primary key of this d d m template.
162            *
163            * @return the primary key of this d d m template
164            */
165            public long getPrimaryKey() {
166                    return _ddmTemplate.getPrimaryKey();
167            }
168    
169            /**
170            * Sets the primary key of this d d m template.
171            *
172            * @param primaryKey the primary key of this d d m template
173            */
174            public void setPrimaryKey(long primaryKey) {
175                    _ddmTemplate.setPrimaryKey(primaryKey);
176            }
177    
178            /**
179            * Returns the uuid of this d d m template.
180            *
181            * @return the uuid of this d d m template
182            */
183            public java.lang.String getUuid() {
184                    return _ddmTemplate.getUuid();
185            }
186    
187            /**
188            * Sets the uuid of this d d m template.
189            *
190            * @param uuid the uuid of this d d m template
191            */
192            public void setUuid(java.lang.String uuid) {
193                    _ddmTemplate.setUuid(uuid);
194            }
195    
196            /**
197            * Returns the template ID of this d d m template.
198            *
199            * @return the template ID of this d d m template
200            */
201            public long getTemplateId() {
202                    return _ddmTemplate.getTemplateId();
203            }
204    
205            /**
206            * Sets the template ID of this d d m template.
207            *
208            * @param templateId the template ID of this d d m template
209            */
210            public void setTemplateId(long templateId) {
211                    _ddmTemplate.setTemplateId(templateId);
212            }
213    
214            /**
215            * Returns the group ID of this d d m template.
216            *
217            * @return the group ID of this d d m template
218            */
219            public long getGroupId() {
220                    return _ddmTemplate.getGroupId();
221            }
222    
223            /**
224            * Sets the group ID of this d d m template.
225            *
226            * @param groupId the group ID of this d d m template
227            */
228            public void setGroupId(long groupId) {
229                    _ddmTemplate.setGroupId(groupId);
230            }
231    
232            /**
233            * Returns the company ID of this d d m template.
234            *
235            * @return the company ID of this d d m template
236            */
237            public long getCompanyId() {
238                    return _ddmTemplate.getCompanyId();
239            }
240    
241            /**
242            * Sets the company ID of this d d m template.
243            *
244            * @param companyId the company ID of this d d m template
245            */
246            public void setCompanyId(long companyId) {
247                    _ddmTemplate.setCompanyId(companyId);
248            }
249    
250            /**
251            * Returns the user ID of this d d m template.
252            *
253            * @return the user ID of this d d m template
254            */
255            public long getUserId() {
256                    return _ddmTemplate.getUserId();
257            }
258    
259            /**
260            * Sets the user ID of this d d m template.
261            *
262            * @param userId the user ID of this d d m template
263            */
264            public void setUserId(long userId) {
265                    _ddmTemplate.setUserId(userId);
266            }
267    
268            /**
269            * Returns the user uuid of this d d m template.
270            *
271            * @return the user uuid of this d d m template
272            * @throws SystemException if a system exception occurred
273            */
274            public java.lang.String getUserUuid()
275                    throws com.liferay.portal.kernel.exception.SystemException {
276                    return _ddmTemplate.getUserUuid();
277            }
278    
279            /**
280            * Sets the user uuid of this d d m template.
281            *
282            * @param userUuid the user uuid of this d d m template
283            */
284            public void setUserUuid(java.lang.String userUuid) {
285                    _ddmTemplate.setUserUuid(userUuid);
286            }
287    
288            /**
289            * Returns the user name of this d d m template.
290            *
291            * @return the user name of this d d m template
292            */
293            public java.lang.String getUserName() {
294                    return _ddmTemplate.getUserName();
295            }
296    
297            /**
298            * Sets the user name of this d d m template.
299            *
300            * @param userName the user name of this d d m template
301            */
302            public void setUserName(java.lang.String userName) {
303                    _ddmTemplate.setUserName(userName);
304            }
305    
306            /**
307            * Returns the create date of this d d m template.
308            *
309            * @return the create date of this d d m template
310            */
311            public java.util.Date getCreateDate() {
312                    return _ddmTemplate.getCreateDate();
313            }
314    
315            /**
316            * Sets the create date of this d d m template.
317            *
318            * @param createDate the create date of this d d m template
319            */
320            public void setCreateDate(java.util.Date createDate) {
321                    _ddmTemplate.setCreateDate(createDate);
322            }
323    
324            /**
325            * Returns the modified date of this d d m template.
326            *
327            * @return the modified date of this d d m template
328            */
329            public java.util.Date getModifiedDate() {
330                    return _ddmTemplate.getModifiedDate();
331            }
332    
333            /**
334            * Sets the modified date of this d d m template.
335            *
336            * @param modifiedDate the modified date of this d d m template
337            */
338            public void setModifiedDate(java.util.Date modifiedDate) {
339                    _ddmTemplate.setModifiedDate(modifiedDate);
340            }
341    
342            /**
343            * Returns the structure ID of this d d m template.
344            *
345            * @return the structure ID of this d d m template
346            */
347            public long getStructureId() {
348                    return _ddmTemplate.getStructureId();
349            }
350    
351            /**
352            * Sets the structure ID of this d d m template.
353            *
354            * @param structureId the structure ID of this d d m template
355            */
356            public void setStructureId(long structureId) {
357                    _ddmTemplate.setStructureId(structureId);
358            }
359    
360            /**
361            * Returns the name of this d d m template.
362            *
363            * @return the name of this d d m template
364            */
365            public java.lang.String getName() {
366                    return _ddmTemplate.getName();
367            }
368    
369            /**
370            * Returns the localized name of this d d m template in the language. Uses the default language if no localization exists for the requested language.
371            *
372            * @param locale the locale of the language
373            * @return the localized name of this d d m template
374            */
375            public java.lang.String getName(java.util.Locale locale) {
376                    return _ddmTemplate.getName(locale);
377            }
378    
379            /**
380            * Returns the localized name of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
381            *
382            * @param locale the local of the language
383            * @param useDefault whether to use the default language if no localization exists for the requested language
384            * @return the localized name of this d d m template. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
385            */
386            public java.lang.String getName(java.util.Locale locale, boolean useDefault) {
387                    return _ddmTemplate.getName(locale, useDefault);
388            }
389    
390            /**
391            * Returns the localized name of this d d m template in the language. Uses the default language if no localization exists for the requested language.
392            *
393            * @param languageId the ID of the language
394            * @return the localized name of this d d m template
395            */
396            public java.lang.String getName(java.lang.String languageId) {
397                    return _ddmTemplate.getName(languageId);
398            }
399    
400            /**
401            * Returns the localized name of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
402            *
403            * @param languageId the ID of the language
404            * @param useDefault whether to use the default language if no localization exists for the requested language
405            * @return the localized name of this d d m template
406            */
407            public java.lang.String getName(java.lang.String languageId,
408                    boolean useDefault) {
409                    return _ddmTemplate.getName(languageId, useDefault);
410            }
411    
412            public java.lang.String getNameCurrentLanguageId() {
413                    return _ddmTemplate.getNameCurrentLanguageId();
414            }
415    
416            public java.lang.String getNameCurrentValue() {
417                    return _ddmTemplate.getNameCurrentValue();
418            }
419    
420            /**
421            * Returns a map of the locales and localized names of this d d m template.
422            *
423            * @return the locales and localized names of this d d m template
424            */
425            public java.util.Map<java.util.Locale, java.lang.String> getNameMap() {
426                    return _ddmTemplate.getNameMap();
427            }
428    
429            /**
430            * Sets the name of this d d m template.
431            *
432            * @param name the name of this d d m template
433            */
434            public void setName(java.lang.String name) {
435                    _ddmTemplate.setName(name);
436            }
437    
438            /**
439            * Sets the localized name of this d d m template in the language.
440            *
441            * @param name the localized name of this d d m template
442            * @param locale the locale of the language
443            */
444            public void setName(java.lang.String name, java.util.Locale locale) {
445                    _ddmTemplate.setName(name, locale);
446            }
447    
448            /**
449            * Sets the localized name of this d d m template in the language, and sets the default locale.
450            *
451            * @param name the localized name of this d d m template
452            * @param locale the locale of the language
453            * @param defaultLocale the default locale
454            */
455            public void setName(java.lang.String name, java.util.Locale locale,
456                    java.util.Locale defaultLocale) {
457                    _ddmTemplate.setName(name, locale, defaultLocale);
458            }
459    
460            public void setNameCurrentLanguageId(java.lang.String languageId) {
461                    _ddmTemplate.setNameCurrentLanguageId(languageId);
462            }
463    
464            /**
465            * Sets the localized names of this d d m template from the map of locales and localized names.
466            *
467            * @param nameMap the locales and localized names of this d d m template
468            */
469            public void setNameMap(
470                    java.util.Map<java.util.Locale, java.lang.String> nameMap) {
471                    _ddmTemplate.setNameMap(nameMap);
472            }
473    
474            /**
475            * Sets the localized names of this d d m template from the map of locales and localized names, and sets the default locale.
476            *
477            * @param nameMap the locales and localized names of this d d m template
478            * @param defaultLocale the default locale
479            */
480            public void setNameMap(
481                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
482                    java.util.Locale defaultLocale) {
483                    _ddmTemplate.setNameMap(nameMap, defaultLocale);
484            }
485    
486            /**
487            * Returns the description of this d d m template.
488            *
489            * @return the description of this d d m template
490            */
491            public java.lang.String getDescription() {
492                    return _ddmTemplate.getDescription();
493            }
494    
495            /**
496            * Returns the localized description of this d d m template in the language. Uses the default language if no localization exists for the requested language.
497            *
498            * @param locale the locale of the language
499            * @return the localized description of this d d m template
500            */
501            public java.lang.String getDescription(java.util.Locale locale) {
502                    return _ddmTemplate.getDescription(locale);
503            }
504    
505            /**
506            * Returns the localized description of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
507            *
508            * @param locale the local of the language
509            * @param useDefault whether to use the default language if no localization exists for the requested language
510            * @return the localized description of this d d m template. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
511            */
512            public java.lang.String getDescription(java.util.Locale locale,
513                    boolean useDefault) {
514                    return _ddmTemplate.getDescription(locale, useDefault);
515            }
516    
517            /**
518            * Returns the localized description of this d d m template in the language. Uses the default language if no localization exists for the requested language.
519            *
520            * @param languageId the ID of the language
521            * @return the localized description of this d d m template
522            */
523            public java.lang.String getDescription(java.lang.String languageId) {
524                    return _ddmTemplate.getDescription(languageId);
525            }
526    
527            /**
528            * Returns the localized description of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
529            *
530            * @param languageId the ID of the language
531            * @param useDefault whether to use the default language if no localization exists for the requested language
532            * @return the localized description of this d d m template
533            */
534            public java.lang.String getDescription(java.lang.String languageId,
535                    boolean useDefault) {
536                    return _ddmTemplate.getDescription(languageId, useDefault);
537            }
538    
539            public java.lang.String getDescriptionCurrentLanguageId() {
540                    return _ddmTemplate.getDescriptionCurrentLanguageId();
541            }
542    
543            public java.lang.String getDescriptionCurrentValue() {
544                    return _ddmTemplate.getDescriptionCurrentValue();
545            }
546    
547            /**
548            * Returns a map of the locales and localized descriptions of this d d m template.
549            *
550            * @return the locales and localized descriptions of this d d m template
551            */
552            public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
553                    return _ddmTemplate.getDescriptionMap();
554            }
555    
556            /**
557            * Sets the description of this d d m template.
558            *
559            * @param description the description of this d d m template
560            */
561            public void setDescription(java.lang.String description) {
562                    _ddmTemplate.setDescription(description);
563            }
564    
565            /**
566            * Sets the localized description of this d d m template in the language.
567            *
568            * @param description the localized description of this d d m template
569            * @param locale the locale of the language
570            */
571            public void setDescription(java.lang.String description,
572                    java.util.Locale locale) {
573                    _ddmTemplate.setDescription(description, locale);
574            }
575    
576            /**
577            * Sets the localized description of this d d m template in the language, and sets the default locale.
578            *
579            * @param description the localized description of this d d m template
580            * @param locale the locale of the language
581            * @param defaultLocale the default locale
582            */
583            public void setDescription(java.lang.String description,
584                    java.util.Locale locale, java.util.Locale defaultLocale) {
585                    _ddmTemplate.setDescription(description, locale, defaultLocale);
586            }
587    
588            public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
589                    _ddmTemplate.setDescriptionCurrentLanguageId(languageId);
590            }
591    
592            /**
593            * Sets the localized descriptions of this d d m template from the map of locales and localized descriptions.
594            *
595            * @param descriptionMap the locales and localized descriptions of this d d m template
596            */
597            public void setDescriptionMap(
598                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
599                    _ddmTemplate.setDescriptionMap(descriptionMap);
600            }
601    
602            /**
603            * Sets the localized descriptions of this d d m template from the map of locales and localized descriptions, and sets the default locale.
604            *
605            * @param descriptionMap the locales and localized descriptions of this d d m template
606            * @param defaultLocale the default locale
607            */
608            public void setDescriptionMap(
609                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
610                    java.util.Locale defaultLocale) {
611                    _ddmTemplate.setDescriptionMap(descriptionMap, defaultLocale);
612            }
613    
614            /**
615            * Returns the type of this d d m template.
616            *
617            * @return the type of this d d m template
618            */
619            public java.lang.String getType() {
620                    return _ddmTemplate.getType();
621            }
622    
623            /**
624            * Sets the type of this d d m template.
625            *
626            * @param type the type of this d d m template
627            */
628            public void setType(java.lang.String type) {
629                    _ddmTemplate.setType(type);
630            }
631    
632            /**
633            * Returns the mode of this d d m template.
634            *
635            * @return the mode of this d d m template
636            */
637            public java.lang.String getMode() {
638                    return _ddmTemplate.getMode();
639            }
640    
641            /**
642            * Sets the mode of this d d m template.
643            *
644            * @param mode the mode of this d d m template
645            */
646            public void setMode(java.lang.String mode) {
647                    _ddmTemplate.setMode(mode);
648            }
649    
650            /**
651            * Returns the language of this d d m template.
652            *
653            * @return the language of this d d m template
654            */
655            public java.lang.String getLanguage() {
656                    return _ddmTemplate.getLanguage();
657            }
658    
659            /**
660            * Sets the language of this d d m template.
661            *
662            * @param language the language of this d d m template
663            */
664            public void setLanguage(java.lang.String language) {
665                    _ddmTemplate.setLanguage(language);
666            }
667    
668            /**
669            * Returns the script of this d d m template.
670            *
671            * @return the script of this d d m template
672            */
673            public java.lang.String getScript() {
674                    return _ddmTemplate.getScript();
675            }
676    
677            /**
678            * Sets the script of this d d m template.
679            *
680            * @param script the script of this d d m template
681            */
682            public void setScript(java.lang.String script) {
683                    _ddmTemplate.setScript(script);
684            }
685    
686            public boolean isNew() {
687                    return _ddmTemplate.isNew();
688            }
689    
690            public void setNew(boolean n) {
691                    _ddmTemplate.setNew(n);
692            }
693    
694            public boolean isCachedModel() {
695                    return _ddmTemplate.isCachedModel();
696            }
697    
698            public void setCachedModel(boolean cachedModel) {
699                    _ddmTemplate.setCachedModel(cachedModel);
700            }
701    
702            public boolean isEscapedModel() {
703                    return _ddmTemplate.isEscapedModel();
704            }
705    
706            public java.io.Serializable getPrimaryKeyObj() {
707                    return _ddmTemplate.getPrimaryKeyObj();
708            }
709    
710            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
711                    _ddmTemplate.setPrimaryKeyObj(primaryKeyObj);
712            }
713    
714            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
715                    return _ddmTemplate.getExpandoBridge();
716            }
717    
718            public void setExpandoBridgeAttributes(
719                    com.liferay.portal.service.ServiceContext serviceContext) {
720                    _ddmTemplate.setExpandoBridgeAttributes(serviceContext);
721            }
722    
723            public void prepareLocalizedFieldsForImport(
724                    java.util.Locale defaultImportLocale)
725                    throws com.liferay.portal.LocaleException {
726                    _ddmTemplate.prepareLocalizedFieldsForImport(defaultImportLocale);
727            }
728    
729            @Override
730            public java.lang.Object clone() {
731                    return new DDMTemplateWrapper((DDMTemplate)_ddmTemplate.clone());
732            }
733    
734            public int compareTo(
735                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) {
736                    return _ddmTemplate.compareTo(ddmTemplate);
737            }
738    
739            @Override
740            public int hashCode() {
741                    return _ddmTemplate.hashCode();
742            }
743    
744            public com.liferay.portal.model.CacheModel<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> toCacheModel() {
745                    return _ddmTemplate.toCacheModel();
746            }
747    
748            public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate toEscapedModel() {
749                    return new DDMTemplateWrapper(_ddmTemplate.toEscapedModel());
750            }
751    
752            @Override
753            public java.lang.String toString() {
754                    return _ddmTemplate.toString();
755            }
756    
757            public java.lang.String toXmlString() {
758                    return _ddmTemplate.toXmlString();
759            }
760    
761            public void persist()
762                    throws com.liferay.portal.kernel.exception.SystemException {
763                    _ddmTemplate.persist();
764            }
765    
766            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure()
767                    throws com.liferay.portal.kernel.exception.PortalException,
768                            com.liferay.portal.kernel.exception.SystemException {
769                    return _ddmTemplate.getStructure();
770            }
771    
772            /**
773             * @deprecated Renamed to {@link #getWrappedModel}
774             */
775            public DDMTemplate getWrappedDDMTemplate() {
776                    return _ddmTemplate;
777            }
778    
779            public DDMTemplate getWrappedModel() {
780                    return _ddmTemplate;
781            }
782    
783            public void resetOriginalValues() {
784                    _ddmTemplate.resetOriginalValues();
785            }
786    
787            private DDMTemplate _ddmTemplate;
788    }