id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
109,500 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/cache/TransactionalCache.java | TransactionalCache.get | public Object get(Id id, Mode mode) {
Object value = writeCache.get(id);
if (value == null) {
value = readCache.get(new CacheKey(id));
if (value != null && Mode.WRITE.equals(mode)) {
writeCache.put(id, value);
}
}
return value;
} | java | public Object get(Id id, Mode mode) {
Object value = writeCache.get(id);
if (value == null) {
value = readCache.get(new CacheKey(id));
if (value != null && Mode.WRITE.equals(mode)) {
writeCache.put(id, value);
}
}
return value;
} | [
"public",
"Object",
"get",
"(",
"Id",
"id",
",",
"Mode",
"mode",
")",
"{",
"Object",
"value",
"=",
"writeCache",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"readCache",
".",
"get",
"(",
"new",
"Cach... | Lookup an instance in the cache identified by its id.
@param id
The id.
@param mode
The mode.
@return The corresponding instance or <code>null</code> if no instance is
available. | [
"Lookup",
"an",
"instance",
"in",
"the",
"cache",
"identified",
"by",
"its",
"id",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/cache/TransactionalCache.java#L83-L92 |
109,501 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/cache/TransactionalCache.java | TransactionalCache.remove | public void remove(Id id) {
readCache.remove(new CacheKey(id));
writeCache.remove(id);
} | java | public void remove(Id id) {
readCache.remove(new CacheKey(id));
writeCache.remove(id);
} | [
"public",
"void",
"remove",
"(",
"Id",
"id",
")",
"{",
"readCache",
".",
"remove",
"(",
"new",
"CacheKey",
"(",
"id",
")",
")",
";",
"writeCache",
".",
"remove",
"(",
"id",
")",
";",
"}"
] | Removes an instance from the cache.
@param id
The id. | [
"Removes",
"an",
"instance",
"from",
"the",
"cache",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/cache/TransactionalCache.java#L100-L103 |
109,502 | buschmais/extended-objects | neo4j/remote/src/main/java/com/buschmais/xo/neo4j/remote/impl/datastore/RemoteDatastoreEntityManager.java | RemoteDatastoreEntityManager.initializeEntity | private void initializeEntity(Collection<? extends TypeMetadata> types, NodeState nodeState) {
for (TypeMetadata type : types) {
Collection<TypeMetadata> superTypes = type.getSuperTypes();
initializeEntity(superTypes, nodeState);
for (MethodMetadata<?, ?> methodMetadata : typ... | java | private void initializeEntity(Collection<? extends TypeMetadata> types, NodeState nodeState) {
for (TypeMetadata type : types) {
Collection<TypeMetadata> superTypes = type.getSuperTypes();
initializeEntity(superTypes, nodeState);
for (MethodMetadata<?, ?> methodMetadata : typ... | [
"private",
"void",
"initializeEntity",
"(",
"Collection",
"<",
"?",
"extends",
"TypeMetadata",
">",
"types",
",",
"NodeState",
"nodeState",
")",
"{",
"for",
"(",
"TypeMetadata",
"type",
":",
"types",
")",
"{",
"Collection",
"<",
"TypeMetadata",
">",
"superType... | Initializes all relation properties of the given node state with empty
collections.
@param types
The types.
@param nodeState
The state of the entity. | [
"Initializes",
"all",
"relation",
"properties",
"of",
"the",
"given",
"node",
"state",
"with",
"empty",
"collections",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/neo4j/remote/src/main/java/com/buschmais/xo/neo4j/remote/impl/datastore/RemoteDatastoreEntityManager.java#L106-L134 |
109,503 | buschmais/extended-objects | trace/src/main/java/com/buschmais/xo/trace/impl/TraceMonitor.java | TraceMonitor.log | public void log(String message) {
switch (level) {
case TRACE:
LOGGER.trace(message);
break;
case DEBUG:
LOGGER.debug(message);
break;
case INFO:
LOGGER.info(message);
break;
case WARN:
LOGGER.war... | java | public void log(String message) {
switch (level) {
case TRACE:
LOGGER.trace(message);
break;
case DEBUG:
LOGGER.debug(message);
break;
case INFO:
LOGGER.info(message);
break;
case WARN:
LOGGER.war... | [
"public",
"void",
"log",
"(",
"String",
"message",
")",
"{",
"switch",
"(",
"level",
")",
"{",
"case",
"TRACE",
":",
"LOGGER",
".",
"trace",
"(",
"message",
")",
";",
"break",
";",
"case",
"DEBUG",
":",
"LOGGER",
".",
"debug",
"(",
"message",
")",
... | Log a message using the configured log level.
@param message
The message. | [
"Log",
"a",
"message",
"using",
"the",
"configured",
"log",
"level",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/trace/src/main/java/com/buschmais/xo/trace/impl/TraceMonitor.java#L121-L141 |
109,504 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/query/XOQueryImpl.java | XOQueryImpl.convertParameter | private Object convertParameter(Object value) {
if (entityInstanceManager.isInstance(value)) {
return entityInstanceManager.getDatastoreType(value);
} else if (relationInstanceManager.isInstance(value)) {
return relationInstanceManager.getDatastoreType(value);
} else if (... | java | private Object convertParameter(Object value) {
if (entityInstanceManager.isInstance(value)) {
return entityInstanceManager.getDatastoreType(value);
} else if (relationInstanceManager.isInstance(value)) {
return relationInstanceManager.getDatastoreType(value);
} else if (... | [
"private",
"Object",
"convertParameter",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"entityInstanceManager",
".",
"isInstance",
"(",
"value",
")",
")",
"{",
"return",
"entityInstanceManager",
".",
"getDatastoreType",
"(",
"value",
")",
";",
"}",
"else",
"if"... | Converts the given parameter value to instances which can be passed to the
datastore.
@param value
The value.
@return The converted value. | [
"Converts",
"the",
"given",
"parameter",
"value",
"to",
"instances",
"which",
"can",
"be",
"passed",
"to",
"the",
"datastore",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/query/XOQueryImpl.java#L168-L182 |
109,505 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/plugin/PluginRepositoryManager.java | PluginRepositoryManager.getPluginManager | public <P extends PluginRepository<?, ?>> P getPluginManager(Class<?> pluginType) {
return (P) pluginRepositories.get(pluginType);
} | java | public <P extends PluginRepository<?, ?>> P getPluginManager(Class<?> pluginType) {
return (P) pluginRepositories.get(pluginType);
} | [
"public",
"<",
"P",
"extends",
"PluginRepository",
"<",
"?",
",",
"?",
">",
">",
"P",
"getPluginManager",
"(",
"Class",
"<",
"?",
">",
"pluginType",
")",
"{",
"return",
"(",
"P",
")",
"pluginRepositories",
".",
"get",
"(",
"pluginType",
")",
";",
"}"
] | Return a plugin repository identified by the plugin interface type.
@param pluginType
The plugin interface.
@param <P>
The plugin type
@return The {@link com.buschmais.xo.impl.plugin.PluginRepository}. | [
"Return",
"a",
"plugin",
"repository",
"identified",
"by",
"the",
"plugin",
"interface",
"type",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/plugin/PluginRepositoryManager.java#L44-L46 |
109,506 | buschmais/extended-objects | neo4j/spi/src/main/java/com/buschmais/xo/neo4j/spi/AbstractNeo4jDatastore.java | AbstractNeo4jDatastore.ensureIndex | private void ensureIndex(DS session, EntityTypeMetadata<NodeMetadata<L>> entityTypeMetadata,
IndexedPropertyMethodMetadata<IndexedPropertyMetadata> indexedProperty) {
if (indexedProperty != null) {
IndexedPropertyMetadata datastoreMetadata = indexedProperty.getDatastoreMetadata();
... | java | private void ensureIndex(DS session, EntityTypeMetadata<NodeMetadata<L>> entityTypeMetadata,
IndexedPropertyMethodMetadata<IndexedPropertyMetadata> indexedProperty) {
if (indexedProperty != null) {
IndexedPropertyMetadata datastoreMetadata = indexedProperty.getDatastoreMetadata();
... | [
"private",
"void",
"ensureIndex",
"(",
"DS",
"session",
",",
"EntityTypeMetadata",
"<",
"NodeMetadata",
"<",
"L",
">",
">",
"entityTypeMetadata",
",",
"IndexedPropertyMethodMetadata",
"<",
"IndexedPropertyMetadata",
">",
"indexedProperty",
")",
"{",
"if",
"(",
"inde... | Ensures that an index exists for the given entity and property.
@param entityTypeMetadata
The entity.
@param indexedProperty
The index metadata. | [
"Ensures",
"that",
"an",
"index",
"exists",
"for",
"the",
"given",
"entity",
"and",
"property",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/neo4j/spi/src/main/java/com/buschmais/xo/neo4j/spi/AbstractNeo4jDatastore.java#L56-L68 |
109,507 | buschmais/extended-objects | neo4j/spi/src/main/java/com/buschmais/xo/neo4j/spi/AbstractNeo4jDatastore.java | AbstractNeo4jDatastore.ensureIndex | private void ensureIndex(DS session, L label, PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata, boolean unique) {
PropertyMetadata propertyMetadata = propertyMethodMetadata.getDatastoreMetadata();
String statement;
if (unique) {
LOGGER.debug("Creating constrai... | java | private void ensureIndex(DS session, L label, PrimitivePropertyMethodMetadata<PropertyMetadata> propertyMethodMetadata, boolean unique) {
PropertyMetadata propertyMetadata = propertyMethodMetadata.getDatastoreMetadata();
String statement;
if (unique) {
LOGGER.debug("Creating constrai... | [
"private",
"void",
"ensureIndex",
"(",
"DS",
"session",
",",
"L",
"label",
",",
"PrimitivePropertyMethodMetadata",
"<",
"PropertyMetadata",
">",
"propertyMethodMetadata",
",",
"boolean",
"unique",
")",
"{",
"PropertyMetadata",
"propertyMetadata",
"=",
"propertyMethodMet... | Ensures that an index exists for the given label and property.
@param session
The datastore session
@param label
The label.
@param propertyMethodMetadata
The property metadata.
@param unique
if <code>true</code> create a unique constraint | [
"Ensures",
"that",
"an",
"index",
"exists",
"for",
"the",
"given",
"label",
"and",
"property",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/neo4j/spi/src/main/java/com/buschmais/xo/neo4j/spi/AbstractNeo4jDatastore.java#L82-L94 |
109,508 | buschmais/extended-objects | spi/src/main/java/com/buschmais/xo/spi/datastore/DynamicType.java | DynamicType.getCompositeType | public CompositeType getCompositeType() {
return CompositeTypeBuilder.create(CompositeObject.class, metadata, typeMetadata -> typeMetadata.getAnnotatedType().getAnnotatedElement());
} | java | public CompositeType getCompositeType() {
return CompositeTypeBuilder.create(CompositeObject.class, metadata, typeMetadata -> typeMetadata.getAnnotatedType().getAnnotatedElement());
} | [
"public",
"CompositeType",
"getCompositeType",
"(",
")",
"{",
"return",
"CompositeTypeBuilder",
".",
"create",
"(",
"CompositeObject",
".",
"class",
",",
"metadata",
",",
"typeMetadata",
"->",
"typeMetadata",
".",
"getAnnotatedType",
"(",
")",
".",
"getAnnotatedElem... | Convert this set into a composite type.
@return The composite type. | [
"Convert",
"this",
"set",
"into",
"a",
"composite",
"type",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/spi/src/main/java/com/buschmais/xo/spi/datastore/DynamicType.java#L43-L45 |
109,509 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java | InstanceListenerService.registerInstanceListener | public void registerInstanceListener(Object instanceListener) {
for (Method method : instanceListener.getClass().getMethods()) {
evaluateMethod(instanceListener, PostCreate.class, method, postCreateMethods);
evaluateMethod(instanceListener, PreUpdate.class, method, preUpdateMethods);
... | java | public void registerInstanceListener(Object instanceListener) {
for (Method method : instanceListener.getClass().getMethods()) {
evaluateMethod(instanceListener, PostCreate.class, method, postCreateMethods);
evaluateMethod(instanceListener, PreUpdate.class, method, preUpdateMethods);
... | [
"public",
"void",
"registerInstanceListener",
"(",
"Object",
"instanceListener",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"instanceListener",
".",
"getClass",
"(",
")",
".",
"getMethods",
"(",
")",
")",
"{",
"evaluateMethod",
"(",
"instanceListener",
",",
... | Add an instance listener instance.
@param instanceListener
The instance listener instance. | [
"Add",
"an",
"instance",
"listener",
"instance",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java#L121-L130 |
109,510 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java | InstanceListenerService.evaluateMethod | private void evaluateMethod(Object listener, Class<? extends Annotation> annotation, Method method, Map<Object, Set<Method>> methods) {
if (method.isAnnotationPresent(annotation)) {
if (method.getParameterTypes().length != 1) {
throw new XOException("Life cycle method '" + method.toG... | java | private void evaluateMethod(Object listener, Class<? extends Annotation> annotation, Method method, Map<Object, Set<Method>> methods) {
if (method.isAnnotationPresent(annotation)) {
if (method.getParameterTypes().length != 1) {
throw new XOException("Life cycle method '" + method.toG... | [
"private",
"void",
"evaluateMethod",
"(",
"Object",
"listener",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
",",
"Method",
"method",
",",
"Map",
"<",
"Object",
",",
"Set",
"<",
"Method",
">",
">",
"methods",
")",
"{",
"if",
"(",
... | Evaluates a method if an annotation is present and if true adds to the map of
life cycle methods.
@param listener
The listener instance.
@param annotation
The annotation to check for.
@param method
The method to evaluate.
@param methods
The map of methods. | [
"Evaluates",
"a",
"method",
"if",
"an",
"annotation",
"is",
"present",
"and",
"if",
"true",
"adds",
"to",
"the",
"map",
"of",
"life",
"cycle",
"methods",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java#L145-L158 |
109,511 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java | InstanceListenerService.invoke | private <T> void invoke(Map<Object, Set<Method>> methods, T instance) {
for (Map.Entry<Object, Set<Method>> entry : methods.entrySet()) {
Object listener = entry.getKey();
Set<Method> listenerMethods = entry.getValue();
if (listenerMethods != null) {
for (Meth... | java | private <T> void invoke(Map<Object, Set<Method>> methods, T instance) {
for (Map.Entry<Object, Set<Method>> entry : methods.entrySet()) {
Object listener = entry.getKey();
Set<Method> listenerMethods = entry.getValue();
if (listenerMethods != null) {
for (Meth... | [
"private",
"<",
"T",
">",
"void",
"invoke",
"(",
"Map",
"<",
"Object",
",",
"Set",
"<",
"Method",
">",
">",
"methods",
",",
"T",
"instance",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Object",
",",
"Set",
"<",
"Method",
">",
">",
"entry",
... | Invokes all registered lifecycle methods on a given instance.
@param methods
The registered methods.
@param instance
The instance.
@param <T>
The instance type. | [
"Invokes",
"all",
"registered",
"lifecycle",
"methods",
"on",
"a",
"given",
"instance",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/instancelistener/InstanceListenerService.java#L170-L189 |
109,512 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.readInstance | @Override
public <T> T readInstance(DatastoreType datastoreType) {
return getInstance(datastoreType, TransactionalCache.Mode.READ);
} | java | @Override
public <T> T readInstance(DatastoreType datastoreType) {
return getInstance(datastoreType, TransactionalCache.Mode.READ);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"readInstance",
"(",
"DatastoreType",
"datastoreType",
")",
"{",
"return",
"getInstance",
"(",
"datastoreType",
",",
"TransactionalCache",
".",
"Mode",
".",
"READ",
")",
";",
"}"
] | Return the proxy instance which corresponds to the given datastore type for
reading.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance. | [
"Return",
"the",
"proxy",
"instance",
"which",
"corresponds",
"to",
"the",
"given",
"datastore",
"type",
"for",
"reading",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L54-L57 |
109,513 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.createInstance | public <T> T createInstance(DatastoreType datastoreType, DynamicType<?> types) {
return newInstance(getDatastoreId(datastoreType), datastoreType, types, TransactionalCache.Mode.WRITE);
} | java | public <T> T createInstance(DatastoreType datastoreType, DynamicType<?> types) {
return newInstance(getDatastoreId(datastoreType), datastoreType, types, TransactionalCache.Mode.WRITE);
} | [
"public",
"<",
"T",
">",
"T",
"createInstance",
"(",
"DatastoreType",
"datastoreType",
",",
"DynamicType",
"<",
"?",
">",
"types",
")",
"{",
"return",
"newInstance",
"(",
"getDatastoreId",
"(",
"datastoreType",
")",
",",
"datastoreType",
",",
"types",
",",
"... | Return the proxy instance which corresponds to the given datastore type for
writing.
@param datastoreType
The datastore type.
@param types
The {@link DynamicType}.
@param <T>
The instance type.
@return The instance. | [
"Return",
"the",
"proxy",
"instance",
"which",
"corresponds",
"to",
"the",
"given",
"datastore",
"type",
"for",
"writing",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L71-L73 |
109,514 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.getInstance | private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
DatastoreId id = getDatastoreId(datastoreType);
Object instance = cache.get(id, cacheMode);
if (instance == null) {
DynamicType<?> types = getTypes(datastoreType);
instance = newIn... | java | private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
DatastoreId id = getDatastoreId(datastoreType);
Object instance = cache.get(id, cacheMode);
if (instance == null) {
DynamicType<?> types = getTypes(datastoreType);
instance = newIn... | [
"private",
"<",
"T",
">",
"T",
"getInstance",
"(",
"DatastoreType",
"datastoreType",
",",
"TransactionalCache",
".",
"Mode",
"cacheMode",
")",
"{",
"DatastoreId",
"id",
"=",
"getDatastoreId",
"(",
"datastoreType",
")",
";",
"Object",
"instance",
"=",
"cache",
... | Return the proxy instance which corresponds to the given datastore type.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance. | [
"Return",
"the",
"proxy",
"instance",
"which",
"corresponds",
"to",
"the",
"given",
"datastore",
"type",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L89-L100 |
109,515 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.newInstance | private <T> T newInstance(DatastoreId id, DatastoreType datastoreType, DynamicType<?> types, TransactionalCache.Mode cacheMode) {
validateType(types);
InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(datastoreType, getProxyMethodService());
T instance = proxyFactory.cr... | java | private <T> T newInstance(DatastoreId id, DatastoreType datastoreType, DynamicType<?> types, TransactionalCache.Mode cacheMode) {
validateType(types);
InstanceInvocationHandler invocationHandler = new InstanceInvocationHandler(datastoreType, getProxyMethodService());
T instance = proxyFactory.cr... | [
"private",
"<",
"T",
">",
"T",
"newInstance",
"(",
"DatastoreId",
"id",
",",
"DatastoreType",
"datastoreType",
",",
"DynamicType",
"<",
"?",
">",
"types",
",",
"TransactionalCache",
".",
"Mode",
"cacheMode",
")",
"{",
"validateType",
"(",
"types",
")",
";",
... | Create a proxy instance which corresponds to the given datastore type.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance. | [
"Create",
"a",
"proxy",
"instance",
"which",
"corresponds",
"to",
"the",
"given",
"datastore",
"type",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L111-L117 |
109,516 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.validateType | private void validateType(DynamicType<?> dynamicType) {
int size = dynamicType.getMetadata().size();
if (size == 1) {
if (dynamicType.isAbstract()) {
throw new XOException("Cannot create an instance of a single abstract type " + dynamicType);
}
} else if (... | java | private void validateType(DynamicType<?> dynamicType) {
int size = dynamicType.getMetadata().size();
if (size == 1) {
if (dynamicType.isAbstract()) {
throw new XOException("Cannot create an instance of a single abstract type " + dynamicType);
}
} else if (... | [
"private",
"void",
"validateType",
"(",
"DynamicType",
"<",
"?",
">",
"dynamicType",
")",
"{",
"int",
"size",
"=",
"dynamicType",
".",
"getMetadata",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"1",
")",
"{",
"if",
"(",
"dynamicTyp... | Validates the given types.
@param dynamicType
The types. | [
"Validates",
"the",
"given",
"types",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L125-L134 |
109,517 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.isInstance | @Override
public <Instance> boolean isInstance(Instance instance) {
if (instance instanceof CompositeObject) {
Object delegate = ((CompositeObject) instance).getDelegate();
return isDatastoreType(delegate);
}
return false;
} | java | @Override
public <Instance> boolean isInstance(Instance instance) {
if (instance instanceof CompositeObject) {
Object delegate = ((CompositeObject) instance).getDelegate();
return isDatastoreType(delegate);
}
return false;
} | [
"@",
"Override",
"public",
"<",
"Instance",
">",
"boolean",
"isInstance",
"(",
"Instance",
"instance",
")",
"{",
"if",
"(",
"instance",
"instanceof",
"CompositeObject",
")",
"{",
"Object",
"delegate",
"=",
"(",
"(",
"CompositeObject",
")",
"instance",
")",
"... | Determine if a given instance is a datastore type handled by this manager.
@param instance
The instance.
@param <Instance>
The instance type.
@return <code>true</code> if the instance is handled by this manager. | [
"Determine",
"if",
"a",
"given",
"instance",
"is",
"a",
"datastore",
"type",
"handled",
"by",
"this",
"manager",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L173-L180 |
109,518 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.getDatastoreType | @Override
public <Instance> DatastoreType getDatastoreType(Instance instance) {
InstanceInvocationHandler<DatastoreType> invocationHandler = proxyFactory.getInvocationHandler(instance);
return invocationHandler.getDatastoreType();
} | java | @Override
public <Instance> DatastoreType getDatastoreType(Instance instance) {
InstanceInvocationHandler<DatastoreType> invocationHandler = proxyFactory.getInvocationHandler(instance);
return invocationHandler.getDatastoreType();
} | [
"@",
"Override",
"public",
"<",
"Instance",
">",
"DatastoreType",
"getDatastoreType",
"(",
"Instance",
"instance",
")",
"{",
"InstanceInvocationHandler",
"<",
"DatastoreType",
">",
"invocationHandler",
"=",
"proxyFactory",
".",
"getInvocationHandler",
"(",
"instance",
... | Return the datastore type represented by an instance.
@param instance
The instance.
@param <Instance>
The instance type.
@return The corresponding datastore type. | [
"Return",
"the",
"datastore",
"type",
"represented",
"by",
"an",
"instance",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L191-L195 |
109,519 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/metadata/RelationTypeMetadataResolver.java | RelationTypeMetadataResolver.getRelationTypes | public DynamicType<RelationTypeMetadata<RelationMetadata>> getRelationTypes(Set<EntityDiscriminator> sourceDiscriminators,
RelationDiscriminator discriminator, Set<EntityDiscriminator> targetDiscriminators) {
DynamicType<RelationTypeMetadata<RelationMetadata>> dynamicType = new DynamicType<>();
... | java | public DynamicType<RelationTypeMetadata<RelationMetadata>> getRelationTypes(Set<EntityDiscriminator> sourceDiscriminators,
RelationDiscriminator discriminator, Set<EntityDiscriminator> targetDiscriminators) {
DynamicType<RelationTypeMetadata<RelationMetadata>> dynamicType = new DynamicType<>();
... | [
"public",
"DynamicType",
"<",
"RelationTypeMetadata",
"<",
"RelationMetadata",
">",
">",
"getRelationTypes",
"(",
"Set",
"<",
"EntityDiscriminator",
">",
"sourceDiscriminators",
",",
"RelationDiscriminator",
"discriminator",
",",
"Set",
"<",
"EntityDiscriminator",
">",
... | Determine the relation type for the given source discriminators, relation
descriminator and target discriminators.
@param sourceDiscriminators
The source discriminators.
@param discriminator
The relation discriminator.
@param targetDiscriminators
The target discriminators.
@return A set of matching relation types. | [
"Determine",
"the",
"relation",
"type",
"for",
"the",
"given",
"source",
"discriminators",
"relation",
"descriminator",
"and",
"target",
"discriminators",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/metadata/RelationTypeMetadataResolver.java#L91-L108 |
109,520 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/XOManagerImpl.java | XOManagerImpl.prepareExample | private <T> Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> prepareExample(Example<T> example, Class<?> type, Class<?>... types) {
Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> exampleEntity = new HashMap<>();
ExampleProxyMethodService<T> proxyMethodService = (ExampleProx... | java | private <T> Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> prepareExample(Example<T> example, Class<?> type, Class<?>... types) {
Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> exampleEntity = new HashMap<>();
ExampleProxyMethodService<T> proxyMethodService = (ExampleProx... | [
"private",
"<",
"T",
">",
"Map",
"<",
"PrimitivePropertyMethodMetadata",
"<",
"PropertyMetadata",
">",
",",
"Object",
">",
"prepareExample",
"(",
"Example",
"<",
"T",
">",
"example",
",",
"Class",
"<",
"?",
">",
"type",
",",
"Class",
"<",
"?",
">",
"..."... | Setup an example entity.
@param type
The type.
@param example
The provided example.
@param <T>
The type.
@return The example. | [
"Setup",
"an",
"example",
"entity",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/XOManagerImpl.java#L149-L164 |
109,521 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/XOManagerImpl.java | XOManagerImpl.findByExample | private <T> ResultIterable<T> findByExample(Class<?> type, Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> entity) {
sessionContext.getCacheSynchronizationService().flush();
EntityTypeMetadata<EntityMetadata> entityTypeMetadata = sessionContext.getMetadataProvider().getEntityMetadata(type... | java | private <T> ResultIterable<T> findByExample(Class<?> type, Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> entity) {
sessionContext.getCacheSynchronizationService().flush();
EntityTypeMetadata<EntityMetadata> entityTypeMetadata = sessionContext.getMetadataProvider().getEntityMetadata(type... | [
"private",
"<",
"T",
">",
"ResultIterable",
"<",
"T",
">",
"findByExample",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Map",
"<",
"PrimitivePropertyMethodMetadata",
"<",
"PropertyMetadata",
">",
",",
"Object",
">",
"entity",
")",
"{",
"sessionContext",
".",
... | Find entities according to the given example entity.
@param type
The entity type.
@param entity
The example entity.
@param <T>
The entity type.
@return A {@link ResultIterable}. | [
"Find",
"entities",
"according",
"to",
"the",
"given",
"example",
"entity",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/XOManagerImpl.java#L177-L219 |
109,522 | buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/metadata/EntityTypeMetadataResolver.java | EntityTypeMetadataResolver.getAggregatedDiscriminators | private Set<Discriminator> getAggregatedDiscriminators(EntityTypeMetadata<EntityMetadata> typeMetadata) {
Set<Discriminator> discriminators = aggregatedDiscriminators.get(typeMetadata);
if (discriminators == null) {
discriminators = new HashSet<>();
Discriminator discriminator = ... | java | private Set<Discriminator> getAggregatedDiscriminators(EntityTypeMetadata<EntityMetadata> typeMetadata) {
Set<Discriminator> discriminators = aggregatedDiscriminators.get(typeMetadata);
if (discriminators == null) {
discriminators = new HashSet<>();
Discriminator discriminator = ... | [
"private",
"Set",
"<",
"Discriminator",
">",
"getAggregatedDiscriminators",
"(",
"EntityTypeMetadata",
"<",
"EntityMetadata",
">",
"typeMetadata",
")",
"{",
"Set",
"<",
"Discriminator",
">",
"discriminators",
"=",
"aggregatedDiscriminators",
".",
"get",
"(",
"typeMeta... | Determine the set of discriminators for one type, i.e. the discriminator of
the type itself and of all it's super types.
@param typeMetadata
The type.
@return The set of discriminators. | [
"Determine",
"the",
"set",
"of",
"discriminators",
"for",
"one",
"type",
"i",
".",
"e",
".",
"the",
"discriminator",
"of",
"the",
"type",
"itself",
"and",
"of",
"all",
"it",
"s",
"super",
"types",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/metadata/EntityTypeMetadataResolver.java#L136-L153 |
109,523 | buschmais/extended-objects | spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java | ClassHelper.getTypes | public static Collection<Class<?>> getTypes(Collection<String> typeNames) {
Set<Class<?>> types = new HashSet<>();
for (String typeName : typeNames) {
types.add(ClassHelper.getType(typeName));
}
return types;
} | java | public static Collection<Class<?>> getTypes(Collection<String> typeNames) {
Set<Class<?>> types = new HashSet<>();
for (String typeName : typeNames) {
types.add(ClassHelper.getType(typeName));
}
return types;
} | [
"public",
"static",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"getTypes",
"(",
"Collection",
"<",
"String",
">",
"typeNames",
")",
"{",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"types",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
... | Load a collection of classes.
@param typeNames
The class names.
@return The collection of classes. | [
"Load",
"a",
"collection",
"of",
"classes",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java#L48-L54 |
109,524 | buschmais/extended-objects | spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java | ClassHelper.newInstance | public static <T> T newInstance(Class<T> type) {
try {
return type.newInstance();
} catch (InstantiationException e) {
throw new XOException("Cannot create instance of type '" + type.getName() + "'", e);
} catch (IllegalAccessException e) {
throw new XOExcepti... | java | public static <T> T newInstance(Class<T> type) {
try {
return type.newInstance();
} catch (InstantiationException e) {
throw new XOException("Cannot create instance of type '" + type.getName() + "'", e);
} catch (IllegalAccessException e) {
throw new XOExcepti... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"return",
"type",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"InstantiationException",
"e",
")",
"{",
"throw",
"new",
"XOExce... | Create an instance of a class.
@param type
The class.
@param <T>
The class type.
@return The instance. | [
"Create",
"an",
"instance",
"of",
"a",
"class",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java#L65-L73 |
109,525 | buschmais/extended-objects | spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java | ClassHelper.getTypeParameter | public static Class<?> getTypeParameter(Class<?> genericType, Class<?> type) {
Type[] genericInterfaces = type.getGenericInterfaces();
for (Type genericInterface : genericInterfaces) {
if (genericInterface instanceof ParameterizedType) {
ParameterizedType parameterizedType = ... | java | public static Class<?> getTypeParameter(Class<?> genericType, Class<?> type) {
Type[] genericInterfaces = type.getGenericInterfaces();
for (Type genericInterface : genericInterfaces) {
if (genericInterface instanceof ParameterizedType) {
ParameterizedType parameterizedType = ... | [
"public",
"static",
"Class",
"<",
"?",
">",
"getTypeParameter",
"(",
"Class",
"<",
"?",
">",
"genericType",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Type",
"[",
"]",
"genericInterfaces",
"=",
"type",
".",
"getGenericInterfaces",
"(",
")",
";",
"... | Determines the type of a class implementing a generic interface with one type
parameter.
@param genericType
The generic interface type.
@param type
The type to determine the parameter from.
@return The type parameter. | [
"Determines",
"the",
"type",
"of",
"a",
"class",
"implementing",
"a",
"generic",
"interface",
"with",
"one",
"type",
"parameter",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/spi/src/main/java/com/buschmais/xo/spi/reflection/ClassHelper.java#L85-L99 |
109,526 | buschmais/extended-objects | spi/src/main/java/com/buschmais/xo/spi/reflection/BeanMethodProvider.java | BeanMethodProvider.getMethods | public Collection<AnnotatedMethod> getMethods() {
for (Method method : type.getDeclaredMethods()) {
// only consider methods which have been explicitly declared in the
// interface
if (!method.isSynthetic()) {
Class<?> returnType = method.getReturnType();
... | java | public Collection<AnnotatedMethod> getMethods() {
for (Method method : type.getDeclaredMethods()) {
// only consider methods which have been explicitly declared in the
// interface
if (!method.isSynthetic()) {
Class<?> returnType = method.getReturnType();
... | [
"public",
"Collection",
"<",
"AnnotatedMethod",
">",
"getMethods",
"(",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"type",
".",
"getDeclaredMethods",
"(",
")",
")",
"{",
"// only consider methods which have been explicitly declared in the",
"// interface",
"if",
"... | Return the methods of the type.
@return The methods. | [
"Return",
"the",
"methods",
"of",
"the",
"type",
"."
] | 186431e81f3d8d26c511cfe1143dee59b03c2e7a | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/spi/src/main/java/com/buschmais/xo/spi/reflection/BeanMethodProvider.java#L76-L126 |
109,527 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.rewriteAnchor | private List<Content> rewriteAnchor(Element element) {
// detect empty anchor elements and insert at least an empty string to avoid "self-closing" elements
// that are not handled correctly by most browsers
if (element.getContent().isEmpty()) {
element.setText("");
}
// resolve link metadata... | java | private List<Content> rewriteAnchor(Element element) {
// detect empty anchor elements and insert at least an empty string to avoid "self-closing" elements
// that are not handled correctly by most browsers
if (element.getContent().isEmpty()) {
element.setText("");
}
// resolve link metadata... | [
"private",
"List",
"<",
"Content",
">",
"rewriteAnchor",
"(",
"Element",
"element",
")",
"{",
"// detect empty anchor elements and insert at least an empty string to avoid \"self-closing\" elements",
"// that are not handled correctly by most browsers",
"if",
"(",
"element",
".",
"... | Checks if the given anchor element has to be rewritten.
@param element Element to check
@return null if nothing is to do with this element.
Return empty list to remove this element.
Return list with other content to replace element with new content. | [
"Checks",
"if",
"the",
"given",
"anchor",
"element",
"has",
"to",
"be",
"rewritten",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L151-L175 |
109,528 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.getAnchorLegacyMetadataFromSingleData | private boolean getAnchorLegacyMetadataFromSingleData(ValueMap resourceProps, Element element) {
boolean foundAny = false;
JSONObject metadata = null;
Attribute dataAttribute = element.getAttribute("data");
if (dataAttribute != null) {
String metadataString = dataAttribute.getValue();
if (S... | java | private boolean getAnchorLegacyMetadataFromSingleData(ValueMap resourceProps, Element element) {
boolean foundAny = false;
JSONObject metadata = null;
Attribute dataAttribute = element.getAttribute("data");
if (dataAttribute != null) {
String metadataString = dataAttribute.getValue();
if (S... | [
"private",
"boolean",
"getAnchorLegacyMetadataFromSingleData",
"(",
"ValueMap",
"resourceProps",
",",
"Element",
"element",
")",
"{",
"boolean",
"foundAny",
"=",
"false",
";",
"JSONObject",
"metadata",
"=",
"null",
";",
"Attribute",
"dataAttribute",
"=",
"element",
... | Support legacy data structures where link metadata is stored as JSON fragment in single HTML5 data attribute.
@param resourceProps ValueMap to write link metadata to
@param element Link element | [
"Support",
"legacy",
"data",
"structures",
"where",
"link",
"metadata",
"is",
"stored",
"as",
"JSON",
"fragment",
"in",
"single",
"HTML5",
"data",
"attribute",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L257-L283 |
109,529 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.getAnchorLegacyMetadataFromRel | private void getAnchorLegacyMetadataFromRel(ValueMap resourceProps, Element element) {
// Check href attribute - do not change elements with no href or links to anchor names
String href = element.getAttributeValue("href");
String linkWindowTarget = element.getAttributeValue("target");
if (href == null |... | java | private void getAnchorLegacyMetadataFromRel(ValueMap resourceProps, Element element) {
// Check href attribute - do not change elements with no href or links to anchor names
String href = element.getAttributeValue("href");
String linkWindowTarget = element.getAttributeValue("target");
if (href == null |... | [
"private",
"void",
"getAnchorLegacyMetadataFromRel",
"(",
"ValueMap",
"resourceProps",
",",
"Element",
"element",
")",
"{",
"// Check href attribute - do not change elements with no href or links to anchor names",
"String",
"href",
"=",
"element",
".",
"getAttributeValue",
"(",
... | Support legacy data structures where link metadata is stored as JSON fragment in rel attribute.
@param resourceProps ValueMap to write link metadata to
@param element Link element | [
"Support",
"legacy",
"data",
"structures",
"where",
"link",
"metadata",
"is",
"stored",
"as",
"JSON",
"fragment",
"in",
"rel",
"attribute",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L290-L372 |
109,530 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.rewriteImage | private List<Content> rewriteImage(Element element) {
// resolve media metadata from DOM element
Media media = getImageMedia(element);
// build image for media metadata
Element imageElement = buildImageElement(media, element);
// return modified element
List<Content> content = new ArrayList<C... | java | private List<Content> rewriteImage(Element element) {
// resolve media metadata from DOM element
Media media = getImageMedia(element);
// build image for media metadata
Element imageElement = buildImageElement(media, element);
// return modified element
List<Content> content = new ArrayList<C... | [
"private",
"List",
"<",
"Content",
">",
"rewriteImage",
"(",
"Element",
"element",
")",
"{",
"// resolve media metadata from DOM element",
"Media",
"media",
"=",
"getImageMedia",
"(",
"element",
")",
";",
"// build image for media metadata",
"Element",
"imageElement",
"... | Checks if the given image element has to be rewritten.
@param element Element to check
@return null if nothing is to do with this element.
Return empty list to remove this element.
Return list with other content to replace element with new content. | [
"Checks",
"if",
"the",
"given",
"image",
"element",
"has",
"to",
"be",
"rewritten",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L381-L395 |
109,531 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.buildImageElement | private Element buildImageElement(Media media, Element element) {
if (media.isValid()) {
element.setAttribute("src", media.getUrl());
}
return element;
} | java | private Element buildImageElement(Media media, Element element) {
if (media.isValid()) {
element.setAttribute("src", media.getUrl());
}
return element;
} | [
"private",
"Element",
"buildImageElement",
"(",
"Media",
"media",
",",
"Element",
"element",
")",
"{",
"if",
"(",
"media",
".",
"isValid",
"(",
")",
")",
"{",
"element",
".",
"setAttribute",
"(",
"\"src\"",
",",
"media",
".",
"getUrl",
"(",
")",
")",
"... | Builds image element for given media metadata.
@param media Media metadata
@param element Original element
@return Image element or null if media reference is invalid | [
"Builds",
"image",
"element",
"for",
"given",
"media",
"metadata",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L416-L421 |
109,532 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.unexternalizeImageRef | private String unexternalizeImageRef(String ref) {
String unexternalizedRef = ref;
if (StringUtils.isNotEmpty(unexternalizedRef)) {
// decode if required
unexternalizedRef = decodeIfEncoded(unexternalizedRef);
// TODO: implementation has to be aligned with MediaSource implementations!
... | java | private String unexternalizeImageRef(String ref) {
String unexternalizedRef = ref;
if (StringUtils.isNotEmpty(unexternalizedRef)) {
// decode if required
unexternalizedRef = decodeIfEncoded(unexternalizedRef);
// TODO: implementation has to be aligned with MediaSource implementations!
... | [
"private",
"String",
"unexternalizeImageRef",
"(",
"String",
"ref",
")",
"{",
"String",
"unexternalizedRef",
"=",
"ref",
";",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"unexternalizedRef",
")",
")",
"{",
"// decode if required",
"unexternalizedRef",
"=",
"... | Converts the RTE externalized form of media reference to internal form.
@param ref Externalize media reference
@return Internal media reference | [
"Converts",
"the",
"RTE",
"externalized",
"form",
"of",
"media",
"reference",
"to",
"internal",
"form",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L428-L443 |
109,533 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java | DefaultRewriteContentHandler.decodeIfEncoded | private String decodeIfEncoded(String value) {
if (StringUtils.contains(value, "%")) {
try {
return URLDecoder.decode(value, CharEncoding.UTF_8);
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex);
}
}
return value;
} | java | private String decodeIfEncoded(String value) {
if (StringUtils.contains(value, "%")) {
try {
return URLDecoder.decode(value, CharEncoding.UTF_8);
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex);
}
}
return value;
} | [
"private",
"String",
"decodeIfEncoded",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"StringUtils",
".",
"contains",
"(",
"value",
",",
"\"%\"",
")",
")",
"{",
"try",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"value",
",",
"CharEncoding",
".",
"UT... | URL-decode value if required.
@param value Probably encoded value.
@return Decoded value | [
"URL",
"-",
"decode",
"value",
"if",
"required",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/DefaultRewriteContentHandler.java#L450-L460 |
109,534 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/impl/UrlSuffixUtil.java | UrlSuffixUtil.keyValuePairAsMap | public static Map<String, Object> keyValuePairAsMap(String key, Object value) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(key, value);
return paramMap;
} | java | public static Map<String, Object> keyValuePairAsMap(String key, Object value) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put(key, value);
return paramMap;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"keyValuePairAsMap",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"paramMap",
"."... | Convert key value pair to map
@param key Key
@param value Value
@return Map | [
"Convert",
"key",
"value",
"pair",
"to",
"map"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/impl/UrlSuffixUtil.java#L197-L201 |
109,535 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineAsset.java | InlineAsset.getInlineRendition | private Rendition getInlineRendition(MediaArgs mediaArgs) {
return new InlineRendition(this.resource, this.media, mediaArgs, this.fileName, this.adaptable);
} | java | private Rendition getInlineRendition(MediaArgs mediaArgs) {
return new InlineRendition(this.resource, this.media, mediaArgs, this.fileName, this.adaptable);
} | [
"private",
"Rendition",
"getInlineRendition",
"(",
"MediaArgs",
"mediaArgs",
")",
"{",
"return",
"new",
"InlineRendition",
"(",
"this",
".",
"resource",
",",
"this",
".",
"media",
",",
"mediaArgs",
",",
"this",
".",
"fileName",
",",
"this",
".",
"adaptable",
... | Get inline rendition instance.
@param mediaArgs Media args
@return Inline rendition instance (may be invalid rendition) | [
"Get",
"inline",
"rendition",
"instance",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineAsset.java#L140-L142 |
109,536 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.addRendition | private void addRendition(Set<RenditionMetadata> candidates, Rendition rendition, MediaArgs mediaArgs) {
// ignore AEM-generated thumbnail renditions unless allowed via mediaargs
if (!mediaArgs.isIncludeAssetThumbnails() && AssetRendition.isThumbnailRendition(rendition)) {
return;
}
// ignore AEM-... | java | private void addRendition(Set<RenditionMetadata> candidates, Rendition rendition, MediaArgs mediaArgs) {
// ignore AEM-generated thumbnail renditions unless allowed via mediaargs
if (!mediaArgs.isIncludeAssetThumbnails() && AssetRendition.isThumbnailRendition(rendition)) {
return;
}
// ignore AEM-... | [
"private",
"void",
"addRendition",
"(",
"Set",
"<",
"RenditionMetadata",
">",
"candidates",
",",
"Rendition",
"rendition",
",",
"MediaArgs",
"mediaArgs",
")",
"{",
"// ignore AEM-generated thumbnail renditions unless allowed via mediaargs",
"if",
"(",
"!",
"mediaArgs",
".... | adds rendition to the list of candidates, if it should be available for resolving
@param candidates
@param rendition | [
"adds",
"rendition",
"to",
"the",
"list",
"of",
"candidates",
"if",
"it",
"should",
"be",
"available",
"for",
"resolving"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L94-L108 |
109,537 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.getRendtionsMatchingFileExtensions | private Set<RenditionMetadata> getRendtionsMatchingFileExtensions(String[] fileExtensions, MediaArgs mediaArgs) {
// if no file extension restriction get all renditions
Set<RenditionMetadata> allRenditions = getAvailableRenditions(mediaArgs);
if (fileExtensions == null || fileExtensions.length == 0) {
... | java | private Set<RenditionMetadata> getRendtionsMatchingFileExtensions(String[] fileExtensions, MediaArgs mediaArgs) {
// if no file extension restriction get all renditions
Set<RenditionMetadata> allRenditions = getAvailableRenditions(mediaArgs);
if (fileExtensions == null || fileExtensions.length == 0) {
... | [
"private",
"Set",
"<",
"RenditionMetadata",
">",
"getRendtionsMatchingFileExtensions",
"(",
"String",
"[",
"]",
"fileExtensions",
",",
"MediaArgs",
"mediaArgs",
")",
"{",
"// if no file extension restriction get all renditions",
"Set",
"<",
"RenditionMetadata",
">",
"allRen... | Get all renditions that match the requested list of file extension.
@param fileExtensions List of file extensions
@return Matching renditions | [
"Get",
"all",
"renditions",
"that",
"match",
"the",
"requested",
"list",
"of",
"file",
"extension",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L124-L143 |
109,538 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.getRequestedFileExtensions | private String[] getRequestedFileExtensions(MediaArgs mediaArgs) {
// get file extension defined in media args
Set<String> mediaArgsFileExtensions = new HashSet<String>();
if (mediaArgs.getFileExtensions() != null && mediaArgs.getFileExtensions().length > 0) {
mediaArgsFileExtensions.addAll(ImmutableL... | java | private String[] getRequestedFileExtensions(MediaArgs mediaArgs) {
// get file extension defined in media args
Set<String> mediaArgsFileExtensions = new HashSet<String>();
if (mediaArgs.getFileExtensions() != null && mediaArgs.getFileExtensions().length > 0) {
mediaArgsFileExtensions.addAll(ImmutableL... | [
"private",
"String",
"[",
"]",
"getRequestedFileExtensions",
"(",
"MediaArgs",
"mediaArgs",
")",
"{",
"// get file extension defined in media args",
"Set",
"<",
"String",
">",
"mediaArgsFileExtensions",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"if",... | Get merged list of file extensions from both media formats and media args.
@param mediaArgs Media args
@return Array of file extensions.
Returns empty array if all file extensions are allowed.
Returns null if different file extensions are requested in media formats and media args
and the file extension filtering is not... | [
"Get",
"merged",
"list",
"of",
"file",
"extensions",
"from",
"both",
"media",
"formats",
"and",
"media",
"args",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L197-L236 |
109,539 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.getExactMatchRendition | private RenditionMetadata getExactMatchRendition(final Set<RenditionMetadata> candidates, MediaArgs mediaArgs) {
// check for fixed width and/or height request
if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
for (RenditionMetadata candidate : candidates) {
if (candidate.matc... | java | private RenditionMetadata getExactMatchRendition(final Set<RenditionMetadata> candidates, MediaArgs mediaArgs) {
// check for fixed width and/or height request
if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
for (RenditionMetadata candidate : candidates) {
if (candidate.matc... | [
"private",
"RenditionMetadata",
"getExactMatchRendition",
"(",
"final",
"Set",
"<",
"RenditionMetadata",
">",
"candidates",
",",
"MediaArgs",
"mediaArgs",
")",
"{",
"// check for fixed width and/or height request",
"if",
"(",
"mediaArgs",
".",
"getFixedWidth",
"(",
")",
... | Get rendition that matches exactly with the given media args requirements.
@param candidates Rendition candidates
@param mediaArgs Media args
@return Rendition or null if none found | [
"Get",
"rendition",
"that",
"matches",
"exactly",
"with",
"the",
"given",
"media",
"args",
"requirements",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L284-L321 |
109,540 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.getOriginalOrFirstRendition | private RenditionMetadata getOriginalOrFirstRendition(Set<RenditionMetadata> candidates) {
if (this.originalRendition != null && candidates.contains(this.originalRendition)) {
return this.originalRendition;
}
else if (!candidates.isEmpty()) {
return candidates.iterator().next();
}
else {... | java | private RenditionMetadata getOriginalOrFirstRendition(Set<RenditionMetadata> candidates) {
if (this.originalRendition != null && candidates.contains(this.originalRendition)) {
return this.originalRendition;
}
else if (!candidates.isEmpty()) {
return candidates.iterator().next();
}
else {... | [
"private",
"RenditionMetadata",
"getOriginalOrFirstRendition",
"(",
"Set",
"<",
"RenditionMetadata",
">",
"candidates",
")",
"{",
"if",
"(",
"this",
".",
"originalRendition",
"!=",
"null",
"&&",
"candidates",
".",
"contains",
"(",
"this",
".",
"originalRendition",
... | Returns original rendition - if it is contained in the candidate set. Otherwise first candidate is returned.
If a VirtualCropRenditionMetadata is present always the first one is returned.
@param candidates Candidates
@return Original or first rendition of candidates or null | [
"Returns",
"original",
"rendition",
"-",
"if",
"it",
"is",
"contained",
"in",
"the",
"candidate",
"set",
".",
"Otherwise",
"first",
"candidate",
"is",
"returned",
".",
"If",
"a",
"VirtualCropRenditionMetadata",
"is",
"present",
"always",
"the",
"first",
"one",
... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L329-L339 |
109,541 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java | DefaultRenditionHandler.visitMediaFormats | @SuppressWarnings("null")
private <T> T visitMediaFormats(MediaArgs mediaArgs, MediaFormatVisitor<T> mediaFormatVisitor) {
MediaFormat[] mediaFormats = mediaArgs.getMediaFormats();
if (mediaFormats != null) {
for (MediaFormat mediaFormat : mediaFormats) {
T returnValue = mediaFormatVisitor.visit... | java | @SuppressWarnings("null")
private <T> T visitMediaFormats(MediaArgs mediaArgs, MediaFormatVisitor<T> mediaFormatVisitor) {
MediaFormat[] mediaFormats = mediaArgs.getMediaFormats();
if (mediaFormats != null) {
for (MediaFormat mediaFormat : mediaFormats) {
T returnValue = mediaFormatVisitor.visit... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"private",
"<",
"T",
">",
"T",
"visitMediaFormats",
"(",
"MediaArgs",
"mediaArgs",
",",
"MediaFormatVisitor",
"<",
"T",
">",
"mediaFormatVisitor",
")",
"{",
"MediaFormat",
"[",
"]",
"mediaFormats",
"=",
"mediaArgs",... | Iterate over all media formats defined in media args. Ignores invalid media formats.
If the media format visitor returns a value that is not null, iteration is stopped and the value is returned from
this method.
@param mediaArgs Media args
@param mediaFormatVisitor Media format visitor
@return Return value form media f... | [
"Iterate",
"over",
"all",
"media",
"formats",
"defined",
"in",
"media",
"args",
".",
"Ignores",
"invalid",
"media",
"formats",
".",
"If",
"the",
"media",
"format",
"visitor",
"returns",
"a",
"value",
"that",
"is",
"not",
"null",
"iteration",
"is",
"stopped",... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DefaultRenditionHandler.java#L464-L476 |
109,542 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/spi/MediaSource.java | MediaSource.resolveFirstMatchRenditions | private boolean resolveFirstMatchRenditions(Media media, Asset asset, MediaArgs mediaArgs) {
Rendition rendition = asset.getRendition(mediaArgs);
if (rendition != null) {
media.setRenditions(ImmutableList.of(rendition));
media.setUrl(rendition.getUrl());
return true;
}
return false;
... | java | private boolean resolveFirstMatchRenditions(Media media, Asset asset, MediaArgs mediaArgs) {
Rendition rendition = asset.getRendition(mediaArgs);
if (rendition != null) {
media.setRenditions(ImmutableList.of(rendition));
media.setUrl(rendition.getUrl());
return true;
}
return false;
... | [
"private",
"boolean",
"resolveFirstMatchRenditions",
"(",
"Media",
"media",
",",
"Asset",
"asset",
",",
"MediaArgs",
"mediaArgs",
")",
"{",
"Rendition",
"rendition",
"=",
"asset",
".",
"getRendition",
"(",
"mediaArgs",
")",
";",
"if",
"(",
"rendition",
"!=",
"... | Check if a matching rendition is found for any of the provided media formats and other media args.
The first match is returned.
@param media Media
@param asset Asset
@param mediaArgs Media args
@return true if a rendition was found | [
"Check",
"if",
"a",
"matching",
"rendition",
"is",
"found",
"for",
"any",
"of",
"the",
"provided",
"media",
"formats",
"and",
"other",
"media",
"args",
".",
"The",
"first",
"match",
"is",
"returned",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/spi/MediaSource.java#L319-L327 |
109,543 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/spi/MediaSource.java | MediaSource.resolveAllRenditions | private boolean resolveAllRenditions(Media media, Asset asset, MediaArgs mediaArgs) {
boolean allMandatory = mediaArgs.isMediaFormatsMandatory();
boolean allResolved = true;
boolean anyResolved = false;
List<Rendition> resolvedRenditions = new ArrayList<>();
for (MediaFormat mediaFormat : mediaArgs.... | java | private boolean resolveAllRenditions(Media media, Asset asset, MediaArgs mediaArgs) {
boolean allMandatory = mediaArgs.isMediaFormatsMandatory();
boolean allResolved = true;
boolean anyResolved = false;
List<Rendition> resolvedRenditions = new ArrayList<>();
for (MediaFormat mediaFormat : mediaArgs.... | [
"private",
"boolean",
"resolveAllRenditions",
"(",
"Media",
"media",
",",
"Asset",
"asset",
",",
"MediaArgs",
"mediaArgs",
")",
"{",
"boolean",
"allMandatory",
"=",
"mediaArgs",
".",
"isMediaFormatsMandatory",
"(",
")",
";",
"boolean",
"allResolved",
"=",
"true",
... | Iterates over all defined media format and tries to find a matching rendition for each of them
in combination with the other media args.
@param media Media
@param asset Asset
@param mediaArgs Media args
@return true if for all mandatory or for at least one media formats a rendition could be found. | [
"Iterates",
"over",
"all",
"defined",
"media",
"format",
"and",
"tries",
"to",
"find",
"a",
"matching",
"rendition",
"for",
"each",
"of",
"them",
"in",
"combination",
"with",
"the",
"other",
"media",
"args",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/spi/MediaSource.java#L337-L365 |
109,544 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/ui/SiteRoot.java | SiteRoot.getRelativePage | public Page getRelativePage(String relativePath) {
String path = getRootPath();
if (path == null) {
return null;
}
StringBuilder sb = new StringBuilder(path);
if (!relativePath.startsWith("/")) {
sb.append("/");
}
sb.append(relativePath);
return pageManager.getPage(sb.toStrin... | java | public Page getRelativePage(String relativePath) {
String path = getRootPath();
if (path == null) {
return null;
}
StringBuilder sb = new StringBuilder(path);
if (!relativePath.startsWith("/")) {
sb.append("/");
}
sb.append(relativePath);
return pageManager.getPage(sb.toStrin... | [
"public",
"Page",
"getRelativePage",
"(",
"String",
"relativePath",
")",
"{",
"String",
"path",
"=",
"getRootPath",
"(",
")",
";",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
... | Get page relative to site root.
@param relativePath Path relative to site root
@return Page instance or null if not found | [
"Get",
"page",
"relative",
"to",
"site",
"root",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/ui/SiteRoot.java#L102-L113 |
109,545 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/AbstractMediaFileServlet.java | AbstractMediaFileServlet.isNotModified | protected boolean isNotModified(Resource resource, SlingHttpServletRequest request,
SlingHttpServletResponse response) throws IOException {
// check resource's modification date against the If-Modified-Since header and send 304 if resource wasn't modified
// never send expires header on author or publish ... | java | protected boolean isNotModified(Resource resource, SlingHttpServletRequest request,
SlingHttpServletResponse response) throws IOException {
// check resource's modification date against the If-Modified-Since header and send 304 if resource wasn't modified
// never send expires header on author or publish ... | [
"protected",
"boolean",
"isNotModified",
"(",
"Resource",
"resource",
",",
"SlingHttpServletRequest",
"request",
",",
"SlingHttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"// check resource's modification date against the If-Modified-Since header and send 304 if... | Checks if the resource was modified since last request
@param resource Resource pointing to nt:file or nt:resource node
@param request Request
@param response Response
@return true if the resource is not modified and should not be delivered anew
@throws IOException | [
"Checks",
"if",
"the",
"resource",
"was",
"modified",
"since",
"last",
"request"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/AbstractMediaFileServlet.java#L102-L108 |
109,546 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/AbstractMediaFileServlet.java | AbstractMediaFileServlet.sendBinaryData | protected void sendBinaryData(byte[] binaryData, String contentType,
SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {
// set content type and length
response.setContentType(contentType);
response.setContentLength(binaryData.length);
// Handling of the "for... | java | protected void sendBinaryData(byte[] binaryData, String contentType,
SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {
// set content type and length
response.setContentType(contentType);
response.setContentLength(binaryData.length);
// Handling of the "for... | [
"protected",
"void",
"sendBinaryData",
"(",
"byte",
"[",
"]",
"binaryData",
",",
"String",
"contentType",
",",
"SlingHttpServletRequest",
"request",
",",
"SlingHttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"// set content type and length",
"response... | Send binary data to output stream. Respect optional content disposition header handling.
@param binaryData Binary data array.
@param contentType Content type
@param request Request
@param response Response
@throws IOException | [
"Send",
"binary",
"data",
"to",
"output",
"stream",
".",
"Respect",
"optional",
"content",
"disposition",
"header",
"handling",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/AbstractMediaFileServlet.java#L150-L178 |
109,547 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java | AbstractUrlMode.getUrlConfigForTarget | protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Page targetPage) {
Resource targetResource = null;
if (targetPage != null) {
targetResource = targetPage.adaptTo(Resource.class);
}
return getUrlConfigForTarget(adaptable, targetResource);
} | java | protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Page targetPage) {
Resource targetResource = null;
if (targetPage != null) {
targetResource = targetPage.adaptTo(Resource.class);
}
return getUrlConfigForTarget(adaptable, targetResource);
} | [
"protected",
"UrlConfig",
"getUrlConfigForTarget",
"(",
"Adaptable",
"adaptable",
",",
"Page",
"targetPage",
")",
"{",
"Resource",
"targetResource",
"=",
"null",
";",
"if",
"(",
"targetPage",
"!=",
"null",
")",
"{",
"targetResource",
"=",
"targetPage",
".",
"ada... | Get URL configuration for target page. If this is invalid or not available, get it from adaptable.
@param adaptable Adaptable (request or resource)
@param targetPage Target page (may be null)
@return Url config (never null) | [
"Get",
"URL",
"configuration",
"for",
"target",
"page",
".",
"If",
"this",
"is",
"invalid",
"or",
"not",
"available",
"get",
"it",
"from",
"adaptable",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java#L55-L61 |
109,548 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java | AbstractUrlMode.getUrlConfigForTarget | protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Resource targetResource) {
UrlConfig config = null;
if (targetResource != null) {
config = new UrlConfig(targetResource);
}
if (config == null || !config.isValid()) {
config = new UrlConfig(adaptable);
}
return config;
... | java | protected UrlConfig getUrlConfigForTarget(Adaptable adaptable, Resource targetResource) {
UrlConfig config = null;
if (targetResource != null) {
config = new UrlConfig(targetResource);
}
if (config == null || !config.isValid()) {
config = new UrlConfig(adaptable);
}
return config;
... | [
"protected",
"UrlConfig",
"getUrlConfigForTarget",
"(",
"Adaptable",
"adaptable",
",",
"Resource",
"targetResource",
")",
"{",
"UrlConfig",
"config",
"=",
"null",
";",
"if",
"(",
"targetResource",
"!=",
"null",
")",
"{",
"config",
"=",
"new",
"UrlConfig",
"(",
... | Get URL configuration for target resource. If this is invalid or not available, get it from adaptable.
@param adaptable Adaptable (request or resource)
@param targetResource Target resource (may be null)
@return Url config (never null) | [
"Get",
"URL",
"configuration",
"for",
"target",
"resource",
".",
"If",
"this",
"is",
"invalid",
"or",
"not",
"available",
"get",
"it",
"from",
"adaptable",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/impl/modes/AbstractUrlMode.java#L69-L78 |
109,549 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/MediaFormatBuilder.java | MediaFormatBuilder.build | public @NotNull MediaFormat build() {
if (this.name == null) {
throw new IllegalArgumentException("Name is missing.");
}
return new MediaFormat(
name,
label,
description,
width,
minWidth,
maxWidth,
height,
minHeight,
maxHeight,
... | java | public @NotNull MediaFormat build() {
if (this.name == null) {
throw new IllegalArgumentException("Name is missing.");
}
return new MediaFormat(
name,
label,
description,
width,
minWidth,
maxWidth,
height,
minHeight,
maxHeight,
... | [
"public",
"@",
"NotNull",
"MediaFormat",
"build",
"(",
")",
"{",
"if",
"(",
"this",
".",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Name is missing.\"",
")",
";",
"}",
"return",
"new",
"MediaFormat",
"(",
"name",
",... | Builds the media format definition.
@return Media format definition | [
"Builds",
"the",
"media",
"format",
"definition",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/MediaFormatBuilder.java#L300-L324 |
109,550 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/DamAsset.java | DamAsset.getDamRendition | protected Rendition getDamRendition(MediaArgs mediaArgs) {
return new DamRendition(this.damAsset, this.cropDimension, this.rotation, mediaArgs, adaptable);
} | java | protected Rendition getDamRendition(MediaArgs mediaArgs) {
return new DamRendition(this.damAsset, this.cropDimension, this.rotation, mediaArgs, adaptable);
} | [
"protected",
"Rendition",
"getDamRendition",
"(",
"MediaArgs",
"mediaArgs",
")",
"{",
"return",
"new",
"DamRendition",
"(",
"this",
".",
"damAsset",
",",
"this",
".",
"cropDimension",
",",
"this",
".",
"rotation",
",",
"mediaArgs",
",",
"adaptable",
")",
";",
... | Get DAM rendition instance.
@param mediaArgs Media args
@return DAM rendition instance (may be invalid rendition) | [
"Get",
"DAM",
"rendition",
"instance",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/DamAsset.java#L161-L163 |
109,551 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java | ResponsiveImageMediaMarkupBuilder.getImageElement | protected HtmlElement<?> getImageElement(Media media) {
Image img = new Image();
// Alternative text
Asset asset = media.getAsset();
String altText = null;
if (asset != null) {
altText = asset.getAltText();
}
if (StringUtils.isNotEmpty(altText)) {
img.setAlt(altText);
}
... | java | protected HtmlElement<?> getImageElement(Media media) {
Image img = new Image();
// Alternative text
Asset asset = media.getAsset();
String altText = null;
if (asset != null) {
altText = asset.getAltText();
}
if (StringUtils.isNotEmpty(altText)) {
img.setAlt(altText);
}
... | [
"protected",
"HtmlElement",
"<",
"?",
">",
"getImageElement",
"(",
"Media",
"media",
")",
"{",
"Image",
"img",
"=",
"new",
"Image",
"(",
")",
";",
"// Alternative text",
"Asset",
"asset",
"=",
"media",
".",
"getAsset",
"(",
")",
";",
"String",
"altText",
... | Create an IMG element with alt text.
@param media Media metadata
@return IMG element with properties | [
"Create",
"an",
"IMG",
"element",
"with",
"alt",
"text",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java#L95-L109 |
109,552 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java | ResponsiveImageMediaMarkupBuilder.setResponsiveImageSource | protected void setResponsiveImageSource(HtmlElement<?> mediaElement, JSONArray responsiveImageSources, Media media) {
mediaElement.setData(PROP_RESPONSIVE_SOURCES, responsiveImageSources.toString());
} | java | protected void setResponsiveImageSource(HtmlElement<?> mediaElement, JSONArray responsiveImageSources, Media media) {
mediaElement.setData(PROP_RESPONSIVE_SOURCES, responsiveImageSources.toString());
} | [
"protected",
"void",
"setResponsiveImageSource",
"(",
"HtmlElement",
"<",
"?",
">",
"mediaElement",
",",
"JSONArray",
"responsiveImageSources",
",",
"Media",
"media",
")",
"{",
"mediaElement",
".",
"setData",
"(",
"PROP_RESPONSIVE_SOURCES",
",",
"responsiveImageSources"... | Set attribute on media element for responsive image sources
@param mediaElement Media element
@param responsiveImageSources Responsive image sources JSON metadata
@param media Media | [
"Set",
"attribute",
"on",
"media",
"element",
"for",
"responsive",
"image",
"sources"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java#L151-L153 |
109,553 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/DummyResponsiveImageMediaMarkupBuilder.java | DummyResponsiveImageMediaMarkupBuilder.getImageElement | protected HtmlElement<?> getImageElement(Media media) {
Image img = new Image().addCssClass(MediaNameConstants.CSS_DUMMYIMAGE);
return img;
} | java | protected HtmlElement<?> getImageElement(Media media) {
Image img = new Image().addCssClass(MediaNameConstants.CSS_DUMMYIMAGE);
return img;
} | [
"protected",
"HtmlElement",
"<",
"?",
">",
"getImageElement",
"(",
"Media",
"media",
")",
"{",
"Image",
"img",
"=",
"new",
"Image",
"(",
")",
".",
"addCssClass",
"(",
"MediaNameConstants",
".",
"CSS_DUMMYIMAGE",
")",
";",
"return",
"img",
";",
"}"
] | Create an IMG element.
@param media Media metadata
@return IMG element with properties | [
"Create",
"an",
"IMG",
"element",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/DummyResponsiveImageMediaMarkupBuilder.java#L111-L114 |
109,554 | wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/AbstractHtmlElementFactory.java | AbstractHtmlElementFactory.createComment | public HtmlComment createComment(String text) {
HtmlComment comment = new HtmlComment(text);
this.addContent(comment);
return comment;
} | java | public HtmlComment createComment(String text) {
HtmlComment comment = new HtmlComment(text);
this.addContent(comment);
return comment;
} | [
"public",
"HtmlComment",
"createComment",
"(",
"String",
"text",
")",
"{",
"HtmlComment",
"comment",
"=",
"new",
"HtmlComment",
"(",
"text",
")",
";",
"this",
".",
"addContent",
"(",
"comment",
")",
";",
"return",
"comment",
";",
"}"
] | Creates and adds html comment.
@param text Comment
@return Html comment. | [
"Creates",
"and",
"adds",
"html",
"comment",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/AbstractHtmlElementFactory.java#L56-L60 |
109,555 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/JcrBinary.java | JcrBinary.isNt | private static boolean isNt(Resource resource, String nodeTypeName) {
if (resource != null) {
return StringUtils.equals(resource.getResourceType(), nodeTypeName);
}
return false;
} | java | private static boolean isNt(Resource resource, String nodeTypeName) {
if (resource != null) {
return StringUtils.equals(resource.getResourceType(), nodeTypeName);
}
return false;
} | [
"private",
"static",
"boolean",
"isNt",
"(",
"Resource",
"resource",
",",
"String",
"nodeTypeName",
")",
"{",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"return",
"StringUtils",
".",
"equals",
"(",
"resource",
".",
"getResourceType",
"(",
")",
",",
"no... | Checks if the given resource is a node with the given node type name
@param resource Resource
@param nodeTypeName Node type name
@return true if resource is of the given node type | [
"Checks",
"if",
"the",
"given",
"resource",
"is",
"a",
"node",
"with",
"the",
"given",
"node",
"type",
"name"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/JcrBinary.java#L86-L91 |
109,556 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.getVideoProfiles | protected List<VideoProfile> getVideoProfiles() {
List<VideoProfile> profiles = new ArrayList<VideoProfile>();
for (String profileName : getVideoProfileNames()) {
VideoProfile profile = VideoProfile.get(resourceResolver, profileName);
if (profile != null) {
profiles.add(profile);
}
... | java | protected List<VideoProfile> getVideoProfiles() {
List<VideoProfile> profiles = new ArrayList<VideoProfile>();
for (String profileName : getVideoProfileNames()) {
VideoProfile profile = VideoProfile.get(resourceResolver, profileName);
if (profile != null) {
profiles.add(profile);
}
... | [
"protected",
"List",
"<",
"VideoProfile",
">",
"getVideoProfiles",
"(",
")",
"{",
"List",
"<",
"VideoProfile",
">",
"profiles",
"=",
"new",
"ArrayList",
"<",
"VideoProfile",
">",
"(",
")",
";",
"for",
"(",
"String",
"profileName",
":",
"getVideoProfileNames",
... | Return video profiles supported by this markup builder.
@return Video profiles | [
"Return",
"video",
"profiles",
"supported",
"by",
"this",
"markup",
"builder",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L105-L117 |
109,557 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.addSources | protected void addSources(Video video, Media media) {
Asset asset = getDamAsset(media);
if (asset == null) {
return;
}
for (VideoProfile profile : getVideoProfiles()) {
com.day.cq.dam.api.Rendition rendition = profile.getRendition(asset);
if (rendition != null) {
video.createS... | java | protected void addSources(Video video, Media media) {
Asset asset = getDamAsset(media);
if (asset == null) {
return;
}
for (VideoProfile profile : getVideoProfiles()) {
com.day.cq.dam.api.Rendition rendition = profile.getRendition(asset);
if (rendition != null) {
video.createS... | [
"protected",
"void",
"addSources",
"(",
"Video",
"video",
",",
"Media",
"media",
")",
"{",
"Asset",
"asset",
"=",
"getDamAsset",
"(",
"media",
")",
";",
"if",
"(",
"asset",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"VideoProfile",
"profil... | Add sources for HTML5 video player
@param video Video
@param media Media metadata | [
"Add",
"sources",
"for",
"HTML5",
"video",
"player"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L159-L173 |
109,558 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.getFlashPlayerElement | protected HtmlElement getFlashPlayerElement(Media media, Dimension dimension) {
Asset asset = getDamAsset(media);
if (asset == null) {
return null;
}
com.day.cq.dam.api.Rendition rendition = asset.getRendition(new PrefixRenditionPicker(VideoConstants.RENDITION_PREFIX + H264_PROFILE));
if (ren... | java | protected HtmlElement getFlashPlayerElement(Media media, Dimension dimension) {
Asset asset = getDamAsset(media);
if (asset == null) {
return null;
}
com.day.cq.dam.api.Rendition rendition = asset.getRendition(new PrefixRenditionPicker(VideoConstants.RENDITION_PREFIX + H264_PROFILE));
if (ren... | [
"protected",
"HtmlElement",
"getFlashPlayerElement",
"(",
"Media",
"media",
",",
"Dimension",
"dimension",
")",
"{",
"Asset",
"asset",
"=",
"getDamAsset",
"(",
"media",
")",
";",
"if",
"(",
"asset",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"com"... | Build flash player element
@param media Media metadata
@param dimension Dimension
@return Media element | [
"Build",
"flash",
"player",
"element"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L181-L226 |
109,559 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.buildFlashVarsString | protected String buildFlashVarsString(Map<String, String> flashVars) {
try {
StringBuilder flashvarsString = new StringBuilder();
Iterator<Map.Entry<String, String>> flashvarsIterator = flashVars.entrySet().iterator();
while (flashvarsIterator.hasNext()) {
Map.Entry<String, String> entry =... | java | protected String buildFlashVarsString(Map<String, String> flashVars) {
try {
StringBuilder flashvarsString = new StringBuilder();
Iterator<Map.Entry<String, String>> flashvarsIterator = flashVars.entrySet().iterator();
while (flashvarsIterator.hasNext()) {
Map.Entry<String, String> entry =... | [
"protected",
"String",
"buildFlashVarsString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"flashVars",
")",
"{",
"try",
"{",
"StringBuilder",
"flashvarsString",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"Strin... | Build flashvars string to be used on HTML object element for flash embedding.
@param flashVars flashvars map
@return flashvars string with proper encoding | [
"Build",
"flashvars",
"string",
"to",
"be",
"used",
"on",
"HTML",
"object",
"element",
"for",
"flash",
"embedding",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L233-L251 |
109,560 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.getAdditionalFlashPlayerParameters | protected Map<String, String> getAdditionalFlashPlayerParameters(Media media, Dimension dimension) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("allowFullScreen", "true");
parameters.put("wmode", "opaque");
return parameters;
} | java | protected Map<String, String> getAdditionalFlashPlayerParameters(Media media, Dimension dimension) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("allowFullScreen", "true");
parameters.put("wmode", "opaque");
return parameters;
} | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"getAdditionalFlashPlayerParameters",
"(",
"Media",
"media",
",",
"Dimension",
"dimension",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"S... | Get additional parameters to be set as <param> elements on html object element for flash player.
@param media Media metadata
@param dimension Dimension
@return Set of key/value pairs | [
"Get",
"additional",
"parameters",
"to",
"be",
"set",
"as",
"<",
";",
"param>",
";",
"elements",
"on",
"html",
"object",
"element",
"for",
"flash",
"player",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L259-L266 |
109,561 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java | DamVideoMediaMarkupBuilder.getAdditionalFlashPlayerFlashVars | protected Map<String, String> getAdditionalFlashPlayerFlashVars(Media media, Dimension dimension) {
Map<String, String> flashvars = new HashMap<String, String>();
flashvars.put("autoPlay", "false");
flashvars.put("loop", "false");
return flashvars;
} | java | protected Map<String, String> getAdditionalFlashPlayerFlashVars(Media media, Dimension dimension) {
Map<String, String> flashvars = new HashMap<String, String>();
flashvars.put("autoPlay", "false");
flashvars.put("loop", "false");
return flashvars;
} | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"getAdditionalFlashPlayerFlashVars",
"(",
"Media",
"media",
",",
"Dimension",
"dimension",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"flashvars",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Str... | Get additional parameters to be set as flashvars parameter on html object element for flash player.
@param media Media metadata
@param dimension Dimension
@return Set of key/value pairs | [
"Get",
"additional",
"parameters",
"to",
"be",
"set",
"as",
"flashvars",
"parameter",
"on",
"html",
"object",
"element",
"for",
"flash",
"player",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/markup/DamVideoMediaMarkupBuilder.java#L274-L281 |
109,562 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/impl/modes/DefaultUrlMode.java | DefaultUrlMode.linksToOtherDomain | private boolean linksToOtherDomain(Adaptable adaptable, Page currentPage, Resource targetResource) {
if (currentPage == null || targetResource == null) {
return false;
}
UrlHandlerConfig urlHandlerConfig = AdaptTo.notNull(adaptable, UrlHandlerConfig.class);
Resource currentResource = AdaptTo.notN... | java | private boolean linksToOtherDomain(Adaptable adaptable, Page currentPage, Resource targetResource) {
if (currentPage == null || targetResource == null) {
return false;
}
UrlHandlerConfig urlHandlerConfig = AdaptTo.notNull(adaptable, UrlHandlerConfig.class);
Resource currentResource = AdaptTo.notN... | [
"private",
"boolean",
"linksToOtherDomain",
"(",
"Adaptable",
"adaptable",
",",
"Page",
"currentPage",
",",
"Resource",
"targetResource",
")",
"{",
"if",
"(",
"currentPage",
"==",
"null",
"||",
"targetResource",
"==",
"null",
")",
"{",
"return",
"false",
";",
... | Checks if the target resource is located outsite the current site, and if for this other
resource context a valid url configuration with a specific hostname exists.
@param adaptable Adaptable
@param currentPage Current page (may be null)
@param targetResource Target resource (may be null)
@return true if the target res... | [
"Checks",
"if",
"the",
"target",
"resource",
"is",
"located",
"outsite",
"the",
"current",
"site",
"and",
"if",
"for",
"this",
"other",
"resource",
"context",
"a",
"valid",
"url",
"configuration",
"with",
"a",
"specific",
"hostname",
"exists",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/impl/modes/DefaultUrlMode.java#L79-L98 |
109,563 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.getScaledDimension | private Dimension getScaledDimension(Dimension originalDimension) {
// check if image has to be rescaled
Dimension requestedDimension = getRequestedDimension();
boolean scaleWidth = (requestedDimension.getWidth() > 0
&& requestedDimension.getWidth() != originalDimension.getWidth());
boolean sca... | java | private Dimension getScaledDimension(Dimension originalDimension) {
// check if image has to be rescaled
Dimension requestedDimension = getRequestedDimension();
boolean scaleWidth = (requestedDimension.getWidth() > 0
&& requestedDimension.getWidth() != originalDimension.getWidth());
boolean sca... | [
"private",
"Dimension",
"getScaledDimension",
"(",
"Dimension",
"originalDimension",
")",
"{",
"// check if image has to be rescaled",
"Dimension",
"requestedDimension",
"=",
"getRequestedDimension",
"(",
")",
";",
"boolean",
"scaleWidth",
"=",
"(",
"requestedDimension",
".... | Checks if the current binary is an image and has to be scaled. In this case the destination dimension is returned.
@return Scaled destination or null if no scaling is required. If a destination object with both
width and height set to -1 is returned, a scaling is required but not possible with the given source
object. | [
"Checks",
"if",
"the",
"current",
"binary",
"is",
"an",
"image",
"and",
"has",
"to",
"be",
"scaled",
".",
"In",
"this",
"case",
"the",
"destination",
"dimension",
"is",
"returned",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L150-L187 |
109,564 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.buildMediaUrl | private String buildMediaUrl(Dimension scaledDimension) {
// check for file extension filtering
if (!isMatchingFileExtension()) {
return null;
}
// check if image has to be rescaled
if (scaledDimension != null) {
// check if scaling is not possible
if (scaledDimension.equals(SCA... | java | private String buildMediaUrl(Dimension scaledDimension) {
// check for file extension filtering
if (!isMatchingFileExtension()) {
return null;
}
// check if image has to be rescaled
if (scaledDimension != null) {
// check if scaling is not possible
if (scaledDimension.equals(SCA... | [
"private",
"String",
"buildMediaUrl",
"(",
"Dimension",
"scaledDimension",
")",
"{",
"// check for file extension filtering",
"if",
"(",
"!",
"isMatchingFileExtension",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"// check if image has to be rescaled",
"if",
"(",
... | Build media URL for this rendition - either "native" URL to repository or virtual url to rescaled version.
@return Media URL - null if no rendition is available | [
"Build",
"media",
"URL",
"for",
"this",
"rendition",
"-",
"either",
"native",
"URL",
"to",
"repository",
"or",
"virtual",
"url",
"to",
"rescaled",
"version",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L193-L225 |
109,565 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.buildNativeMediaUrl | private String buildNativeMediaUrl() {
String path = null;
Resource parentResource = this.resource.getParent();
if (JcrBinary.isNtFile(parentResource)) {
// if parent resource is nt:file and its node name equals the detected filename, directly use the nt:file node path
if (StringUtils.equals(pa... | java | private String buildNativeMediaUrl() {
String path = null;
Resource parentResource = this.resource.getParent();
if (JcrBinary.isNtFile(parentResource)) {
// if parent resource is nt:file and its node name equals the detected filename, directly use the nt:file node path
if (StringUtils.equals(pa... | [
"private",
"String",
"buildNativeMediaUrl",
"(",
")",
"{",
"String",
"path",
"=",
"null",
";",
"Resource",
"parentResource",
"=",
"this",
".",
"resource",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"JcrBinary",
".",
"isNtFile",
"(",
"parentResource",
")",
... | Builds "native" URL that returns the binary data directly from the repository.
@return Media URL | [
"Builds",
"native",
"URL",
"that",
"returns",
"the",
"binary",
"data",
"directly",
"from",
"the",
"repository",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L231-L253 |
109,566 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.isMatchingFileExtension | private boolean isMatchingFileExtension() {
String[] fileExtensions = mediaArgs.getFileExtensions();
if (fileExtensions == null || fileExtensions.length == 0) {
return true;
}
for (String fileExtension : fileExtensions) {
if (StringUtils.equalsIgnoreCase(fileExtension, getFileExtension())) {... | java | private boolean isMatchingFileExtension() {
String[] fileExtensions = mediaArgs.getFileExtensions();
if (fileExtensions == null || fileExtensions.length == 0) {
return true;
}
for (String fileExtension : fileExtensions) {
if (StringUtils.equalsIgnoreCase(fileExtension, getFileExtension())) {... | [
"private",
"boolean",
"isMatchingFileExtension",
"(",
")",
"{",
"String",
"[",
"]",
"fileExtensions",
"=",
"mediaArgs",
".",
"getFileExtensions",
"(",
")",
";",
"if",
"(",
"fileExtensions",
"==",
"null",
"||",
"fileExtensions",
".",
"length",
"==",
"0",
")",
... | Checks if the file extension of the current binary matches with the requested extensions from the media args.
@return true if file extension matches | [
"Checks",
"if",
"the",
"file",
"extension",
"of",
"the",
"current",
"binary",
"matches",
"with",
"the",
"requested",
"extensions",
"from",
"the",
"media",
"args",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L309-L320 |
109,567 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.getRequestedDimension | private Dimension getRequestedDimension() {
// check for fixed dimensions from media args
if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
return new Dimension(mediaArgs.getFixedWidth(), mediaArgs.getFixedHeight());
}
// check for dimensions from mediaformat (evaluate only ... | java | private Dimension getRequestedDimension() {
// check for fixed dimensions from media args
if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
return new Dimension(mediaArgs.getFixedWidth(), mediaArgs.getFixedHeight());
}
// check for dimensions from mediaformat (evaluate only ... | [
"private",
"Dimension",
"getRequestedDimension",
"(",
")",
"{",
"// check for fixed dimensions from media args",
"if",
"(",
"mediaArgs",
".",
"getFixedWidth",
"(",
")",
">",
"0",
"||",
"mediaArgs",
".",
"getFixedHeight",
"(",
")",
">",
"0",
")",
"{",
"return",
"... | Requested dimensions either from media format or fixed dimensions from media args.
@return Requested dimensions | [
"Requested",
"dimensions",
"either",
"from",
"media",
"format",
"or",
"fixed",
"dimensions",
"from",
"media",
"args",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L326-L344 |
109,568 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java | SuffixParser.getResources | public @NotNull List<Resource> getResources() {
return getResources((Predicate<Resource>)null, (Resource)null);
} | java | public @NotNull List<Resource> getResources() {
return getResources((Predicate<Resource>)null, (Resource)null);
} | [
"public",
"@",
"NotNull",
"List",
"<",
"Resource",
">",
"getResources",
"(",
")",
"{",
"return",
"getResources",
"(",
"(",
"Predicate",
"<",
"Resource",
">",
")",
"null",
",",
"(",
"Resource",
")",
"null",
")",
";",
"}"
] | Get the resources within the current page selected in the suffix of the URL
@return a list containing the Resources | [
"Get",
"the",
"resources",
"within",
"the",
"current",
"page",
"selected",
"in",
"the",
"suffix",
"of",
"the",
"URL"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L232-L234 |
109,569 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/SuffixBuilder.java | SuffixBuilder.build | public @NotNull String build() {
SortedMap<String, Object> sortedParameterMap = new TreeMap<>(parameterMap);
// gather resource paths in a treeset (having them in a defined order helps with caching)
SortedSet<String> resourcePathsSet = new TreeSet<>();
// iterate over all parts that should be kept fro... | java | public @NotNull String build() {
SortedMap<String, Object> sortedParameterMap = new TreeMap<>(parameterMap);
// gather resource paths in a treeset (having them in a defined order helps with caching)
SortedSet<String> resourcePathsSet = new TreeSet<>();
// iterate over all parts that should be kept fro... | [
"public",
"@",
"NotNull",
"String",
"build",
"(",
")",
"{",
"SortedMap",
"<",
"String",
",",
"Object",
">",
"sortedParameterMap",
"=",
"new",
"TreeMap",
"<>",
"(",
"parameterMap",
")",
";",
"// gather resource paths in a treeset (having them in a defined order helps wit... | Build complete suffix.
@return the suffix | [
"Build",
"complete",
"suffix",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixBuilder.java#L294-L347 |
109,570 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java | IntegratorHandlerImpl.detectIntegratorTemplateModes | private void detectIntegratorTemplateModes() {
// integrator mode cannot be active if no modes defined
if (urlHandlerConfig.getIntegratorModes().isEmpty()) {
return;
}
if (request != null && RequestPath.hasSelector(request, SELECTOR_INTEGRATORTEMPLATE_SECURE)) {
integratorTemplateSecureMode ... | java | private void detectIntegratorTemplateModes() {
// integrator mode cannot be active if no modes defined
if (urlHandlerConfig.getIntegratorModes().isEmpty()) {
return;
}
if (request != null && RequestPath.hasSelector(request, SELECTOR_INTEGRATORTEMPLATE_SECURE)) {
integratorTemplateSecureMode ... | [
"private",
"void",
"detectIntegratorTemplateModes",
"(",
")",
"{",
"// integrator mode cannot be active if no modes defined",
"if",
"(",
"urlHandlerConfig",
".",
"getIntegratorModes",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"requ... | Detect integrator template modes - check selectors in current url. | [
"Detect",
"integrator",
"template",
"modes",
"-",
"check",
"selectors",
"in",
"current",
"url",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java#L75-L86 |
109,571 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java | IntegratorHandlerImpl.getIntegratorTemplateSelector | @Override
public @NotNull String getIntegratorTemplateSelector() {
if (currentPage != null && urlHandlerConfig.isIntegrator(currentPage)) {
if (isResourceUrlSecure(currentPage)) {
return SELECTOR_INTEGRATORTEMPLATE_SECURE;
}
else {
return SELECTOR_INTEGRATORTEMPLATE;
}
... | java | @Override
public @NotNull String getIntegratorTemplateSelector() {
if (currentPage != null && urlHandlerConfig.isIntegrator(currentPage)) {
if (isResourceUrlSecure(currentPage)) {
return SELECTOR_INTEGRATORTEMPLATE_SECURE;
}
else {
return SELECTOR_INTEGRATORTEMPLATE;
}
... | [
"@",
"Override",
"public",
"@",
"NotNull",
"String",
"getIntegratorTemplateSelector",
"(",
")",
"{",
"if",
"(",
"currentPage",
"!=",
"null",
"&&",
"urlHandlerConfig",
".",
"isIntegrator",
"(",
"currentPage",
")",
")",
"{",
"if",
"(",
"isResourceUrlSecure",
"(",
... | Returns selector for integrator template mode.
In HTTPS mode the secure selector is returned, otherwise the default selector.
HTTPS mode is active if the current page is an integrator page and has simple mode-HTTPs activated, or
the secure integrator mode selector is included in the current request.
@return Integrator ... | [
"Returns",
"selector",
"for",
"integrator",
"template",
"mode",
".",
"In",
"HTTPS",
"mode",
"the",
"secure",
"selector",
"is",
"returned",
"otherwise",
"the",
"default",
"selector",
".",
"HTTPS",
"mode",
"is",
"active",
"if",
"the",
"current",
"page",
"is",
... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java#L113-L129 |
109,572 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java | IntegratorHandlerImpl.getIntegratorMode | @SuppressWarnings("null")
private @NotNull IntegratorMode getIntegratorMode(ValueMap properties) {
IntegratorMode mode = null;
Collection<IntegratorMode> integratorModes = urlHandlerConfig.getIntegratorModes();
String modeString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_MODE, String.class);
... | java | @SuppressWarnings("null")
private @NotNull IntegratorMode getIntegratorMode(ValueMap properties) {
IntegratorMode mode = null;
Collection<IntegratorMode> integratorModes = urlHandlerConfig.getIntegratorModes();
String modeString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_MODE, String.class);
... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"private",
"@",
"NotNull",
"IntegratorMode",
"getIntegratorMode",
"(",
"ValueMap",
"properties",
")",
"{",
"IntegratorMode",
"mode",
"=",
"null",
";",
"Collection",
"<",
"IntegratorMode",
">",
"integratorModes",
"=",
... | Read integrator mode from content container. Defaults to first integrator mode defined.
@param properties Content container
@return Integrator mode | [
"Read",
"integrator",
"mode",
"from",
"content",
"container",
".",
"Defaults",
"to",
"first",
"integrator",
"mode",
"defined",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java#L152-L170 |
109,573 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java | IntegratorHandlerImpl.getIntegratorProtocol | @SuppressWarnings("null")
private IntegratorProtocol getIntegratorProtocol(ValueMap properties) {
IntegratorProtocol protocol = IntegratorProtocol.AUTO;
try {
String protocolString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_PROTOCOL, String.class);
if (StringUtils.isNotEmpty(protocolSt... | java | @SuppressWarnings("null")
private IntegratorProtocol getIntegratorProtocol(ValueMap properties) {
IntegratorProtocol protocol = IntegratorProtocol.AUTO;
try {
String protocolString = properties.get(IntegratorNameConstants.PN_INTEGRATOR_PROTOCOL, String.class);
if (StringUtils.isNotEmpty(protocolSt... | [
"@",
"SuppressWarnings",
"(",
"\"null\"",
")",
"private",
"IntegratorProtocol",
"getIntegratorProtocol",
"(",
"ValueMap",
"properties",
")",
"{",
"IntegratorProtocol",
"protocol",
"=",
"IntegratorProtocol",
".",
"AUTO",
";",
"try",
"{",
"String",
"protocolString",
"="... | Read integrator protocol from content container. Default to AUTO.
@param properties Content container
@return Integrator protocol | [
"Read",
"integrator",
"protocol",
"from",
"content",
"container",
".",
"Default",
"to",
"AUTO",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java#L177-L190 |
109,574 | wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java | IntegratorHandlerImpl.isResourceUrlSecure | private boolean isResourceUrlSecure(Page page) {
ValueMap props = getPagePropertiesNullSafe(page);
IntegratorMode mode = getIntegratorMode(props);
if (mode.isDetectProtocol()) {
IntegratorProtocol integratorProtocol = getIntegratorProtocol(props);
if (integratorProtocol == IntegratorProtocol.HTT... | java | private boolean isResourceUrlSecure(Page page) {
ValueMap props = getPagePropertiesNullSafe(page);
IntegratorMode mode = getIntegratorMode(props);
if (mode.isDetectProtocol()) {
IntegratorProtocol integratorProtocol = getIntegratorProtocol(props);
if (integratorProtocol == IntegratorProtocol.HTT... | [
"private",
"boolean",
"isResourceUrlSecure",
"(",
"Page",
"page",
")",
"{",
"ValueMap",
"props",
"=",
"getPagePropertiesNullSafe",
"(",
"page",
")",
";",
"IntegratorMode",
"mode",
"=",
"getIntegratorMode",
"(",
"props",
")",
";",
"if",
"(",
"mode",
".",
"isDet... | Checks whether resource URLs should be rendered in secure mode or not.
@return true if resource URLs should be rendered in secure mode | [
"Checks",
"whether",
"resource",
"URLs",
"should",
"be",
"rendered",
"in",
"secure",
"mode",
"or",
"not",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/integrator/impl/IntegratorHandlerImpl.java#L196-L210 |
109,575 | wcm-io/wcm-io-handler | link/src/main/java/io/wcm/handler/link/type/helpers/InternalLinkResolver.java | InternalLinkResolver.getTargetPage | private Page getTargetPage(String targetPath, InternalLinkResolverOptions options) {
if (StringUtils.isEmpty(targetPath)) {
return null;
}
// Rewrite target to current site context
String rewrittenPath;
if (options.isRewritePathToContext() && !useTargetContext(options)) {
rewrittenPath... | java | private Page getTargetPage(String targetPath, InternalLinkResolverOptions options) {
if (StringUtils.isEmpty(targetPath)) {
return null;
}
// Rewrite target to current site context
String rewrittenPath;
if (options.isRewritePathToContext() && !useTargetContext(options)) {
rewrittenPath... | [
"private",
"Page",
"getTargetPage",
"(",
"String",
"targetPath",
",",
"InternalLinkResolverOptions",
"options",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"targetPath",
")",
")",
"{",
"return",
"null",
";",
"}",
"// Rewrite target to current site conte... | Returns the target page for the given internal content link reference.
Checks validity of page.
@param targetPath Repository path
@return Target page or null if target reference is invalid. | [
"Returns",
"the",
"target",
"page",
"for",
"the",
"given",
"internal",
"content",
"link",
"reference",
".",
"Checks",
"validity",
"of",
"page",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/type/helpers/InternalLinkResolver.java#L244-L270 |
109,576 | wcm-io/wcm-io-handler | link/src/main/java/io/wcm/handler/link/type/helpers/InternalLinkResolver.java | InternalLinkResolver.useTargetContext | private boolean useTargetContext(InternalLinkResolverOptions options) {
if (options.isUseTargetContext() && !options.isRewritePathToContext()) {
return true;
}
// even is use target context is not activated use it if current page is an experience fragment
// otherwise it will be always impossible ... | java | private boolean useTargetContext(InternalLinkResolverOptions options) {
if (options.isUseTargetContext() && !options.isRewritePathToContext()) {
return true;
}
// even is use target context is not activated use it if current page is an experience fragment
// otherwise it will be always impossible ... | [
"private",
"boolean",
"useTargetContext",
"(",
"InternalLinkResolverOptions",
"options",
")",
"{",
"if",
"(",
"options",
".",
"isUseTargetContext",
"(",
")",
"&&",
"!",
"options",
".",
"isRewritePathToContext",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"... | Checks if target context should be used.
@param options Link resolver options
@return true if target context should be used | [
"Checks",
"if",
"target",
"context",
"should",
"be",
"used",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/type/helpers/InternalLinkResolver.java#L277-L287 |
109,577 | wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java | HtmlElement.addCssClass | public final T addCssClass(String value) {
if (StringUtils.isNotEmpty(value)) {
return setCssClass(StringUtils.isNotEmpty(getCssClass()) ? getCssClass() + " " + value : value);
}
else {
return (T)this;
}
} | java | public final T addCssClass(String value) {
if (StringUtils.isNotEmpty(value)) {
return setCssClass(StringUtils.isNotEmpty(getCssClass()) ? getCssClass() + " " + value : value);
}
else {
return (T)this;
}
} | [
"public",
"final",
"T",
"addCssClass",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"value",
")",
")",
"{",
"return",
"setCssClass",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"getCssClass",
"(",
")",
")",
"?",
"ge... | Html "class" attribute. Adds a single, space-separated value while preserving existing ones.
@param value Value of attribute
@return Self reference | [
"Html",
"class",
"attribute",
".",
"Adds",
"a",
"single",
"space",
"-",
"separated",
"value",
"while",
"preserving",
"existing",
"ones",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java#L131-L138 |
109,578 | wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java | HtmlElement.getStyles | public final Map<String, String> getStyles() {
Map<String, String> styleMap = new HashMap<String, String>();
// de-serialize style string, fill style map
String styleString = getStyleString();
if (styleString != null) {
String[] styles = StringUtils.split(styleString, ";");
for (String styl... | java | public final Map<String, String> getStyles() {
Map<String, String> styleMap = new HashMap<String, String>();
// de-serialize style string, fill style map
String styleString = getStyleString();
if (styleString != null) {
String[] styles = StringUtils.split(styleString, ";");
for (String styl... | [
"public",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"getStyles",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"styleMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"// de-serialize style string, fill styl... | Html "style" attribute.
@return Returns map of style key/value pairs. | [
"Html",
"style",
"attribute",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java#L152-L168 |
109,579 | wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java | HtmlElement.setStyle | public final T setStyle(String styleAttribute, String styleValue) {
// Add style to style map
Map<String, String> styleMap = getStyles();
styleMap.put(styleAttribute, styleValue);
// Serialize style string
StringBuilder styleString = new StringBuilder();
for (Map.Entry style : styleMap.entrySe... | java | public final T setStyle(String styleAttribute, String styleValue) {
// Add style to style map
Map<String, String> styleMap = getStyles();
styleMap.put(styleAttribute, styleValue);
// Serialize style string
StringBuilder styleString = new StringBuilder();
for (Map.Entry style : styleMap.entrySe... | [
"public",
"final",
"T",
"setStyle",
"(",
"String",
"styleAttribute",
",",
"String",
"styleValue",
")",
"{",
"// Add style to style map",
"Map",
"<",
"String",
",",
"String",
">",
"styleMap",
"=",
"getStyles",
"(",
")",
";",
"styleMap",
".",
"put",
"(",
"styl... | Html "style" attribute. Sets single style attribute value.
@param styleAttribute Style attribute name
@param styleValue Style attribute value
@return Self reference | [
"Html",
"style",
"attribute",
".",
"Sets",
"single",
"style",
"attribute",
"value",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/HtmlElement.java#L195-L211 |
109,580 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/MediaFormat.java | MediaFormat.guessHumanReadableRatioString | private static String guessHumanReadableRatioString(double ratio, NumberFormat numberFormat) {
for (long width = 1; width <= 50; width++) {
double height = width / ratio;
if (isLong(height)) {
return numberFormat.format(width) + ":" + numberFormat.format(height);
}
}
for (long widt... | java | private static String guessHumanReadableRatioString(double ratio, NumberFormat numberFormat) {
for (long width = 1; width <= 50; width++) {
double height = width / ratio;
if (isLong(height)) {
return numberFormat.format(width) + ":" + numberFormat.format(height);
}
}
for (long widt... | [
"private",
"static",
"String",
"guessHumanReadableRatioString",
"(",
"double",
"ratio",
",",
"NumberFormat",
"numberFormat",
")",
"{",
"for",
"(",
"long",
"width",
"=",
"1",
";",
"width",
"<=",
"50",
";",
"width",
"++",
")",
"{",
"double",
"height",
"=",
"... | Try to guess a nice human readable ratio string from the given decimal ratio
@param ratio Ratio
@param numberFormat Number format
@return Ratio display string or null if no nice string was found | [
"Try",
"to",
"guess",
"a",
"nice",
"human",
"readable",
"ratio",
"string",
"from",
"the",
"given",
"decimal",
"ratio"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/MediaFormat.java#L265-L279 |
109,581 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/MediaFormat.java | MediaFormat.getMinDimension | public Dimension getMinDimension() {
long effWithMin = getEffectiveMinWidth();
long effHeightMin = getEffectiveMinHeight();
double effRatio = getRatio();
if (effWithMin == 0 && effHeightMin > 0 && effRatio > 0) {
effWithMin = Math.round(effHeightMin * effRatio);
}
if (effWithMin > 0 && ef... | java | public Dimension getMinDimension() {
long effWithMin = getEffectiveMinWidth();
long effHeightMin = getEffectiveMinHeight();
double effRatio = getRatio();
if (effWithMin == 0 && effHeightMin > 0 && effRatio > 0) {
effWithMin = Math.round(effHeightMin * effRatio);
}
if (effWithMin > 0 && ef... | [
"public",
"Dimension",
"getMinDimension",
"(",
")",
"{",
"long",
"effWithMin",
"=",
"getEffectiveMinWidth",
"(",
")",
";",
"long",
"effHeightMin",
"=",
"getEffectiveMinHeight",
"(",
")",
";",
"double",
"effRatio",
"=",
"getRatio",
"(",
")",
";",
"if",
"(",
"... | Get minimum dimensions for media format. If only with or height is defined the missing dimensions
is calculated from the ratio. If no ratio defined either only width or height dimension is returned.
If neither width or height are defined null is returned.
@return Min. dimensions or null | [
"Get",
"minimum",
"dimensions",
"for",
"media",
"format",
".",
"If",
"only",
"with",
"or",
"height",
"is",
"defined",
"the",
"missing",
"dimensions",
"is",
"calculated",
"from",
"the",
"ratio",
".",
"If",
"no",
"ratio",
"defined",
"either",
"only",
"width",
... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/MediaFormat.java#L432-L450 |
109,582 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/MediaFormatResolver.java | MediaFormatResolver.resolveByNames | private boolean resolveByNames(MediaArgs mediaArgs) {
// resolved media formats already set? done.
if (mediaArgs.getMediaFormats() != null) {
return true;
}
// no media format names present? done.
if (mediaArgs.getMediaFormatNames() == null) {
return true;
}
String[] mediaFormatN... | java | private boolean resolveByNames(MediaArgs mediaArgs) {
// resolved media formats already set? done.
if (mediaArgs.getMediaFormats() != null) {
return true;
}
// no media format names present? done.
if (mediaArgs.getMediaFormatNames() == null) {
return true;
}
String[] mediaFormatN... | [
"private",
"boolean",
"resolveByNames",
"(",
"MediaArgs",
"mediaArgs",
")",
"{",
"// resolved media formats already set? done.",
"if",
"(",
"mediaArgs",
".",
"getMediaFormats",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"true",
";",
"}",
"// no media format names pre... | Resolve media format names to media formats so all downstream logic has only to handle the resolved media formats.
If resolving fails an exception is thrown.
@param mediaArgs Media args
@return true if resolution was successful. | [
"Resolve",
"media",
"format",
"names",
"to",
"media",
"formats",
"so",
"all",
"downstream",
"logic",
"has",
"only",
"to",
"handle",
"the",
"resolved",
"media",
"formats",
".",
"If",
"resolving",
"fails",
"an",
"exception",
"is",
"thrown",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/MediaFormatResolver.java#L69-L91 |
109,583 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/MediaFormatResolver.java | MediaFormatResolver.addResponsiveImageMediaFormats | private boolean addResponsiveImageMediaFormats(MediaArgs mediaArgs) {
Map<String, MediaFormat> additionalMediaFormats = new LinkedHashMap<>();
// check if additional on-the-fly generated media formats needs to be added for responsive image handling
if (!resolveForImageSizes(mediaArgs, additionalMediaFormat... | java | private boolean addResponsiveImageMediaFormats(MediaArgs mediaArgs) {
Map<String, MediaFormat> additionalMediaFormats = new LinkedHashMap<>();
// check if additional on-the-fly generated media formats needs to be added for responsive image handling
if (!resolveForImageSizes(mediaArgs, additionalMediaFormat... | [
"private",
"boolean",
"addResponsiveImageMediaFormats",
"(",
"MediaArgs",
"mediaArgs",
")",
"{",
"Map",
"<",
"String",
",",
"MediaFormat",
">",
"additionalMediaFormats",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"// check if additional on-the-fly generated media f... | Add on-the-fly generated media formats if required for responsive image handling
via image sizes or picture sources.
@param mediaArgs Media args
@return true if resolution was successful | [
"Add",
"on",
"-",
"the",
"-",
"fly",
"generated",
"media",
"formats",
"if",
"required",
"for",
"responsive",
"image",
"handling",
"via",
"image",
"sizes",
"or",
"picture",
"sources",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/MediaFormatResolver.java#L99-L121 |
109,584 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java | InlineMediaSource.getInlineAsset | private Asset getInlineAsset(Resource ntResourceResource, Media media, String fileName) {
return new InlineAsset(ntResourceResource, media, fileName, adaptable);
} | java | private Asset getInlineAsset(Resource ntResourceResource, Media media, String fileName) {
return new InlineAsset(ntResourceResource, media, fileName, adaptable);
} | [
"private",
"Asset",
"getInlineAsset",
"(",
"Resource",
"ntResourceResource",
",",
"Media",
"media",
",",
"String",
"fileName",
")",
"{",
"return",
"new",
"InlineAsset",
"(",
"ntResourceResource",
",",
"media",
",",
"fileName",
",",
"adaptable",
")",
";",
"}"
] | Get implementation of inline media item
@param ntResourceResource nt:resource node
@param media Media metadata
@param fileName File name
@return Inline media item instance | [
"Get",
"implementation",
"of",
"inline",
"media",
"item"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java#L170-L172 |
109,585 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java | InlineMediaSource.detectFileName | private String detectFileName(Resource referencedResource, Resource ntFileResource,
Resource ntResourceResource) {
// detect file name
String fileName = null;
// if referenced resource is not the nt:file node check for <nodename>Name property
if (ntFileResource != null && !referencedResource.equal... | java | private String detectFileName(Resource referencedResource, Resource ntFileResource,
Resource ntResourceResource) {
// detect file name
String fileName = null;
// if referenced resource is not the nt:file node check for <nodename>Name property
if (ntFileResource != null && !referencedResource.equal... | [
"private",
"String",
"detectFileName",
"(",
"Resource",
"referencedResource",
",",
"Resource",
"ntFileResource",
",",
"Resource",
"ntResourceResource",
")",
"{",
"// detect file name",
"String",
"fileName",
"=",
"null",
";",
"// if referenced resource is not the nt:file node ... | Detect filename for inline binary.
@param referencedResource Resource that was referenced in media reference and may contain file name property.
@param ntFileResource nt:file resource (optional, null if not existent)
@param ntResourceResource nt:resource resource
@return Detected or virtual filename. Never null. | [
"Detect",
"filename",
"for",
"inline",
"binary",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java#L181-L218 |
109,586 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java | InlineMediaSource.cleanupFileName | private String cleanupFileName(String fileName) {
String processedFileName = fileName;
// strip off path parts
if (StringUtils.contains(processedFileName, "/")) {
processedFileName = StringUtils.substringAfterLast(processedFileName, "/");
}
if (StringUtils.contains(processedFileName, "\\")) {... | java | private String cleanupFileName(String fileName) {
String processedFileName = fileName;
// strip off path parts
if (StringUtils.contains(processedFileName, "/")) {
processedFileName = StringUtils.substringAfterLast(processedFileName, "/");
}
if (StringUtils.contains(processedFileName, "\\")) {... | [
"private",
"String",
"cleanupFileName",
"(",
"String",
"fileName",
")",
"{",
"String",
"processedFileName",
"=",
"fileName",
";",
"// strip off path parts",
"if",
"(",
"StringUtils",
".",
"contains",
"(",
"processedFileName",
",",
"\"/\"",
")",
")",
"{",
"processe... | Make sure filename contains no invalid characters or path parts
@param fileName File name
@return Cleaned up file name | [
"Make",
"sure",
"filename",
"contains",
"no",
"invalid",
"characters",
"or",
"path",
"parts"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineMediaSource.java#L225-L240 |
109,587 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java | MediaFormatHandlerImpl.isRenditionMatchSizeSameBigger | private boolean isRenditionMatchSizeSameBigger(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMax = mediaFormat.getEffectiveMaxWidth();
long he... | java | private boolean isRenditionMatchSizeSameBigger(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMax = mediaFormat.getEffectiveMaxWidth();
long he... | [
"private",
"boolean",
"isRenditionMatchSizeSameBigger",
"(",
"MediaFormat",
"mediaFormat",
",",
"MediaFormat",
"mediaFormatRequested",
")",
"{",
"long",
"widthRequested",
"=",
"mediaFormatRequested",
".",
"getEffectiveMinWidth",
"(",
")",
";",
"long",
"heightRequested",
"... | Checks if the given media format size is same size or bigger than the requested one.
@param mediaFormat Media format
@param mediaFormatRequested Requested media format
@return true if media format is same size or bigger | [
"Checks",
"if",
"the",
"given",
"media",
"format",
"size",
"is",
"same",
"size",
"or",
"bigger",
"than",
"the",
"requested",
"one",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java#L211-L220 |
109,588 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java | MediaFormatHandlerImpl.isRenditionMatchSizeSameSmaller | private boolean isRenditionMatchSizeSameSmaller(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMin = mediaFormat.getEffectiveMinWidth();
long h... | java | private boolean isRenditionMatchSizeSameSmaller(MediaFormat mediaFormat, MediaFormat mediaFormatRequested) {
long widthRequested = mediaFormatRequested.getEffectiveMinWidth();
long heightRequested = mediaFormatRequested.getEffectiveMinHeight();
long widthMin = mediaFormat.getEffectiveMinWidth();
long h... | [
"private",
"boolean",
"isRenditionMatchSizeSameSmaller",
"(",
"MediaFormat",
"mediaFormat",
",",
"MediaFormat",
"mediaFormatRequested",
")",
"{",
"long",
"widthRequested",
"=",
"mediaFormatRequested",
".",
"getEffectiveMinWidth",
"(",
")",
";",
"long",
"heightRequested",
... | Checks if the given media format size is same size or smaller than the requested one.
@param mediaFormat Media format
@param mediaFormatRequested Requested media format
@return true if media format is same size or smaller | [
"Checks",
"if",
"the",
"given",
"media",
"format",
"size",
"is",
"same",
"size",
"or",
"smaller",
"than",
"the",
"requested",
"one",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java#L228-L236 |
109,589 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java | MediaFormatHandlerImpl.isRenditionMatchExtension | private boolean isRenditionMatchExtension(MediaFormat mediaFormat) {
for (String extension : mediaFormat.getExtensions()) {
if (FileExtension.isImage(extension)) {
return true;
}
}
return false;
} | java | private boolean isRenditionMatchExtension(MediaFormat mediaFormat) {
for (String extension : mediaFormat.getExtensions()) {
if (FileExtension.isImage(extension)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isRenditionMatchExtension",
"(",
"MediaFormat",
"mediaFormat",
")",
"{",
"for",
"(",
"String",
"extension",
":",
"mediaFormat",
".",
"getExtensions",
"(",
")",
")",
"{",
"if",
"(",
"FileExtension",
".",
"isImage",
"(",
"extension",
")",
... | Checks if one of the extensions of the given media format are supported for renditions.
@param mediaFormat Media format
@return true if supported extension found | [
"Checks",
"if",
"one",
"of",
"the",
"extensions",
"of",
"the",
"given",
"media",
"format",
"are",
"supported",
"for",
"renditions",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/format/impl/MediaFormatHandlerImpl.java#L243-L250 |
109,590 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java | TransformedRenditionHandler.rotateSourceRenditions | private NavigableSet<RenditionMetadata> rotateSourceRenditions(Set<RenditionMetadata> candidates) {
if (rotation == null) {
return new TreeSet<>(candidates);
}
return candidates.stream()
.map(rendition -> new VirtualTransformedRenditionMetadata(rendition.getRendition(),
rotateMapWi... | java | private NavigableSet<RenditionMetadata> rotateSourceRenditions(Set<RenditionMetadata> candidates) {
if (rotation == null) {
return new TreeSet<>(candidates);
}
return candidates.stream()
.map(rendition -> new VirtualTransformedRenditionMetadata(rendition.getRendition(),
rotateMapWi... | [
"private",
"NavigableSet",
"<",
"RenditionMetadata",
">",
"rotateSourceRenditions",
"(",
"Set",
"<",
"RenditionMetadata",
">",
"candidates",
")",
"{",
"if",
"(",
"rotation",
"==",
"null",
")",
"{",
"return",
"new",
"TreeSet",
"<>",
"(",
"candidates",
")",
";",... | Rotates all source renditions if configured.
@param candidates Candidate renditions
@return Virtual-rotated and sorted candidate renditions | [
"Rotates",
"all",
"source",
"renditions",
"if",
"configured",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java#L80-L90 |
109,591 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java | TransformedRenditionHandler.getCropRendition | private VirtualTransformedRenditionMetadata getCropRendition(NavigableSet<RenditionMetadata> candidates) {
RenditionMetadata original = getOriginalRendition();
if (original == null) {
return null;
}
Double scaleFactor = getCropScaleFactor();
CropDimension scaledCropDimension = new CropDimensio... | java | private VirtualTransformedRenditionMetadata getCropRendition(NavigableSet<RenditionMetadata> candidates) {
RenditionMetadata original = getOriginalRendition();
if (original == null) {
return null;
}
Double scaleFactor = getCropScaleFactor();
CropDimension scaledCropDimension = new CropDimensio... | [
"private",
"VirtualTransformedRenditionMetadata",
"getCropRendition",
"(",
"NavigableSet",
"<",
"RenditionMetadata",
">",
"candidates",
")",
"{",
"RenditionMetadata",
"original",
"=",
"getOriginalRendition",
"(",
")",
";",
"if",
"(",
"original",
"==",
"null",
")",
"{"... | Searches for the biggest web-enabled rendition that matches the crop dimensions width and height or is bigger.
@param candidates
@return Rendition or null if no match found | [
"Searches",
"for",
"the",
"biggest",
"web",
"-",
"enabled",
"rendition",
"that",
"matches",
"the",
"crop",
"dimensions",
"width",
"and",
"height",
"or",
"is",
"bigger",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java#L97-L112 |
109,592 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java | TransformedRenditionHandler.getCropScaleFactor | private double getCropScaleFactor() {
RenditionMetadata original = getOriginalRendition();
RenditionMetadata webEnabled = AutoCropping.getWebRenditionForCropping(getAsset());
if (original == null || webEnabled == null || original.getWidth() == 0 || webEnabled.getWidth() == 0) {
return 1d;
}
re... | java | private double getCropScaleFactor() {
RenditionMetadata original = getOriginalRendition();
RenditionMetadata webEnabled = AutoCropping.getWebRenditionForCropping(getAsset());
if (original == null || webEnabled == null || original.getWidth() == 0 || webEnabled.getWidth() == 0) {
return 1d;
}
re... | [
"private",
"double",
"getCropScaleFactor",
"(",
")",
"{",
"RenditionMetadata",
"original",
"=",
"getOriginalRendition",
"(",
")",
";",
"RenditionMetadata",
"webEnabled",
"=",
"AutoCropping",
".",
"getWebRenditionForCropping",
"(",
"getAsset",
"(",
")",
")",
";",
"if... | The cropping coordinates are stored with coordinates relating to the web-enabled rendition. But we want
to crop the original image, so we have to scale those values to match the coordinates in the original image.
@return Scale factor | [
"The",
"cropping",
"coordinates",
"are",
"stored",
"with",
"coordinates",
"relating",
"to",
"the",
"web",
"-",
"enabled",
"rendition",
".",
"But",
"we",
"want",
"to",
"crop",
"the",
"original",
"image",
"so",
"we",
"have",
"to",
"scale",
"those",
"values",
... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/dam/impl/TransformedRenditionHandler.java#L119-L126 |
109,593 | wcm-io/wcm-io-handler | link/src/main/java/io/wcm/handler/link/type/helpers/SyntheticNavigatableResource.java | SyntheticNavigatableResource.get | static @NotNull Resource get(String path, ResourceResolver resolver) {
Resource resource = resolver.getResource(path);
if (resource != null) {
return resource;
}
return new SyntheticNavigatableResource(path, resolver);
} | java | static @NotNull Resource get(String path, ResourceResolver resolver) {
Resource resource = resolver.getResource(path);
if (resource != null) {
return resource;
}
return new SyntheticNavigatableResource(path, resolver);
} | [
"static",
"@",
"NotNull",
"Resource",
"get",
"(",
"String",
"path",
",",
"ResourceResolver",
"resolver",
")",
"{",
"Resource",
"resource",
"=",
"resolver",
".",
"getResource",
"(",
"path",
")",
";",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"return",
... | Get resource for path. If the path does not exist a synthetic resource is created which supports
navigation over it's parents until it reaches a resource that exists.
@param path Path
@return Resource (never null) | [
"Get",
"resource",
"for",
"path",
".",
"If",
"the",
"path",
"does",
"not",
"exist",
"a",
"synthetic",
"resource",
"is",
"created",
"which",
"supports",
"navigation",
"over",
"it",
"s",
"parents",
"until",
"it",
"reaches",
"a",
"resource",
"that",
"exists",
... | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/type/helpers/SyntheticNavigatableResource.java#L87-L93 |
109,594 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/MediaArgs.java | MediaArgs.dragDropSupport | public @NotNull MediaArgs dragDropSupport(DragDropSupport value) {
if (value == null) {
throw new IllegalArgumentException("No null value allowed for drag&drop support.");
}
this.dragDropSupport = value;
return this;
} | java | public @NotNull MediaArgs dragDropSupport(DragDropSupport value) {
if (value == null) {
throw new IllegalArgumentException("No null value allowed for drag&drop support.");
}
this.dragDropSupport = value;
return this;
} | [
"public",
"@",
"NotNull",
"MediaArgs",
"dragDropSupport",
"(",
"DragDropSupport",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"No null value allowed for drag&drop support.\"",
")",
";",
"}",
"this... | Drag&Drop support for media builder.
@param value Drag&Drop support
@return this | [
"Drag&",
";",
"Drop",
"support",
"for",
"media",
"builder",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/MediaArgs.java#L498-L504 |
109,595 | wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/impl/ImageFileServlet.java | ImageFileServlet.getImageFileName | public static String getImageFileName(String originalFilename) {
String namePart = StringUtils.substringBeforeLast(originalFilename, ".");
String extensionPart = StringUtils.substringAfterLast(originalFilename, ".");
// use PNG format if original image is PNG, otherwise always use JPEG
if (StringUtils.... | java | public static String getImageFileName(String originalFilename) {
String namePart = StringUtils.substringBeforeLast(originalFilename, ".");
String extensionPart = StringUtils.substringAfterLast(originalFilename, ".");
// use PNG format if original image is PNG, otherwise always use JPEG
if (StringUtils.... | [
"public",
"static",
"String",
"getImageFileName",
"(",
"String",
"originalFilename",
")",
"{",
"String",
"namePart",
"=",
"StringUtils",
".",
"substringBeforeLast",
"(",
"originalFilename",
",",
"\".\"",
")",
";",
"String",
"extensionPart",
"=",
"StringUtils",
".",
... | Get image filename to be used for the URL with file extension matching the image format which is produced by this
servlet.
@param originalFilename Original filename of the image to render.
@return Filename to be used for URL. | [
"Get",
"image",
"filename",
"to",
"be",
"used",
"for",
"the",
"URL",
"with",
"file",
"extension",
"matching",
"the",
"image",
"format",
"which",
"is",
"produced",
"by",
"this",
"servlet",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/impl/ImageFileServlet.java#L155-L167 |
109,596 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/impl/DataPropertyUtil.java | DataPropertyUtil.toHtml5DataName | public static String toHtml5DataName(String headlessCamelCaseName) {
if (StringUtils.isEmpty(headlessCamelCaseName)) {
throw new IllegalArgumentException("Property name is empty.");
}
if (!isHeadlessCamelCaseName(headlessCamelCaseName)) {
throw new IllegalArgumentException("This is not a valid h... | java | public static String toHtml5DataName(String headlessCamelCaseName) {
if (StringUtils.isEmpty(headlessCamelCaseName)) {
throw new IllegalArgumentException("Property name is empty.");
}
if (!isHeadlessCamelCaseName(headlessCamelCaseName)) {
throw new IllegalArgumentException("This is not a valid h... | [
"public",
"static",
"String",
"toHtml5DataName",
"(",
"String",
"headlessCamelCaseName",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"headlessCamelCaseName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Property name is empty.\"",
")... | Converts a headless camel case property name to a HTML5 data attribute name including "data-" prefix.
@param headlessCamelCaseName Headless camel case name
@return HTML5 data attribute name
@throws IllegalArgumentException If parameter name is not valid | [
"Converts",
"a",
"headless",
"camel",
"case",
"property",
"name",
"to",
"a",
"HTML5",
"data",
"attribute",
"name",
"including",
"data",
"-",
"prefix",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/impl/DataPropertyUtil.java#L47-L65 |
109,597 | wcm-io/wcm-io-handler | richtext/src/main/java/io/wcm/handler/richtext/impl/DataPropertyUtil.java | DataPropertyUtil.toHeadlessCamelCaseName | public static String toHeadlessCamelCaseName(String html5DataName) {
if (StringUtils.isEmpty(html5DataName)) {
throw new IllegalArgumentException("Property name is empty.");
}
if (!isHtml5DataName(html5DataName)) {
throw new IllegalArgumentException("This is not a valid HTML5 data property name:... | java | public static String toHeadlessCamelCaseName(String html5DataName) {
if (StringUtils.isEmpty(html5DataName)) {
throw new IllegalArgumentException("Property name is empty.");
}
if (!isHtml5DataName(html5DataName)) {
throw new IllegalArgumentException("This is not a valid HTML5 data property name:... | [
"public",
"static",
"String",
"toHeadlessCamelCaseName",
"(",
"String",
"html5DataName",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"html5DataName",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Property name is empty.\"",
")",
";"... | Converts a HTML5 data attribute name including "data-" prefix to a headless camel case name.
@param html5DataName Html5 data attribute name
@return Headless camel case name
@throws IllegalArgumentException If parameter name is not valid | [
"Converts",
"a",
"HTML5",
"data",
"attribute",
"name",
"including",
"data",
"-",
"prefix",
"to",
"a",
"headless",
"camel",
"case",
"name",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/richtext/src/main/java/io/wcm/handler/richtext/impl/DataPropertyUtil.java#L73-L99 |
109,598 | wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java | AbstractElement.setName | @Override
@Deprecated
public final org.jdom2.Element setName(String value) {
return super.setName(value);
} | java | @Override
@Deprecated
public final org.jdom2.Element setName(String value) {
return super.setName(value);
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"final",
"org",
".",
"jdom2",
".",
"Element",
"setName",
"(",
"String",
"value",
")",
"{",
"return",
"super",
".",
"setName",
"(",
"value",
")",
";",
"}"
] | Sets element name - should not be used for HtmlElement-derived classes!
@param value Element name
@return Self reference
@deprecated Deprecated | [
"Sets",
"element",
"name",
"-",
"should",
"not",
"be",
"used",
"for",
"HtmlElement",
"-",
"derived",
"classes!"
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java#L60-L64 |
109,599 | wcm-io/wcm-io-handler | commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java | AbstractElement.getAttributeValueAsInteger | public final int getAttributeValueAsInteger(String attributeName) {
Attribute attribute = getAttribute(attributeName);
if (attribute == null) {
return 0;
}
else {
try {
return attribute.getIntValue();
}
catch (DataConversionException ex) {
return 0;
}
}
... | java | public final int getAttributeValueAsInteger(String attributeName) {
Attribute attribute = getAttribute(attributeName);
if (attribute == null) {
return 0;
}
else {
try {
return attribute.getIntValue();
}
catch (DataConversionException ex) {
return 0;
}
}
... | [
"public",
"final",
"int",
"getAttributeValueAsInteger",
"(",
"String",
"attributeName",
")",
"{",
"Attribute",
"attribute",
"=",
"getAttribute",
"(",
"attributeName",
")",
";",
"if",
"(",
"attribute",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"else",
... | Gets attribute value as integer.
@param attributeName Attribute name
@return Attribute value as integer or 0 if not set. | [
"Gets",
"attribute",
"value",
"as",
"integer",
"."
] | b0fc1c11a3ceb89efb73826dcfd480d6a00c19af | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/commons/src/main/java/io/wcm/handler/commons/dom/AbstractElement.java#L71-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.