// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/model/exceptions/SlingModelsException.java
// public class SlingModelsException extends Exception {
// 
// 	public SlingModelsException(String message) {
// 		super(message);
// 	}
// 
// }
// 
// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/solr/SolrTimestamp.java
// public class SolrTimestamp {
// 
// 
//     private SolrTimestamp() {
//         // Prevent instantiation
//     }
// 
//     /**
//      * Converts a date to the UTC DateField format that Solr expects.
//      *
//      * @param date
//      * @return
//      */
//     public static String convertToUtc(Date date) {
// 
//         DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:00.00'Z'");
//         formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
//         return formatter.format(date);
//     }
// 
//     public static String convertToUtcAndUseNowIfNull(Date date) {
// 
//         return date != null ? convertToUtc(date) : convertToUtc(new Date());
//     }
// }
// 
// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/solr/GeometrixxMediaSchema.java
// public interface GeometrixxMediaSchema {
// 
//     public static final String AUTHOR = "author";
//     public static final String BODY = "body";
//     public static final String DESCRIPTION = "description";
//     public static final String ID = "id";
//     public static final String LAST_MODIFIED = "last_modified";
//     public static final String PUBLISH_DATE = "publishDate";
//     public static final String SLING_RESOUCE_TYPE = "sling_resource_type";
//     public static final String TAGS = "tags";
//     public static final String TITLE = "title";
//     public static final String URL = "url";
// 
// }


import com.day.cq.tagging.Tag;
import com.day.cq.tagging.TagManager;
import com.day.cq.wcm.api.NameConstants;
import com.headwire.aemsolrsearch.geometrixxmedia.model.exceptions.SlingModelsException;
import com.headwire.aemsolrsearch.geometrixxmedia.solr.SolrTimestamp;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;
import org.apache.solr.common.SolrInputDocument;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.Arrays;
import java.util.Date;
import static com.headwire.aemsolrsearch.geometrixxmedia.solr.GeometrixxMediaSchema.*;
package com.headwire.aemsolrsearch.geometrixxmedia.model;




@Model(adaptables = Resource.class)
public class GeometrixxMediaPageContent {

    private static final Logger LOG =
        LoggerFactory.getLogger(GeometrixxMediaPageContent.class);

    private GeometrixxMediaAuthorSummary author;

    private GeometrixxMediaArticleBody body;

    private String id;

    private String url;

    @Inject @Named("jcr:description") @Default
    private String description;

    @Inject @Named("sling:resourceType")
    private String slingResourceType;

    @Inject @Named("jcr:title") @Default
    private String title;

    @Inject @Named("author-summary/articleAuthor") @Default
    private String authorRef;

    @Inject @Named("article-content-par/article/fileReference") @Optional
    private GeometrixxMediaArticleBody articleBody;

    @Inject @Named(NameConstants.PN_PAGE_LAST_MOD) @Optional
    private Date lastUpdate;

    @Inject @Named("author-summary/publishedDate") @Optional
    private Date publishDate;

    private Tag[] tags;

    private Resource resource;

    @PostConstruct
// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/model/exceptions/SlingModelsException.java
// public class SlingModelsException extends Exception {
// 
// 	public SlingModelsException(String message) {
// 		super(message);
// 	}
// 
// }
// 
// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/solr/SolrTimestamp.java
// public class SolrTimestamp {
// 
// 
//     private SolrTimestamp() {
//         // Prevent instantiation
//     }
// 
//     /**
//      * Converts a date to the UTC DateField format that Solr expects.
//      *
//      * @param date
//      * @return
//      */
//     public static String convertToUtc(Date date) {
// 
//         DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:00.00'Z'");
//         formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
//         return formatter.format(date);
//     }
// 
//     public static String convertToUtcAndUseNowIfNull(Date date) {
// 
//         return date != null ? convertToUtc(date) : convertToUtc(new Date());
//     }
// }
// 
// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/solr/GeometrixxMediaSchema.java
// public interface GeometrixxMediaSchema {
// 
//     public static final String AUTHOR = "author";
//     public static final String BODY = "body";
//     public static final String DESCRIPTION = "description";
//     public static final String ID = "id";
//     public static final String LAST_MODIFIED = "last_modified";
//     public static final String PUBLISH_DATE = "publishDate";
//     public static final String SLING_RESOUCE_TYPE = "sling_resource_type";
//     public static final String TAGS = "tags";
//     public static final String TITLE = "title";
//     public static final String URL = "url";
// 
// }


// Path: aemsolrsearch-geometrixx-media-sample/src/main/java/com/headwire/aemsolrsearch/geometrixxmedia/model/GeometrixxMediaPageContent.java
import com.day.cq.tagging.Tag;
import com.day.cq.tagging.TagManager;
import com.day.cq.wcm.api.NameConstants;
import com.headwire.aemsolrsearch.geometrixxmedia.model.exceptions.SlingModelsException;
import com.headwire.aemsolrsearch.geometrixxmedia.solr.SolrTimestamp;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;
import org.apache.solr.common.SolrInputDocument;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.Arrays;
import java.util.Date;
import static com.headwire.aemsolrsearch.geometrixxmedia.solr.GeometrixxMediaSchema.*;

package com.headwire.aemsolrsearch.geometrixxmedia.model;




@Model(adaptables = Resource.class)
public class GeometrixxMediaPageContent {

    private static final Logger LOG =
        LoggerFactory.getLogger(GeometrixxMediaPageContent.class);

    private GeometrixxMediaAuthorSummary author;

    private GeometrixxMediaArticleBody body;

    private String id;

    private String url;

    @Inject @Named("jcr:description") @Default
    private String description;

    @Inject @Named("sling:resourceType")
    private String slingResourceType;

    @Inject @Named("jcr:title") @Default
    private String title;

    @Inject @Named("author-summary/articleAuthor") @Default
    private String authorRef;

    @Inject @Named("article-content-par/article/fileReference") @Optional
    private GeometrixxMediaArticleBody articleBody;

    @Inject @Named(NameConstants.PN_PAGE_LAST_MOD) @Optional
    private Date lastUpdate;

    @Inject @Named("author-summary/publishedDate") @Optional
    private Date publishDate;

    private Tag[] tags;

    private Resource resource;

    @PostConstruct
    public void init() throws SlingModelsException {