All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.causecode.content.blog.Blog.groovy Maven / Gradle / Ivy

Go to download

A plugin used to manage contents like static pages, menus etc. at one place. Also provides shortened and user friendly urls.

There is a newer version: 2.6.2
Show newest version
/*
 * Copyright (c) 2016, CauseCode Technologies Pvt Ltd, India.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or
 * without modification, are not permitted.
 */
package com.causecode.content.blog

import grails.plugins.taggable.Taggable

import com.causecode.content.Content
import com.causecode.fileuploader.UFile
import groovy.transform.EqualsAndHashCode
import groovy.transform.ToString

/**
 * Used to store blogs. These domain extends Content implements taggable(Taggable Plugin Required).
 * @author Shashank Agrawal
 * @author Laxmi Salunkhe
 */
@ToString(includes = ['title', 'contentType'], includePackage = false)
@EqualsAndHashCode
class Blog extends Content implements Taggable {

    static transients = ['numberOfComments', 'blogImgSrc']

    int numberOfComments
    String blogImgSrc

    UFile blogImg
    BlogContentType contentType

    static constraints = {
        blogImg nullable: true
        contentType nullable: true
    }

    static final String UFILE_GROUP = 'blogImg'
}

@SuppressWarnings('GrailsDomainHasEquals')
enum BlogContentType {
    TINYMCE(1),
    MARKDOWN(2),
    RAWCONTENT(3)
    final int id
    BlogContentType(int id) {
        this.id = id
    }

    @Override
    String toString() {
        return "${this.name()}($id)"
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy