Skip to content

Commit

Permalink
Merge branch 'master' into Pegas-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrGasparik committed Jun 25, 2015
2 parents 8b3d74b + d9c8ca4 commit 0ccb055
Show file tree
Hide file tree
Showing 37 changed files with 535 additions and 93 deletions.
Expand Up @@ -75,7 +75,9 @@ pageTasks.category.LiveSynchronization=Live synchronization
pageTasks.category.Reconciliation=Reconciliation
pageTasks.category.Report=Report
pageTasks.category.System=System
#legacy
pageTasks.category.UserRecomputation=User recomputation
pageTasks.category.Recomputation=Recomputation
pageTasks.category.Workflow=Workflow
pageTasks.category.null=(undefined)
pageTasks.runsContinually=runs continually
Expand Up @@ -11,7 +11,9 @@ pageTask.category.ImportFromFile=Import from file
pageTask.category.ImportingAccounts=Importing accounts
pageTask.category.LiveSynchronization=Live synchronization
pageTask.category.Reconciliation=Reconciliation
#legacy
pageTask.category.UserRecomputation=User recomputation
pageTask.category.Recomputation=Recomputation
pageTask.category.Workflow=Workflow
pageTask.createSuspended=Create in SUSPENDED state
pageTask.cronHelp=Cron-like specification is in the form\: SECONDS MINUTES HOURS DAY-OF-MONTH MONTH DAY-OF-WEEK YEAR (optional), e.g. '0 0 12 ? * WED' which means 'every Wednesday at 12\:00\:00 pm'.
Expand Down
Expand Up @@ -36,6 +36,7 @@ pageTasks.button.stopScheduler=Stop scheduler
pageTasks.button.stopSchedulerAndTasks=Stop scheduler + tasks
pageTasks.button.suspendTask=Suspend
pageTasks.button.synchronizeTasks=Synchronize tasks
pageTasks.button.refreshTasks=Refresh tasks
pageTasks.category=Category
pageTasks.diagnostics=Diagnostics
pageTasks.in=in {0}
Expand Down
Expand Up @@ -76,7 +76,9 @@ pageTasks.category.LiveSynchronization=Sincronización en vivo
pageTasks.category.Reconciliation=Reconciliación
pageTasks.category.Report=Informe
pageTasks.category.System=Sistema
#legacy
pageTasks.category.UserRecomputation=Recomputación de usuario
pageTasks.category.Recomputation=Recomputación
pageTasks.category.Workflow=Workflow
pageTasks.category.null=(undefined)
pageTasks.runsContinually=ejecutar continuamente
Expand Up @@ -11,7 +11,9 @@ pageTask.category.ImportFromFile=Importar desde fichero
pageTask.category.ImportingAccounts=Importando cuentas
pageTask.category.LiveSynchronization=Sincronización en vivo
pageTask.category.Reconciliation=Reconciliación
#legacy
pageTask.category.UserRecomputation=Recomputación de usuario
pageTask.category.Recomputation=Recomputación
pageTask.category.Workflow=Workflow
pageTask.createSuspended=Crear en estado SUSPENDIDO
pageTask.cronHelp=Especificación de Cron es en la forma \: SEGUNDOS MINUTOS HORAS DIA-DE-MES MES DIA DE SEMANA AÑO (opcional), por ejemplo, '0 0 12? * WED "significa" todos los miércoles a las 12 \: 00 \: 00 pm ".
Expand Down
Expand Up @@ -20,6 +20,7 @@ pageTasks.button.stopScheduler=Detener programador
pageTasks.button.stopSchedulerAndTasks=Detener programador + tareas
pageTasks.button.suspendTask=Suspender
pageTasks.button.synchronizeTasks=Sincronizar tareas
pageTasks.button.refreshTasks=Refrescar tareas
pageTasks.category=Categoría
pageTasks.in=en {0}
pageTasks.inForNotRunningTasks=(en {0})
Expand Down
Expand Up @@ -75,7 +75,9 @@ pageTasks.category.LiveSynchronization=Live synchronization
pageTasks.category.Reconciliation=Reconciliation
pageTasks.category.Report=Report
pageTasks.category.System=System
#legacy
pageTasks.category.UserRecomputation=User recomputation
pageTasks.category.Recomputation=Recomputation
pageTasks.category.Workflow=Workflow
pageTasks.category.null=(undefined)
pageTasks.runsContinually=runs continually
Expand Up @@ -10,7 +10,9 @@ pageTask.category.ImportFromFile=Import from file
pageTask.category.ImportingAccounts=Importing accounts
pageTask.category.LiveSynchronization=Live synchronization
pageTask.category.Reconciliation=Reconciliation
#legacy
pageTask.category.UserRecomputation=User recomputation
pageTask.category.Recomputation=Recomputation
pageTask.category.Workflow=Workflow
pageTask.createSuspended=Create in SUSPENDED state
pageTask.cronHelp=Cron-like specification is in the form\: SECONDS MINUTES HOURS DAY-OF-MONTH MONTH DAY-OF-WEEK YEAR (optional), e.g. '0 0 12 ? * WED' which means 'every Wednesday at 12\:00\:00 pm'.
Expand Down
Expand Up @@ -22,6 +22,7 @@ pageTasks.button.stopScheduler=Stop scheduler
pageTasks.button.stopSchedulerAndTasks=Stop scheduler + tasks
pageTasks.button.suspendTask=Suspend
pageTasks.button.synchronizeTasks=Synchronize tasks
pageTasks.button.refreshTasks=Refresh tasks
pageTasks.category=Category\:
pageTasks.diagnostics=Diagnostics
pageTasks.in=in {0}
Expand Down
Expand Up @@ -75,7 +75,9 @@ pageTasks.category.LiveSynchronization=Canlı eşzamanlama
pageTasks.category.Reconciliation=Hesap Eşleme
pageTasks.category.Report=Rapor
pageTasks.category.System=Sistem
pageTasks.category.UserRecomputation=User recomputation
#legacy
pageTasks.category.UserRecomputation=Kullanıcıyı yeniden hesapla
pageTasks.category.Recomputation=Yeniden hesapla
pageTasks.category.Workflow=İş akışı
pageTasks.category.null=(belirsiz)
pageTasks.runsContinually=Aralıksız çalıştır
Expand Up @@ -40,7 +40,9 @@ pageTask.category.ImportingAccounts=Hesapları içe aktar
pageTask.category.LiveSynchronization=Canlı senkronizasyon
pageTask.category.BulkActions=Toplu eylemler
pageTask.category.Reconciliation=Hesap eşleme
#legacy
pageTask.category.UserRecomputation=Kullanıcıyı yeniden hesapla
pageTask.category.Recomputation=Yeniden hesapla
pageTask.category.Workflow=İş akışı

pageTask.cronHelpLinkTutorial=alıştırma
Expand Down
Expand Up @@ -48,6 +48,7 @@ pageTasks.button.stopScheduler=Zamanlayıcıyı durdur
pageTasks.button.stopSchedulerAndTasks=Zamanlayıcı ve görevleri durdur
pageTasks.button.suspendTask=Duraklat
pageTasks.button.synchronizeTasks=Görevleri senkronize et
pageTasks.button.refreshTasks=Yenileme görevler
pageTasks.category=Kategori
pageTasks.diagnostics=Tanı
pageTasks.in={0} içinde
Expand Down
Expand Up @@ -71,7 +71,9 @@ pageTasks.category.ImportFromFile=Import from file
pageTasks.category.ImportingAccounts=Importing accounts
pageTasks.category.LiveSynchronization=Live synchronization
pageTasks.category.Reconciliation=Reconciliation
#legacy
pageTasks.category.UserRecomputation=User recomputation
pageTasks.category.Recomputation=Recomputation
pageTasks.category.Workflow=Workflow
pageTasks.category.Cleanup=Cleanup
pageTasks.category.System=System
Expand Down
Expand Up @@ -537,7 +537,7 @@ private List<String> createCategoryList() {
categories.add(TaskCategory.LIVE_SYNCHRONIZATION);
categories.add(TaskCategory.RECONCILIATION);
categories.add(TaskCategory.IMPORTING_ACCOUNTS);
categories.add(TaskCategory.USER_RECOMPUTATION);
categories.add(TaskCategory.RECOMPUTATION);
categories.add(TaskCategory.DEMO);
return categories;
}
Expand Down
Expand Up @@ -43,7 +43,9 @@ pageTask.category.ImportingAccounts=Importing accounts
pageTask.category.LiveSynchronization=Live synchronization
pageTask.category.BulkActions=Bulk actions
pageTask.category.Reconciliation=Reconciliation
#legacy
pageTask.category.UserRecomputation=User recomputation
pageTask.category.Recomputation=Recomputation
pageTask.category.Workflow=Workflow
pageTask.cronHelpLink=For more information, please see
pageTask.cronHelpLinkTutorial=tutorial
Expand Down
Expand Up @@ -600,7 +600,7 @@ public boolean isVisible() {
TaskDto dto = model.getObject();
return TaskCategory.RECONCILIATION.equals(dto.getCategory()) ||
TaskCategory.IMPORTING_ACCOUNTS.equals(dto.getCategory()) ||
TaskCategory.USER_RECOMPUTATION.equals(dto.getCategory());
TaskCategory.RECOMPUTATION.equals(dto.getCategory());
}
});

Expand Down
Expand Up @@ -53,6 +53,7 @@ <h3><wicket:message key="pageTasks.nodes"/></h3>
<a class="btn btn-danger" wicket:id="deactivateServiceThreads"/>
<a class="btn btn-success" wicket:id="reactivateServiceThreads"/>
<a class="btn btn-default" wicket:id="synchronizeTasks"/>
<a class="btn btn-default" wicket:id="refreshTasks"/>
</div>
</wicket:extend>
</body>
Expand Down
Expand Up @@ -94,6 +94,7 @@ public class PageTasks extends PageAdminTasks {
private static final String OPERATION_DEACTIVATE_SERVICE_THREADS = DOT_CLASS + "deactivateServiceThreads";
private static final String OPERATION_REACTIVATE_SERVICE_THREADS = DOT_CLASS + "reactivateServiceThreads";
private static final String OPERATION_SYNCHRONIZE_TASKS = DOT_CLASS + "synchronizeTasks";
private static final String OPERATION_REFRESH_TASKS = DOT_CLASS + "refreshTasks";
private static final String ALL_CATEGORIES = "";

public static final long WAIT_FOR_TASK_STOP = 2000L;
Expand Down Expand Up @@ -727,6 +728,18 @@ public void onClick(AjaxRequestTarget target) {
}
};
add(synchronize);

// adding Refresh button
AjaxButton refresh = new AjaxButton("refreshTasks",
createStringResource("pageTasks.button.refreshTasks")) {

@Override
public void onClick(AjaxRequestTarget target) {
refreshTasks(target);
}
};

add(refresh);
}

private TablePanel getTaskTable() {
Expand Down Expand Up @@ -1067,6 +1080,21 @@ private void synchronizeTasksPerformed(AjaxRequestTarget target) {
}
//endregion

private void refreshTasks(AjaxRequestTarget target) {
searchModel = new LoadableModel<TasksSearchDto>(false) {

@Override
protected TasksSearchDto load() {
return loadTasksSearchDto();
}
};

//refresh feedback and table
target.add(getFeedbackPanel());
target.add(getTaskTable());
target.add(getNodeTable());
}

private void searchFilterPerformed(AjaxRequestTarget target) {
TasksSearchDto dto = searchModel.getObject();

Expand Down
Expand Up @@ -49,6 +49,7 @@ pageTasks.button.scheduleTask=Run now
pageTasks.button.deactivateServiceThreads=Stop all threads
pageTasks.button.reactivateServiceThreads=Start all threads
pageTasks.button.synchronizeTasks=Synchronize tasks
pageTasks.button.refreshTasks=Refresh tasks

pageTasks.unknownRefName=Unknown object
pageTasks.now=now
Expand Down
Expand Up @@ -616,6 +616,11 @@ public void parseAssociations(RefinedResourceSchema rSchema) {
public ResourceObjectReferenceType getBaseContext() {
return refinedObjectClassDefinition.getBaseContext();
}

@Override
public Collection<RefinedObjectClassDefinition> getAuxiliaryObjectClassDefinitions() {
return refinedObjectClassDefinition.getAuxiliaryObjectClassDefinitions();
}

@Override
protected String debugDump(int indent, LayerType layer) {
Expand Down
Expand Up @@ -595,35 +595,6 @@ private static RefinedObjectClassDefinition parseRefinedObjectClass(ResourceObje
rOcDef.setBaseContext(schemaHandlingObjDefType.getBaseContext());
}

for (ResourceAttributeDefinition road : objectClassDef.getAttributeDefinitions()) {
String attrContextDescription = road.getName() + ", in " + contextDescription;
ResourceAttributeDefinitionType attrDefType = findAttributeDefinitionType(road.getName(), schemaHandlingObjDefType,
typeDesc, attrContextDescription);
// We MUST NOT skip ignored attribute definitions here. We must include them in the schema as
// the shadows will still have that attributes and we will need their type definition to work
// well with them. They may also be mandatory. We cannot pretend that they do not exist.

RefinedAttributeDefinition rAttrDef = RefinedAttributeDefinition.parse(road, attrDefType, objectClassDef,
prismContext, "in "+typeDesc+" type " + intent + ", in " + contextDescription);
rOcDef.processIdentifiers(rAttrDef, objectClassDef);

if (rOcDef.containsAttributeDefinition(rAttrDef.getName())) {
throw new SchemaException("Duplicate definition of attribute " + rAttrDef.getName() + " in "+typeDesc+" type " +
intent + ", in " + contextDescription);
}
rOcDef.add(rAttrDef);

}

// Check for extra attribute definitions in the account type
for (ResourceAttributeDefinitionType attrDefType : schemaHandlingObjDefType.getAttribute()) {
if (!rOcDef.containsAttributeDefinition(attrDefType.getRef()) && !RefinedAttributeDefinition.isIgnored(attrDefType)) {
throw new SchemaException("Definition of attribute " + attrDefType.getRef() + " not found in object class " + objectClassDef.getTypeName() + " as defined in " + contextDescription);
}
}

parseProtected(rOcDef, schemaHandlingObjDefType);

return rOcDef;
}

Expand Down Expand Up @@ -655,6 +626,63 @@ public void parseAuxiliaryObjectClasses(RefinedResourceSchema rSchema) throws Sc
}
}

public void parseAttributes(RefinedResourceSchema rSchema, String contextDescription) throws SchemaException {
if (schemaHandlingObjectTypeDefinitionType == null) {
// this is definition from schema. We already have all we need.
return;
}

parseAttributesFrom(rSchema, objectClassDefinition, false, contextDescription);
if (auxiliaryObjectClassDefinitions != null) {
for (RefinedObjectClassDefinition auxiliaryObjectClassDefinition: auxiliaryObjectClassDefinitions) {
parseAttributesFrom(rSchema, auxiliaryObjectClassDefinition, true, contextDescription);
}
}

// Check for extra attribute definitions in the account type
for (ResourceAttributeDefinitionType attrDefType : schemaHandlingObjectTypeDefinitionType.getAttribute()) {
if (!containsAttributeDefinition(attrDefType.getRef()) && !RefinedAttributeDefinition.isIgnored(attrDefType)) {
throw new SchemaException("Definition of attribute " + attrDefType.getRef() + " not found in object class " + objectClassDefinition.getTypeName() + " as defined in " + contextDescription);
}
}

parseProtected(this, schemaHandlingObjectTypeDefinitionType);
}

public void parseAttributesFrom(RefinedResourceSchema rSchema, ObjectClassComplexTypeDefinition ocDef, boolean auxiliary, String contextDescription) throws SchemaException {
if (schemaHandlingObjectTypeDefinitionType == null) {
// this is definition from schema. We already have all we need.
return;
}
for (ResourceAttributeDefinition road : ocDef.getAttributeDefinitions()) {
String attrContextDescription = road.getName() + ", in " + contextDescription;
ResourceAttributeDefinitionType attrDefType = findAttributeDefinitionType(road.getName(), schemaHandlingObjectTypeDefinitionType,
attrContextDescription);
// We MUST NOT skip ignored attribute definitions here. We must include them in the schema as
// the shadows will still have that attributes and we will need their type definition to work
// well with them. They may also be mandatory. We cannot pretend that they do not exist.

RefinedAttributeDefinition rAttrDef = RefinedAttributeDefinition.parse(road, attrDefType, ocDef,
prismContext, "in "+kind+" type " + intent + ", in " + contextDescription);
if (!auxiliary) {
processIdentifiers(rAttrDef, ocDef);
}

if (containsAttributeDefinition(rAttrDef.getName())) {
if (auxiliary) {
continue;
} else {
throw new SchemaException("Duplicate definition of attribute " + rAttrDef.getName() + " in "+kind+" type " +
intent + ", in " + contextDescription);
}
}
add(rAttrDef);

}


}

private void processIdentifiers(RefinedAttributeDefinition rAttrDef, ObjectClassComplexTypeDefinition objectClassDef) {
QName attrName = rAttrDef.getName();
if (objectClassDef.isIdentifier(attrName)) {
Expand All @@ -670,8 +698,8 @@ private RefinedAttributeDefinition substituteRefinedAttributeDefinition(Resource
return rAttrDef;
}

private static ResourceAttributeDefinitionType findAttributeDefinitionType(QName attrName,
ResourceObjectTypeDefinitionType rOcDefType, String typeDesc, String contextDescription) throws SchemaException {
private ResourceAttributeDefinitionType findAttributeDefinitionType(QName attrName,
ResourceObjectTypeDefinitionType rOcDefType, String contextDescription) throws SchemaException {
ResourceAttributeDefinitionType foundAttrDefType = null;
for (ResourceAttributeDefinitionType attrDefType : rOcDefType.getAttribute()) {
if (attrDefType.getRef() != null) {
Expand All @@ -680,7 +708,7 @@ private static ResourceAttributeDefinitionType findAttributeDefinitionType(QName
if (foundAttrDefType == null) {
foundAttrDefType = attrDefType;
} else {
throw new SchemaException("Duplicate definition of attribute " + ref + " in "+typeDesc+" type "
throw new SchemaException("Duplicate definition of attribute " + ref + " in "+kind+" type "
+ rOcDefType.getIntent() + ", in " + contextDescription);
}
}
Expand Down
Expand Up @@ -404,16 +404,17 @@ public static RefinedResourceSchema parse(ResourceType resourceType, PrismContex
return null;
}

String contextDescription = "definition of "+resourceType;

RefinedResourceSchema rSchema = new RefinedResourceSchema(resourceType, originalResourceSchema, prismContext);

SchemaHandlingType schemaHandling = resourceType.getSchemaHandling();
if (schemaHandling != null) {
parseObjectTypeDefsFromSchemaHandling(rSchema, resourceType, schemaHandling,
schemaHandling.getObjectType(), null, prismContext, "definition of "+resourceType);
schemaHandling.getObjectType(), null, prismContext, contextDescription);
}

parseObjectTypesFromSchema(rSchema, resourceType, prismContext,
"definition of "+resourceType);
parseObjectTypesFromSchema(rSchema, resourceType, prismContext, contextDescription);

// We need to parse associations and auxiliary object classes in a second pass. We need to have all object classes parsed before correctly setting association
// targets
Expand All @@ -422,6 +423,11 @@ public static RefinedResourceSchema parse(ResourceType resourceType, PrismContex
rOcDef.parseAuxiliaryObjectClasses(rSchema);
}

// We can parse attributes only after we have all the object class info parsed (including auxiliary object classes)
for (RefinedObjectClassDefinition rOcDef: rSchema.getRefinedDefinitions()) {
rOcDef.parseAttributes(rSchema, contextDescription);
}

return rSchema;
}

Expand Down

0 comments on commit 0ccb055

Please sign in to comment.