Package org.socialmusicdiscovery.server.support.format

Examples of org.socialmusicdiscovery.server.support.format.TitleFormat


                    resultItem = new ResultItem<T>(item, getPlayable(), childCounters);
                } else {
                    resultItem = new ResultItem<T>(item, getPlayable(), false);
                }
                if(format!=null) {
                    resultItem.setName(new TitleFormat(format).format(item));
                }
                resultItem.setType(objectType);
                resultItem.setId(resultItem.getType()+":"+item.getId());
                if(sortKeyProvider !=null) {
                    resultItem.setSortKey(sortKeyProvider.getSortKey(item));
View Full Code Here


                        while (criteriasForThisLevel.size() > ((MenuLevelDynamic)requestedObjectType).getCriteriaDepth()) {
                            criteriasForThisLevel.remove(0);
                        }
                    }

                    TitleFormat parser = null;
                    if(((MenuLevelDynamic)requestedObjectType).getFormat()!=null) {
                        parser = new TitleFormat(((MenuLevelDynamic)requestedObjectType).getFormat());
                    }

                    // Lookup and call browse service
                    BrowseService browseService = browseServiceManager.getBrowseService(requestedMainObjectType);
                    browseResult = browseService.findChildren(criteriasForThisLevel, new ArrayList<String>(), firstItem, maxItems, counts);

                    if (maxItems == null || maxItems >0) {
                        // Iterate through browse service result and create appropriate items
                        Collection<ResultItem> browseResultItems = browseResult.getItems();
                        for (ResultItem item : browseResultItems) {
                            String id;
                            if (item.getItem() instanceof SMDIdentity) {
                                id = requestedObjectType.getType() + ":" + ((SMDIdentity) item.getItem()).getId();
                            } else {
                                id = requestedObjectType.getType() + ":" + item.getItem().toString();
                            }
                            item.setId(id);
                            item.setType(requestedMainObjectType);
                            if(parser != null) {
                                item.setName(requestedObjectType.getDisplayName()+parser.format(item.getItem()));
                            }else {
                                item.setName(requestedObjectType.getDisplayName()+item.getItem().toString());
                            }
                            item.setPlayable(requestedObjectType.isPlayable());
                            item.setLeaf(requestedObjectType.getChildLevels() == null);
View Full Code Here

                    ResultItem currentItem = browseService.findById(currentId.substring(currentId.indexOf(":") + 1));
                    if (currentItem != null) {
                        if (currentItem.getName() == null) {
                            String format = browseMenuManager.getDefaultItemFormat(BrowseMenuManager.MenuType.CONTEXT, currentItem.getType());
                            if (format != null) {
                                currentItem.setName(new TitleFormat(format).format(currentItem.getItem()));
                            }
                        }
                        result.setContext(currentItem);
                    }
                }
View Full Code Here

        private String id;
        private String name;

        public TableViewItem(String id, String name, Object item) {
            this.id = id;
            this.name = new TitleFormat(name).format(item);
        }
View Full Code Here

TOP

Related Classes of org.socialmusicdiscovery.server.support.format.TitleFormat

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.