/** * Remove this entry. * * @param container * The container id. * @param edit * The entry to remove. */ public void removeResource(String container, Edit edit) { if (container == null) container = ""; Container c = ((Container) m_store.get(container)); if (c != null) { // remove from the info store c.contained.remove(caseId(edit.getId())); } // release the lock m_locks.remove(edit.getReference()); }
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); Object[] flds = m_user.storageFields(edit); System.arraycopy(flds, 0, fields, 0, flds.length); fields[fields.length - 2] = xml; fields[fields.length - 1] = caseId(edit.getId()); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = internalRecordId(caseId(edit.getId())); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Cancel the changes and release the locked container. * * @param container * The container id. * @param edit * The entry to cancel. */ public void cancelContainer(Edit edit) { // release the lock m_locks.remove(edit.getReference()); }
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); String statement = doubleStorageSql.getUpdateSql(m_containerTableName, m_containerTableIdField); Object[] fields = new Object[2]; fields[0] = xml; fields[1] = edit.getReference(); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = doubleStorageSql.getRecordId(edit.getReference()); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Remove this (locked) Resource. * * @param edit * The Edit to remove. * @param key * The key to relate resource to properties, of if null, id is assumed. */ public void removeResource(final Edit edit, final Object key) { // do this in a transaction m_sql.transact(new Runnable() { public void run() { removeResourceTx(edit, key); } }, "removeResource:" + edit.getId()); }
ResourcePropertiesEdit props = o.getPropertiesEdit();
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); Object[] flds = m_user.storageFields(edit); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = internalRecordId(caseId(edit.getId())); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Cancel the changes and release the lock. * * @param container * The container id. * @param edit * The entry to cancel. */ public void cancelResource(String container, Edit edit) { // release the lock m_locks.remove(edit.getReference()); }
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); String statement = doubleStorageSql.getUpdateSql(m_containerTableName, m_containerTableIdField); Object[] fields = new Object[2]; fields[0] = xml; fields[1] = edit.getReference(); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = doubleStorageSql.getRecordId(edit.getReference()); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Remove this (locked) Resource. * * @param edit * The Edit to remove. * @param key * The key to relate resource to properties, of if null, id is assumed. */ public void removeResource(final Edit edit, final Object key) { // do this in a transaction m_sql.transact(new Runnable() { public void run() { removeResourceTx(edit, key); } }, "removeResource:" + edit.getId()); }
ResourcePropertiesEdit props = o.getPropertiesEdit();
/** * Remove this entry. * * @param container * The container id. * @param edit * The entry to remove. */ public void removeResource(String container, Edit edit) { if (container == null) container = ""; Container c = ((Container) m_store.get(container)); if (c != null) { // remove from the info store c.contained.remove(caseId(edit.getId())); } // release the lock m_locks.remove(edit.getReference()); }
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); Object[] flds = m_user.storageFields(edit); System.arraycopy(flds, 0, fields, 0, flds.length); fields[fields.length - 2] = xml; fields[fields.length - 1] = caseId(edit.getId()); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = internalRecordId(caseId(edit.getId())); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Cancel the changes and release the locked container. * * @param container * The container id. * @param edit * The entry to cancel. */ public void cancelContainer(Edit edit) { // release the lock m_locks.remove(edit.getReference()); }
Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = internalRecordId(caseId(edit.getId())); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); Object[] flds = m_user.storageFields(edit); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = internalRecordId(caseId(edit.getId())); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Cancel the changes and release the lock. * * @param container * The container id. * @param edit * The entry to cancel. */ public void cancelResource(String container, Edit edit) { // release the lock m_locks.remove(edit.getReference()); }
Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = internalRecordId(caseId(edit.getId())); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
edit.toXml(doc, new Stack()); String xml = StorageUtils.writeDocumentToString(doc); String statement = doubleStorageSql.getUpdate2Sql(m_resourceTableName, m_resourceTableIdField, m_resourceTableContainerIdField, fields[fields.length - 3] = xml; fields[fields.length - 2] = container.getReference(); fields[fields.length - 1] = edit.getId(); Connection lock = (Connection) m_locks.get(edit.getReference()); if (lock == null) m_locks.remove(edit.getReference()); lockFields[1] = doubleStorageSql.getRecordId(container.getReference() + "/" + edit.getId()); boolean ok = m_sql.dbWrite(statement, lockFields); if (!ok) m_locks.remove(edit.getReference());
/** * Remove this container and all it contains. * * @param container * The container id. * @param edit * The entry to remove. */ public void removeContainer(Edit edit) { Container c = ((Container) m_store.get(edit.getReference())); if (c != null) { m_store.remove(c); // %%% better cleanup? } // release the lock m_locks.remove(edit.getReference()); }