return namespaceContext.getPrefix(getNamespace()) + ":" + localName();
}
+ /** This qualified named with its default prefix. If it is unqualified this method should be overridden, or QNamed.Unqualified be used. */
default String get() {
return getDefaultPrefix() + ":" + localName();
}
return XMLConstants.DEFAULT_NS_PREFIX;
}
+ @Override
+ default String get() {
+ return localName();
+ }
+
}
}
return this;
}
+ /**
+ * Convenience method, to search below this absolute path, with depth
+ * {@link Depth#INFINITTY}.
+ */
+ public BasicSearch from(String path) {
+ return from(URI.create(path), Depth.INFINITTY);
+ }
+
+ /** Search below this URI, with depth {@link Depth#INFINITTY}. */
public BasicSearch from(URI uri) {
return from(uri, Depth.INFINITTY);
}
+ /** Search below this URI, with this {@link Depth}. */
public BasicSearch from(URI uri, Depth depth) {
Objects.requireNonNull(uri);
Objects.requireNonNull(depth);
package org.argeo.api.acr.search;
/** A composition which is the intersection of sets (AND). */
-class Intersection implements Composition {
+public class Intersection implements Composition {
ContentFilter<Intersection> filter;
@SuppressWarnings("unchecked")
package org.argeo.api.acr.search;
/** A composition which is the union of sets (OR). */
-class Union implements Composition {
+public class Union implements Composition {
ContentFilter<Union> filter;
@SuppressWarnings("unchecked")
import org.argeo.api.acr.Content;
import org.argeo.api.acr.ContentNotFoundException;
+import org.argeo.api.acr.ContentSession;
import org.argeo.api.acr.search.BasicSearch;
/**
throw new UnsupportedOperationException();
}
+ /*
+ * EDITION
+ */
+ /**
+ * Called when an edition cycle is completed. Does nothing by default.
+ *
+ * @see ContentSession#edit(java.util.function.Consumer)
+ */
+ default void persist(ProvidedSession session) {
+ }
+
/*
* NAMESPACE CONTEXT
*/
import org.argeo.api.acr.spi.ProvidedRepository;
import org.argeo.api.acr.spi.ProvidedSession;
import org.argeo.api.uuid.UuidFactory;
-import org.argeo.cms.acr.xml.DomContentProvider;
+import org.argeo.cms.CurrentUser;
/** Implements {@link ProvidedSession}. */
class CmsContentSession implements ProvidedSession {
synchronized (CmsContentSession.this) {
// TODO optimise
for (ContentProvider provider : modifiedProviders) {
- if (provider instanceof DomContentProvider) {
- ((DomContentProvider) provider).persist(s);
- }
+ provider.persist(s);
+// if (provider instanceof DomContentProvider) {
+// ((DomContentProvider) provider).persist(s);
+// }
}
modifiedProviders.clear();
return s;
return sessionRunDir;
}
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof CmsContentSession session)
+ return uuid.equals(session.uuid);
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "Content Session " + uuid + " (" + CurrentUser.getUsername(subject) + ")";
+ }
+
/*
* SEARCH
*/
return nodes.getLength() != 0;
}
+ @Override
public void persist(ProvidedSession session) {
if (mountPath != null) {
Content mountPoint = session.getMountPoint(mountPath);