/** * Constructs a new {@code BeanModuleDescriptor} instance. * * @param name * the name of the descriptor (the actual module class name). * @param moduleObjectReferencedDescriptor * the component descriptor of the module objects. */ protected BeanCollectionModuleDescriptor(String name, IComponentDescriptor<?> moduleObjectReferencedDescriptor) { super(name); BasicListDescriptor<Object> moduleObjectsListDescriptor = new BasicListDescriptor<>(); moduleObjectsListDescriptor .setElementDescriptor(moduleObjectReferencedDescriptor); BasicCollectionPropertyDescriptor<Object> moduleObjectsDescriptor = new BasicCollectionPropertyDescriptor<>(); moduleObjectsDescriptor .setReferencedDescriptor(moduleObjectsListDescriptor); moduleObjectsDescriptor.setName(BeanCollectionModule.MODULE_OBJECTS); List<IPropertyDescriptor> propertyDescriptors = new ArrayList<>( getPropertyDescriptors()); propertyDescriptors.add(moduleObjectsDescriptor); setPropertyDescriptors(propertyDescriptors); }
queryDescriptor.setName(defaultQueryDescriptor.getName()); queryDescriptor.setI18nNameKey(defaultQueryDescriptor.getI18nNameKey()); queryDescriptor.setDescription(defaultQueryDescriptor.getDescription()); queryDescriptor.setGrantedRoles(defaultQueryDescriptor.getGrantedRoles()); queryDescriptor.setMandatory(defaultQueryDescriptor.isMandatory()); queryDescriptor.setReadabilityGates(defaultQueryDescriptor .getReadabilityGates()); queryDescriptor.setReadOnly(defaultQueryDescriptor.isReadOnly()); queryDescriptor.setSqlName(defaultQueryDescriptor.getSqlName()); queryDescriptor.setWritabilityGates(defaultQueryDescriptor .getWritabilityGates()); .getDelegateClassName()); queryDescriptor.setComputed(defaultQueryDescriptor.isComputed()); queryDescriptor.setReferencedDescriptor(getReferencedDescriptor() .getElementDescriptor().createQueryDescriptor()); return queryDescriptor;
moduleListDescriptor.setElementDescriptor(this); BasicCollectionPropertyDescriptor<Module> subModulesDescriptor = new BasicCollectionPropertyDescriptor<>(); subModulesDescriptor.setReferencedDescriptor(moduleListDescriptor); subModulesDescriptor.setName(Module.SUB_MODULES); subModulesDescriptor.setReverseRelationEnd(parentDescriptor);
BasicCollectionPropertyDescriptor<IComponent> translationsPropertyDescriptor = getComponentTranslationsDescriptorTemplate() .clone(); translationsPropertyDescriptor.setSqlName("T"); BasicCollectionDescriptor<IComponent> translationsCollectionDescriptor = (BasicCollectionDescriptor<IComponent>) ((BasicCollectionDescriptor<IComponent>) translationsPropertyDescriptor .getReferencedDescriptor()).clone(); BasicComponentDescriptor<IComponent> translationDescriptor = (BasicComponentDescriptor<IComponent>) ( (BasicComponentDescriptor<IComponent>) translationsCollectionDescriptor .getElementDescriptor()).clone(); translationsPropertyDescriptor.setReferencedDescriptor(translationsCollectionDescriptor); translationsCollectionDescriptor.setElementDescriptor(translationDescriptor); translationDescriptor.setName(getName() + "$Translation"); propertyDescriptorsMap.put(translationsPropertyDescriptor.getName(), translationsPropertyDescriptor);
/** * {@inheritDoc} */ @SuppressWarnings("unchecked") public ITreeLevelDescriptor getRootSubtreeDescriptor() { if (rootSubtreeDescriptor == null) { BasicCollectionDescriptor<Object> fakeCollDescriptor = new BasicCollectionDescriptor<Object>(); fakeCollDescriptor .setElementDescriptor((IComponentDescriptor<Object>) getModelDescriptor()); BasicCollectionPropertyDescriptor<Object> fakeCollPropDescriptor = new BasicCollectionPropertyDescriptor<Object>(); fakeCollPropDescriptor.setReferencedDescriptor(fakeCollDescriptor); BasicListViewDescriptor fakeListViewDescriptor = new BasicListViewDescriptor(); fakeListViewDescriptor.setRenderedProperty(renderedProperty); fakeListViewDescriptor.setModelDescriptor(fakeCollPropDescriptor); rootSubtreeDescriptor = new BasicSimpleTreeLevelDescriptor(); ((BasicSimpleTreeLevelDescriptor) rootSubtreeDescriptor) .setNodeGroupDescriptor(fakeListViewDescriptor); ((BasicSimpleTreeLevelDescriptor) rootSubtreeDescriptor) .setChildDescriptor(childDescriptor); } return rootSubtreeDescriptor; }
@SuppressWarnings("rawtypes") private Map<String, IComponentDescriptor<?>> buildContractNameIdMap() { Map<String, IComponentDescriptor<?>> map = new HashMap<>(); Map<String, IComponentDescriptor> idToComponentDescriptors = componentApplicationContext.getBeansOfType( IComponentDescriptor.class, false, false); for (Map.Entry<String, IComponentDescriptor> descriptorEntry : idToComponentDescriptors.entrySet()) { IComponentDescriptor componentDescriptor = descriptorEntry.getValue(); if (componentDescriptor.getComponentContract() != null) { map.put(componentDescriptor.getComponentContract().getName(), componentDescriptor); if (componentDescriptor.isTranslatable()) { ICollectionPropertyDescriptor<?> collectionPropertyDescriptor = (ICollectionPropertyDescriptor<?>) componentDescriptor .getPropertyDescriptor(AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate().getName()); if (collectionPropertyDescriptor != null) { IComponentDescriptor<?> translationComponentDescriptor = collectionPropertyDescriptor .getReferencedDescriptor().getElementDescriptor(); if (translationComponentDescriptor.getComponentContract() != null) { map.put(translationComponentDescriptor.getComponentContract().getName(), translationComponentDescriptor); } } } } } map.put(BasicDescriptorDescriptor.INSTANCE.getName(), BasicDescriptorDescriptor.INSTANCE); return map; } }
moduleListDescriptor.setElementDescriptor(this); BasicCollectionPropertyDescriptor<Module> subModulesDescriptor = new BasicCollectionPropertyDescriptor<Module>(); subModulesDescriptor.setReferencedDescriptor(moduleListDescriptor); subModulesDescriptor.setName("subModules"); subModulesDescriptor.setReverseRelationEnd(parentDescriptor);
AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate().getName()); if (translations != null && isInitialized(translations)) { String sessionLanguage = locale.getLanguage();
/** * {@inheritDoc} */ @Override protected Collection<IPropertyDescriptor> getExtraPropertyDescriptors() { Collection<IPropertyDescriptor> extraPropertyDescriptors = new ArrayList<>(); BasicListDescriptor<IComponent> queriedEntitiesCollectionDescriptor = new BasicListDescriptor<>(); queriedEntitiesCollectionDescriptor.setElementDescriptor(getQueriedComponentsDescriptor()); queriedEntitiesCollectionDescriptor.setName(IQueryComponent.QUERIED_COMPONENTS); queriedEntitiesCollectionDescriptor.setDescription("queriedEntities.description"); BasicCollectionPropertyDescriptor<IComponent> qCPDescriptor = new BasicCollectionPropertyDescriptor<>(); qCPDescriptor.setName(IQueryComponent.QUERIED_COMPONENTS); qCPDescriptor.setReferencedDescriptor(queriedEntitiesCollectionDescriptor); extraPropertyDescriptors.add(qCPDescriptor); return extraPropertyDescriptors; }
Set<IPropertyTranslation> translations; String translationsPropertyName = AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate() .getName();
/** * Constructs a new <code>BeanModuleDescriptor</code> instance. * * @param name * the name of the descriptor (the actual module class name). * @param moduleObjectReferencedDescriptor * the component descriptor of the module objects. */ protected BeanCollectionModuleDescriptor(String name, IComponentDescriptor<Object> moduleObjectReferencedDescriptor) { super(name); BasicCollectionDescriptor<Object> moduleObjectsListDescriptor = new BasicCollectionDescriptor<Object>(); moduleObjectsListDescriptor.setCollectionInterface(List.class); moduleObjectsListDescriptor .setElementDescriptor(moduleObjectReferencedDescriptor); BasicCollectionPropertyDescriptor<Object> moduleObjectsDescriptor = new BasicCollectionPropertyDescriptor<Object>(); moduleObjectsDescriptor .setReferencedDescriptor(moduleObjectsListDescriptor); moduleObjectsDescriptor.setName("moduleObjects"); List<IPropertyDescriptor> propertyDescriptors = new ArrayList<IPropertyDescriptor>( getPropertyDescriptors()); propertyDescriptors.add(moduleObjectsDescriptor); setPropertyDescriptors(propertyDescriptors); }
componentDescriptor, aQueryComponent, context)); } else { String translationsPath = AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate().getName(); String translationsAlias = currentCriteria.getAlias() + "__" + componentDescriptor.getComponentContract().getSimpleName() + "__"
private IViewDescriptor createResultViewDescriptor( IComponentDescriptor<Object> entityDescriptor) { BasicTableViewDescriptor resultViewDescriptor = new BasicTableViewDescriptor(); BasicCollectionDescriptor<Object> queriedEntitiesListDescriptor = new BasicCollectionDescriptor<Object>(); queriedEntitiesListDescriptor.setCollectionInterface(List.class); queriedEntitiesListDescriptor.setElementDescriptor(entityDescriptor); BasicCollectionPropertyDescriptor<Object> queriedEntitiesDescriptor = new BasicCollectionPropertyDescriptor<Object>(); queriedEntitiesDescriptor .setReferencedDescriptor(queriedEntitiesListDescriptor); queriedEntitiesDescriptor.setName(IQueryComponent.QUERIED_COMPONENTS); resultViewDescriptor.setModelDescriptor(queriedEntitiesDescriptor); resultViewDescriptor.setReadOnly(true); return resultViewDescriptor; }
componentDescriptor, aQueryComponent, context)); } else { String translationsPath = AbstractComponentDescriptor.getComponentTranslationsDescriptorTemplate().getName(); for (Map.Entry<String, Object> property : aQueryComponent.entrySet()) { String propertyName = property.getKey();
.setElementDescriptor(ModuleDescriptor.MODULE_DESCRIPTOR); BasicCollectionPropertyDescriptor<Module> modulesDescriptor = new BasicCollectionPropertyDescriptor<>(); modulesDescriptor.setReferencedDescriptor(moduleListDescriptor); modulesDescriptor.setName(Workspace.MODULES);
moduleListDescriptor.setElementDescriptor(ModuleDescriptor.MODULE_DESCRIPTOR); BasicCollectionPropertyDescriptor<Module> modulesDescriptor = new BasicCollectionPropertyDescriptor<Module>(); modulesDescriptor.setReferencedDescriptor(moduleListDescriptor); modulesDescriptor.setName("modules");
enumerationValuesPropertyDescriptor = new BasicCollectionPropertyDescriptor<>(); enumerationValuesPropertyDescriptor.setName(ENUMERATION_VALUES); enumerationValuesPropertyDescriptor.setReferencedDescriptor(enumValuesReferencedDescriptor); selectedEnumerationValuesPropertyDescriptor = new BasicCollectionPropertyDescriptor<>(); selectedEnumerationValuesPropertyDescriptor.setName(SELECTED_ENUMERATION_VALUES); selectedEnumerationValuesPropertyDescriptor.setReferencedDescriptor(enumValuesReferencedDescriptor);