Package com.psddev.dari.db

Examples of com.psddev.dari.db.ObjectType


            return children;
        }

        private static <T extends Taxon> void sort(List<T> taxa) {
            if (taxa != null && !taxa.isEmpty()) {
                ObjectType taxonType = taxa.get(0).getState().getType();
                ToolUi ui = taxonType.as(ToolUi.class);
                if (!ObjectUtils.isBlank(ui.getDefaultSortField())) {
                    Collections.sort(taxa, new ObjectFieldComparator(ui.getDefaultSortField(), true));
                }
            }
        }
View Full Code Here


                }
            }
        }

        private String findSimilar(String term) {
            ObjectType type = getType();
            String encodedTerm = METAPHONE.encode(term);

            String displayName = type.getDisplayName();
            if (encodedTerm.equals(METAPHONE.encode(displayName))) {
                return displayName;
            }

            for (String keyword : getKeywords()) {
View Full Code Here

        public static String createMarkerHtml(State state, String name) {
            StringBuilder marker = new StringBuilder();

            marker.append("<span style=\"display: none;\"");

            ObjectType type = state.getType();

            if (type != null) {
                ObjectField field = type.getField(name);

                if (field != null) {
                    String fieldType = field.getInternalType();

                    if (ObjectField.TEXT_TYPE.equals(fieldType)) {
View Full Code Here

            Template template = objectState.as(ObjectModification.class).getDefault();
            if (template != null && Site.Static.isObjectAccessible(site, template)) {
                return template;
            }

            ObjectType objectType = objectState.getType();
            List<Template> usable = new ArrayList<Template>();

            for (Template t : Query.from(Template.class).sortAscending("name").selectAll()) {
                if (Site.Static.isObjectAccessible(site, t) &&
                        t.getContentTypes().contains(objectType)) {
View Full Code Here

            List<Template> templates = new ArrayList<Template>();

            if (object != null) {
                State state = State.getInstance(object);
                Site owner = state.as(Site.ObjectModification.class).getOwner();
                ObjectType type = state.getType();

                for (Template template : Query.from(Template.class).sortAscending("name").selectAll()) {
                    if (template.getContentTypes().contains(type) &&
                            (owner == null ||
                            Site.Static.isObjectAccessible(owner, template))) {
View Full Code Here

        if (object == null) {
            return null;
        }

        State state = State.getInstance(object);
        ObjectType type = state.getType();

        if (type != null) {
            for (ObjectField field : type.getFields()) {
                if (field.as(ToolUi.class).isRichText()) {
                    String fieldName = field.getInternalName();
                    Object value = state.get(fieldName);

                    if (value instanceof String) {
View Full Code Here

TOP

Related Classes of com.psddev.dari.db.ObjectType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.